Willis
Willis

Reputation: 777

vscode go no intellisense

These are my configurations:

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

When I typed 'fmt.', it should infer the method of fmt pkg, for example: Println(), but it didn't shows up(see the screen record video) https://i.imgur.com/3DHcFAf.mp4

Upvotes: 0

Views: 1331

Answers (1)

pitprok
pitprok

Reputation: 532

Try reloading the window

Press F1 and search for Developer: Reload window

These were my steps

  1. Open a new file in VScode
  2. Change the language mode to go
  3. Save as main.go
  4. Wrote the same code you did (after writing fmt. there was no autocomplete)
  5. Reloaded the window
  6. Typed fmt. and the window with the suggestions opened up

It seems that VScode doesn't immediately provide all language-specific features as soon as the file is created, but if the file is already there when VScode is loading, the extensions work as they should

If that isn't working, check your language server settings. You can see the JSON of your settings by pressing F1 and selecting Preferences: Open Settings (JSON)

Check if you have a line that starts with "go.useLanguageServer"

Upvotes: 1

Related Questions