Skip to content

Commit 743aca1

Browse files
committed
docs: update documentation for Go status bar
Selecting the Go status bar item will display a menu to: 1. Locate configured Go tools 2. Manage the Go version 3. Open 'gopls' trace 4. Open go.mod Change-Id: Iad25339ea66383b15192b1a3c69cda0cc21e4a35 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/264197 Trust: Suzy Mueller <[email protected]> Trust: Hyang-Ah Hana Kim <[email protected]> Run-TryBot: Suzy Mueller <[email protected]> TryBot-Result: kokoro <[email protected]> Reviewed-by: Hyang-Ah Hana Kim <[email protected]>
1 parent 222e0d0 commit 743aca1

File tree

6 files changed

+47
-17
lines changed

6 files changed

+47
-17
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ You should immediately see a prompt in the bottom-right corner of your screen ti
6161

6262
If you see an error that looks like `command Go: Install/Update Tools not found`, it means that the extension has failed to activate and register its commands. Please uninstall and then reinstall the extension.
6363

64+
When the extension is active, you should see the [Go status bar](docs/ui.md) in the bottom left corner.
65+
6466
### Start coding
6567

6668
You're ready to Go!

docs/go-version.md

Lines changed: 0 additions & 17 deletions
This file was deleted.

docs/images/gopls.png

7.76 KB
Loading

docs/images/selectGoVersion.png

253 KB
Loading

docs/images/statusbarmenu.png

185 KB
Loading

docs/ui.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Extension UI
2+
3+
## Using The Go Status Bar
4+
5+
The Go status bar appears in the lower left of the extension window. Clicking the Go status bar brings up a menu that provides easy access to see and update important information about your Go project. This includes information about the Go environment, the current Go version, the `gopls` trace, and about the current module.
6+
7+
<div style="text-align: center;"><img src="images/statusbarmenu.png" alt="vscode extension after Go status bar item is clicked" style="width:75%" > </div>
8+
9+
### Go Environment
10+
11+
The `Go Locate Configured Go Tools` command will display the configured GOPATH, GOROOT, tool locations and the results of `go env` in the output window.
12+
13+
### Managing Your Go Version
14+
15+
You can view the current Go version by looking at the status bar item in the bottom left corner of VS Code. Clicking this button and selecting `Choose Go Environment` will present you with a menu from which you can select any version of Go that exists in your $HOME/sdk directory or on <https://golang.org/dl>. This command is also available through the command pallette using `Go: Choose Go Environment`.
16+
17+
Previously, the `go.goroot` and `go.alternateTools` settings controlled the Go version used by VS Code Go. If you have configured these settings, they are no longer needed and should be deleted.
18+
19+
<div style="text-align: center;"><img src="images/selectGoVersion.png" alt="command pallete menu for selecting a new Go version" style="width:75%" > </div>
20+
21+
22+
The "Clear Selection" option resets your Go version to the one found first in either `go.alternateTools`, `go.goroot` or your PATH.
23+
24+
### Installing a New Go Version
25+
26+
After selecting any Go version that has not yet been installed (such as Go 1.14.6 in the screenshot above), the binary will be automatically installed in $HOME/sdk and put to use in your environment.
27+
28+
Once the download completes, VS Code Go will make use of this new Go version.
29+
30+
### Language Server Status
31+
32+
`gopls` is the official Go [language server](https://langserver.org/) developed by the Go team. It was developed in response to the release of [Go modules](docs/modules.md), and it is the recommended approach when working with [Go modules](docs/modules.md) in VS Code.
33+
34+
When `gopls` is enabled, :zap: is displayed next to the Go version in the status bar and the `gopls` version is displayed in the menu.
35+
36+
<div style="text-align: center;"><img src="images/gopls.png" alt="command pallete menu for selecting a new Go version" style="width:100px" > </div>
37+
38+
Selecting `Open 'gopls' trace` will open the trace of the `gopls` server in the output window. Please include this trace when filing an issue related to the extension and `gopls` is enabled.
39+
40+
### Modules Status
41+
42+
When modules are enabled for the file you have open, you can navigate to the `go.mod` file for the project using the menu. If you do not see the `Open go.mod` item, then the extension does not think the file you have open belongs to a module.
43+
44+
More information about [using Go modules](https://blog.golang.org/using-go-modules) is available on the Go blog.
45+

0 commit comments

Comments
 (0)