Search code examples
javadockervisual-studio-code

Developing with docker and vscode, sometimes the intellisense works sometimes it doesn't


I created two modules under the same project, in the first module, the Junit test functions has a little "play" or "success" icon picture 1

but I created another module, but the Junit test intellisense doesn't work at all

picture 2

And I'm pretty sure there's a junit dependency in pom.xml, cause the vscode didn't report an error, have you ever encountered this kind of error?

Any help as well as hint will be appreciated. thank you


Solution

  • It turns out that I have so many maven modules in this project, vscode needs some time to import all of them and figure out the dependencies

    my project modules picture

    there will be notifications in the bottom status bar, only after all the modules have been resolved and imported that vscode extensions will then start to work


    Secondly, sometimes you need to close and reopen your vscode when you just created a new project or module inside your workdir for your vscode to resolve it


    Thirdly, using docker images from https://mcr.microsoft.com/ (which is the official image repository of microsoft) may provides more stability or consistency working with vscode as IDE