Skip to content

Code action for static import doesn't work well in a specific case #3835

@yuyully

Description

@yuyully
Environment
  • Operating System: Windows
  • JDK version: 17.0.8
  • Visual Studio Code version: 1.95.0
  • Java extension version: 1.36.0
Steps To Reproduce
  1. Open https://github.com/junit-team/junit5-samples/tree/master/junit5-migration-maven
  2. Open FirstTest.java file
  3. Comment out import static org.junit.jupiter.api.Assertions.assertEquals;
  4. Add import static org.junit.Assert.*;
  5. Click quick fix before assertEquals
Current Result
  • It shouldn't show the option Add static import for 'Assert.assertEquals' as it has been included in import static org.junit.Assert.*;. And this option doesn't work if clicking it.
  • Without import static org.junit.Assert.*;, code action Add static import for 'Assert.assertEquals works only at first time. After first clicking, it still shows this option even the import has been added.

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions