8
8
provides rich language support for the
9
9
[ Go programming language] ( https://golang.org/ ) .
10
10
11
- > 📣 We will enable the language server ([ ` gopls ` ] ) by default in the end of Jan
12
- > 2021 . We recommend switching to the language server now
13
- > (` "go.useLanguageServer": true ` ) to confirm it works well for you. Please
14
- > [ file a new issue] ( https://github.com/golang/vscode-go/issues/new/choose ) if
15
- > you notice bugs or missing features.
16
-
17
11
## Quick Start
18
12
19
13
Welcome! 👋🏻<br />
@@ -23,7 +17,7 @@ extension fits your needs and enhances your development experience.
23
17
* ** Step 1.** If you haven't done so already, install [ Go] ( https://golang.org )
24
18
and the [ VS Code Go extension] .
25
19
* [ Go installation guide] . This extension works best with Go 1.14+.
26
- * [ Manage extensions in VS Code] .
20
+ * [ Managing extensions in VS Code] .
27
21
* ** Step 2.** To activate the extension, open any directory or workspace
28
22
containing Go code. Once activated, the [ Go status bar] ( docs/ui.md ) will
29
23
appear in the bottom left corner of the window and show the recognized Go
@@ -40,23 +34,23 @@ extension fits your needs and enhances your development experience.
40
34
41
35
You are ready to Go :-)   ;  ; 🎉🎉🎉
42
36
43
- Please be sure to learn more about many [ features] ( #features ) of this extension
44
- as well as how to [ customize] ( #customization ) them. Take a look at
37
+ Please be sure to learn more about the many [ features] ( #features ) of this
38
+ extension, as well as how to [ customize] ( #customization ) them. Take a look at
45
39
[ Troubleshooting] ( docs/troubleshooting.md ) and [ Help] ( #ask-for-help ) for further
46
40
guidance.
47
41
48
42
If you are new to Go, [ this article] ( https://golang.org/doc/code.html ) provides
49
- the overview on go code organization and basic ` go ` commands. The recent
50
- [ Go open source live video ] featured VS Code Go and demonstrated how other
51
- Gophers use the features to enhance their Go development workflow .
43
+ the overview on Go code organization and basic ` go ` commands. Watch [ this video
44
+ from the Go Open Source Live conference ] for an explanation of how to build
45
+ your first Go application using VS Code Go.
52
46
53
47
## Features
54
48
55
49
This extension provides many features, including [ IntelliSense] ,
56
- [ code navigation] , [ code editing] support. It also shows [ diagnostics] as you
57
- work and provides enhanced support for [ testing] and [ debugging] your programs.
58
- See the [ full feature breakdown] for more details and to learn how to tune the
59
- behavior.
50
+ [ code navigation] , and [ code editing] support. It also shows [ diagnostics] as
51
+ you work and provides enhanced support for [ testing] and [ debugging] your
52
+ programs. See the [ full feature breakdown] for more details and to learn how to
53
+ tune its behavior.
60
54
61
55
<p align =center >
62
56
<img src =" docs/images/completion-signature-help.gif " width =75% >
@@ -68,68 +62,75 @@ In addition to integrated editing features, the extension provides several
68
62
commands for working with Go files. You can access any of these by opening the
69
63
Command Palette (` Ctrl+Shift+P ` on Linux/Windows and ` Cmd+Shift+P ` on Mac), and
70
64
then typing in the command name. See the
71
- [ full list of commands] ( docs/commands.md#detailed-list ) provided by the
65
+ [ full list of commands] ( docs/commands.md#detailed-list ) provided by this
72
66
extension.
73
67
74
68
<p align =center >
75
69
<img src =" docs/images/toggletestfile.gif " width =75% >
76
70
<br /><em >(Toggle Test File)</em ></p >
77
71
78
- ** ⚠️ Note** : the default syntax highlighting for Go files is provided by the
72
+ ** ⚠️ Note** : the default syntax highlighting for Go files is provided by a
79
73
[ TextMate rule] ( https://github.com/jeff-hykin/better-go-syntax ) embedded in VS
80
74
Code, not by this extension.
81
75
82
76
## Tools
83
77
84
78
The extension uses a few command-line tools developed by the Go community. In
85
- particular, ` go ` , ` gopls ` , and ` dlv ` are used to implement build/test, language
86
- features, and debugging functionalities of this extension. See the
87
- [ tools documentation] ( docs/tools.md ) for a complete list of tools the extension
88
- depends on.
89
-
90
- In order to locate the command-line tools, the extension searches ` $GOPATH/bin `
91
- and directories specified in the ` PATH ` environment variable (or ` Path ` in
92
- Windows) with which the VS Code process has started. If the tools are not found,
93
- the extension will prompt you to install the missing tools and show the "⚠️
94
- Analysis Tools Missing" warning in the bottom right corner. Please install them
95
- by responding to the warning notification, or by manually running the `Go:
96
- Install/Update Go Tools` command. The extension will run the
97
- [ ` go get ` ] ( https://golang.org/cmd/go ) command to install them.
79
+ particular, ` go ` , ` gopls ` , and ` dlv ` ** must** be installed for this extension
80
+ to work correctly. See the [ tools documentation] ( docs/tools.md ) for a complete
81
+ list of tools the extension depends on.
82
+
83
+ In order to locate these command-line tools, the extension searches
84
+ ` GOPATH/bin ` and directories specified in the ` PATH ` environment variable (or
85
+ ` Path ` on Windows) with which the VS Code process has started. If the tools are
86
+ not found, the extension will prompt you to install the missing tools and show
87
+ the "⚠️ Analysis Tools Missing" warning in the bottom right corner. Please
88
+ install them by responding to the warning notification, or by manually running
89
+ the [ ` Go: Install/Update Go Tools ` command] .
98
90
99
91
## Setting up your workspace
100
92
101
93
[ Go modules] ( https://golang.org/ref/mod ) are how Go manages dependencies in
102
94
recent versions of Go. Modules replace the ` GOPATH ` -based approach to specifying
103
95
which source files are used in a given build, and they are the default build
104
96
mode in go1.16+. While this extension continues to support both Go modules and
105
- ` GOPATH ` mode , we highly recommend Go development in module mode. If you are
97
+ ` GOPATH ` modes , we highly recommend Go development in module mode. If you are
106
98
working on existing projects, please consider migrating to modules.
107
99
108
100
Unlike the traditional ` GOPATH ` mode, module mode does not require the workspace
109
101
to be located under ` GOPATH ` nor to use a specific structure. A module is
110
102
defined by a directory tree of Go source files with a ` go.mod ` file in the
111
- tree's root directory. Your project may involve one or more modules. If you are
112
- working with multiple modules or uncommon project layouts, you will need to
113
- configure your workspace so that the extension knows which code to load, so that
114
- features like references can work across modules. Please see the
115
- for information on supported workspace layouts.
103
+ tree's root directory.
104
+
105
+ Your project may involve one or more modules. If you are working with multiple
106
+ modules or uncommon project layouts, you will need to configure your workspace
107
+ by using [ Workspace Folders] . Please see this [ documentation about supported
108
+ workspace layouts] .
116
109
117
110
## Customization
118
111
119
112
The extension needs no configuration and should work out of the box. However,
120
- you may wish to adjust settings to customize its behavior. Below are a few
121
- commonly used settings. Please see the
113
+ you may wish to adjust settings to customize its behavior. Please see the
122
114
[ settings documentation] ( docs/settings.md ) for a comprehensive list of settings.
123
115
See [ advanced topics] ( docs/advanced.md ) for further customizations and unique
124
116
use cases.
125
117
118
+ ## Troubleshooting
119
+
120
+ If the extension isn't working as you expect, you can take a look at our
121
+ troubleshooting guides. There is one for [ general
122
+ troubleshooting] ( docs/troubleshooting.md ) , and another specifically for
123
+ [ troubleshooting the debugging feature] ( docs/debugging.md#troubleshooting ) .
124
+
126
125
## Ask for help
127
126
128
- If you're having issues with this extension, please reach out to us by
129
- [ filing an issue] ( https://github.com/golang/vscode-go/issues/new/choose ) or
130
- asking a question on the [ Gophers Slack] . We hang out in the ` #vscode ` channel!
127
+ If the troubleshooting guides did not resolve the issue, please reach out to us
128
+ by [ filing an issue] ( https://github.com/golang/vscode-go/issues/new/choose ) ,
129
+ [ starting a GitHub discussion] ( https://github.com/golang/vscode-go/discussions ) ,
130
+ or by asking a question in the [ Gophers Slack] . We hang out in the ` #vscode `
131
+ channel!
131
132
132
- Take a look at [ learn.go.dev] ( https://learn.go.dev ) and
133
+ Also, you can take a look at [ learn.go.dev] ( https://learn.go.dev ) and
133
134
[ golang.org/help] ( https://golang.org/help ) for more general guidance on using
134
135
Go.
135
136
160
161
[ Gophers Slack ] : https://gophers.slack.com/
161
162
[ `gopls` ] : https://golang.org/s/gopls
162
163
[ `go` ] : https://golang.org/cmd/go
163
- [ Manage extensions in VS Code] : https://code.visualstudio.com/docs/editor/extension-gallery
164
+ [ Managing extensions in VS Code] : https://code.visualstudio.com/docs/editor/extension-gallery
164
165
[ VS Code Go extension ] : https://marketplace.visualstudio.com/items?itemName=golang.go
165
166
[ Go installation guide ] : https://golang.org/doc/install
166
- [ Go open source live video ] : https://opensourcelive.withgoogle.com/events/go/watch?talk=session3
167
+ [ this video from the Go Open Source Live conference ] : https://opensourcelive.withgoogle.com/events/go/watch?talk=session3
167
168
[ IntelliSense ] : docs/features.md#intellisense
168
169
[ code navigation ] : docs/features.md#code-navigation
169
170
[ code editing ] : docs/features.md#code-editing
172
173
[ debugging ] : #debugging
173
174
[ full feature breakdown ] : docs/features.md
174
175
[ workspace documentation ] : https://github.com/golang/tools/blob/master/gopls/doc/workspace.md
176
+ [ `Go: Install/Update Go Tools` command ] : docs/commands.md#go-installupdate-tools
177
+ [ documentation about supported workspace layouts ] : https://github.com/golang/tools/blob/master/gopls/doc/workspace.md
178
+ [ Workspace Folders ] : https://code.visualstudio.com/docs/editor/multi-root-workspaces
0 commit comments