Skip to content

Commit

Permalink
Open file in corresponding workspace
Browse files Browse the repository at this point in the history
It took me some time to understand why autocomplete does not work properly.

See https://stackoverflow.com/a/72743549/633961

I guess you want a different wording. Feel free to change the text of my PR. But I think
a hint like this needs to be at the top of the file.
  • Loading branch information
guettli authored Jun 24, 2022
1 parent 8dfd393 commit 0e27513
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ If you suspect that the Go extension is not working correctly, please follow the

Verify that your project is in good shape by working with it at the command line. Running a command like `go build ./...` in the workspace directory will compile everything. For modules, `go mod tidy` is another good check, though it may modify your `go.mod`.

## Open file in corresponding workspace

Make sure the you edit belongs to your module. If you open a file from a different module, then autocomplete might not work. Use "Open Folder"
to open a different go module.

## Look for serious errors and diagnostics

Check that there aren't any diagnostics that indicate a problem with your workspace. First, check the bottom-center of the VS Code window for any errors. After that, check the package declaration of the any Go files you're working in, and your `go.mod` file. Problems in the workspace configuration can cause many different symptoms. See the [`gopls` workspace setup instructions](https://github.com/golang/tools/blob/master/gopls/doc/workspace.md) for help.
Expand Down Expand Up @@ -75,4 +80,4 @@ We can't diagnose a problem from just a description. When filing an issue, pleas
1. Relevant VS Code settings: run `Preferences: Open Settings (JSON)` and include anything in a `[go]` block, and anything that starts with `go.` or `gopls.`
1. Extension and `gopls` logs as seems appropriate for the bug. (Include from the beginning of the logs if possible.)

Once you've collected that information, [file your issue](https://github.com/golang/vscode-go/issues/new/choose).
Once you've collected that information, [file your issue](https://github.com/golang/vscode-go/issues/new/choose).

0 comments on commit 0e27513

Please sign in to comment.