microsoft / vscode-maven

VSCode extension "Maven for Java"
https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-maven
Other
181 stars 88 forks source link

Unable to resolve unknown type as command "maven.artifactSearch"fails #968

Open v-yuyul opened 1 year ago

v-yuyul commented 1 year ago

Describe the bug Unable to resolve unknown type as command "maven.artifactSearch"fails. If remove the code 'static void fun(){}', it will work fine.

To Reproduce Steps to reproduce the behavior:

  1. Create a new java file > Add following code

    public class Test {
    public static void main(string[] args) {
    
    }
    
    static void fun() {
        int a
        for (l < 10) {
    
        }
    }
    }
  2. Hovering on the main method > Select 'Resolve unknown Type' > Select one dependency > Shows an error

Expected behavior Can add a dependency to resolve the unknown type.

Environments (please complete the following information as much as possible):

Screenshots image