From 0e27513bf07f5b2c5cc8937c3bb973701e694236 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=BCttler?= Date: Fri, 24 Jun 2022 13:54:12 +0200 Subject: [PATCH] Open file in corresponding workspace 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. --- docs/troubleshooting.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index fa8498b5af..fb9e103005 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -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. @@ -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). \ No newline at end of file +Once you've collected that information, [file your issue](https://github.com/golang/vscode-go/issues/new/choose).