Home > front end >  What do i do if autocomplete doesn't work in my vs code golang project?
What do i do if autocomplete doesn't work in my vs code golang project?

Time:03-02

The simple advices like to restart VS Code or to reinstall the tools do not make any difference.

When I type in something, I get the result like in this image.

The problem is not in the Intellisense itself, because when I work in my html or css files, autocomplete works perfectly

All the information I found in the internet hasn't helped me so I've decided to search for help here.

CodePudding user response:

This happens when you are in an another imported project's source file, outside of your main project.

For example if you have a project in a folder like "test1" that imports a package, like import "test2". You open your test1 folder in VSCode, then navigate into a file from test2 for example with a Ctrl Click on a test2 based func. Then in this file the linter will not help you, since you are not in the test2 project. You need to open another VSCode in test2 folder to have it work.

CodePudding user response:

As long as there are any syntax errors somewhere else in the file, the behavior might also take place.
Please make sure there are no compiler relevant syntax errors in the file.

  • Related