1# Troubleshooting 2 3If you see a gopls error or crash, or gopls just stops working, please follow the troubleshooting steps below. 4 5## Steps 6 7<!--- TODO: troubleshooting 8describe more basic and optional trouble shooting steps 9 like checking you opened the module root 10 and using the debug pages 11---> 12 131. Make sure your `gopls` is [up to date](user.md#installing). 141. Check the [known issues](status.md#known-issues). 151. [Report the issue](#file-an-issue). 16 17## File an issue 18 19You can use: 20* Your editor's bug submission integration (if available). For instance, `:GoReportGitHubIssue` in [`vim-go`](vim.md#vim-go). 21* `gopls bug` on the command line. 22* The [Go issue tracker](https://github.com/golang/go/issues/new?title=x%2Ftools%2Fgopls%3A%20%3Cfill%20this%20in%3E). 23 24Along with an explanation of the issue, please share the information listed here: 25 261. Your editor and any settings you have configured (for example, your VSCode `settings.json` file). 271. A sample program that reproduces the issue, if possible. 281. The output of `gopls version` on the command line. 291. The output of `gopls -rpc.trace -v check /path/to/file.go`. 301. gopls logs from when the issue occurred, as well as a timestamp for when the issue began to occur. See the [instructions](#capturing-gopls-logs) for information on how to capture gopls logs. 31 32Much of this information is filled in for you if you use `gopls bug` to file the issue. 33 34### Capturing logs 35 36#### VS Code 37 38For VSCode users, the gopls log can be found by navigating to `View` -> `Output` (or `Ctrl+K Ctrl+H`). There will be a drop-down menu titled `Tasks` in the top-right corner. Select the `gopls` item, which will contain the `gopls` logs. 39 40To increase the level of detail in your logs, add the following to your VS Code settings: 41 42```json5 43"go.languageServerFlags": [ 44 "-rpc.trace" 45] 46``` 47 48To start a debug server that will allow you to see profiles and memory usage, add the following to your VS Code settings: 49 50```json5 51"go.languageServerFlags": [ 52 "serve", 53 "-rpc.trace", 54 "--debug=localhost:6060", 55], 56``` 57 58You will then be able to view debug information by navigating to `localhost:6060`. 59 60#### Other editors 61 62For other editors, you may have to directly pass a `-logfile` flag to gopls. 63 64To increase the level of detail in your logs, start `gopls` with the `-rpc.trace` flag. To start a debug server that will allow you to see profiles and memory usage, start `gopls` with `serve --debug=localhost:6060`. You will then be able to view debug information by navigating to `localhost:6060`. 65 66If you are unsure of how to pass a flag to `gopls` through your editor, please see the [documentation for your editor](user.md#editors). 67 68### Restart your editor 69 70Once you have filed an issue, you can then try to restart your `gopls` instance by restarting your editor. In many cases, this will correct the problem. In VSCode, the easiest way to restart the language server is by opening the command palette (Ctrl + Shift + P) and selecting `"Go: Restart Language Server"`. You can also reload the VSCode instance by selecting `"Developer: Reload Window"`. 71