redhat-developer / vscode-java

Java Language Support for Visual Studio Code
Eclipse Public License 2.0
2.08k stars 441 forks source link

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

Open yuyully opened 3 weeks ago

yuyully commented 3 weeks ago
Environment
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

image

fbricon commented 3 weeks ago

Looks like the import detection mechanism doesn't consider the method signatures, hence proposes incompatible options