Skip to content

Commit b55b129

Browse files
committed
[release] merge master@cc04c37 to get doc updates
cc04c37 .github/ISSUE_TEMPLATE: update bug report template f7bd66d docs: pull advanced documentation out of the main README b87c454 src/goMain: use vscode setting doc for importShortcut 0cd9eab README.md: format README to wrap to 80 characters 5e8b1e9 README: updates to README.md after a review Change-Id: Ib10318053c24d0c7ab3fed67a63679b1a7123646
2 parents cebe687 + cc04c37 commit b55b129

File tree

6 files changed

+224
-136
lines changed

6 files changed

+224
-136
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,26 @@ assignees: ''
77

88
---
99

10-
Please direct general questions to:
10+
For asking questions, see:
11+
- [GitHub Discussions (Q&A)](https://github.com/golang/vscode-go/discussions/categories/q-a)
1112
- [`#vscode` channel in Gophers Slack](https://invite.slack.golangbridge.org/messages/vscode)
1213

13-
Please review the [documentation](https://github.com/golang/vscode-go/tree/master/docs) before filing an issue.
14-
Helpful pages include:
15-
16-
- [GOPATH](https://github.com/golang/vscode-go/tree/master/docs/gopath.md)
17-
- [Module Support](https://github.com/golang/vscode-go/tree/master/docs/modules.md)
18-
- [Go Language Server](https://github.com/golang/vscode-go/blob/master/docs/gopls.md)
19-
- [Debugging](https://github.com/golang/vscode-go/tree/master/docs/debugging.md)
20-
- Set "trace": "log" and share the resulting logs in the debug console when logging an issue.
14+
Before filing an issue, please review our troubleshooting guides
15+
* [Troubleshooting problems with debugging](https://github.com/golang/vscode-go/blob/master/docs/debugging.md#troubleshooting)
16+
* [Troubleshooting other problems](https://github.com/golang/vscode-go/tree/master/docs/troubleshooting.md)
2117

2218
Please answer these questions before submitting your issue. Thanks!
2319

2420
### What version of Go, VS Code & VS Code Go extension are you using?
25-
- Run `go version` to get version of Go
21+
* Run `go version` to get version of Go from _the VS Code integrated terminal_.
2622
- <Paste go version here>
27-
- Run `gopls -v version` to get version of Gopls if you are using [the language server](https://github.com/golang/vscode-go/blob/master/docs/gopls.md).
23+
* Run `gopls -v version` to get version of Gopls from _the VS Code integrated terminal_.
2824
- <Paste gopls version here>
29-
- Run `code -v` or `code-insiders -v` to get version of VS Code or VS Code Insiders
25+
* Run `code -v` or `code-insiders -v` to get version of VS Code or VS Code Insiders.
3026
- <Paste VS Code version here>
31-
- Check your installed extensions to get the version of the VS Code Go extension
27+
* Check your installed extensions to get the version of the VS Code Go extension
3228
- <Paste Go extension version here>
33-
- Run `go env` to get the go development environment details
29+
* Run Ctrl+Shift+P (Cmd+Shift+P on Mac OS) > `Go: Locate Configured Go Tools` command.
3430
- <Paste the output here>
3531

3632
### Share the Go related settings you have added/edited

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ assignees: ''
77

88
---
99

10-
If you have a question, please ask it on the `#vscode` or `#vscode-go` channels in Gophers Slack](https://invite.slack.golangbridge.org/messages/vscode).
10+
If you have a feature request, please share your idea on the [GitHub Discussion](https://github.com/golang/vscode-go/discussions/categories/ideas), or on the [`#vscode` channel](https://invite.slack.golangbridge.org/messages/vscode) in Gophers Slack first.
1111

1212
**Is your feature request related to a problem? Please describe.**
1313
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

README.md

Lines changed: 118 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44

55
<!--TODO: We should add a badge for the build status or link to the build dashboard.-->
66

7-
[The VS Code Go extension](https://marketplace.visualstudio.com/items?itemName=golang.go) provides rich language support for the [Go programming language](https://golang.org/).
7+
[The VS Code Go extension](https://marketplace.visualstudio.com/items?itemName=golang.go)
8+
provides rich language support for the
9+
[Go programming language](https://golang.org/).
810

911
> 📣 Gopls, the official Go language server, is now enabled in VS Code by default.
1012
> Gopls replaces several legacy tools to provide IDE features while editing Go code.
@@ -13,119 +15,158 @@
1315
## Quick Start
1416

1517
Welcome! 👋🏻<br/>
16-
Whether you are new to Go or an experienced Go developer, we hope this extension fits your needs and enhances your development experience.
17-
18-
- **Step 1.** If you haven't done so already, install [Go](https://golang.org) and the [VS Code Go extension](https://marketplace.visualstudio.com/items?itemName=golang.go).
19-
- [Go installation guide](https://golang.org/doc/install). This extension works best with Go 1.14+.
20-
- [Manage extensions in VS Code](https://code.visualstudio.com/docs/editor/extension-gallery)
21-
- **Step 2.** To activate the extension, open any directory or workspace containing Go code. Once activated, the [Go status bar](docs/ui.md) will appear in the bottom left corner of the window and show the recognized Go version.
22-
- **Step 3.** The extension depends on [a set of extra command-line tools](#tools). If they are missing, the extension will show the "⚠️ Analysis Tools Missing" warning. Click the notification to complete the installation.
23-
24-
<p align="center"><img src="docs/images/installtools.gif" width=75%></img>
25-
<br/><em>(Install Missing Tools)</em>
18+
Whether you are new to Go or an experienced Go developer, we hope this
19+
extension fits your needs and enhances your development experience.
20+
21+
* **Step 1.** If you haven't done so already, install [Go](https://golang.org)
22+
and the [VS Code Go extension].
23+
* [Go installation guide]. This extension works best with Go 1.14+.
24+
* [Manage extensions in VS Code].
25+
* **Step 2.** To activate the extension, open any directory or workspace
26+
containing Go code. Once activated, the [Go status bar](docs/ui.md) will
27+
appear in the bottom left corner of the window and show the recognized Go
28+
version.
29+
* **Step 3.** The extension depends on [a set of extra command-line tools](#tools).
30+
If they are missing, the extension will show the "⚠️ Analysis Tools Missing"
31+
warning. Click the notification to complete the installation.
32+
33+
<p align="center">
34+
<img src="docs/images/installtools.gif" width=75%>
35+
<br/>
36+
<em>(Install Missing Tools)</em>
2637
</p>
2738

2839
You are ready to Go :-) &nbsp;&nbsp; 🎉🎉🎉
2940

30-
Please be sure to learn more about many [features](#features) of this extension as well as how to [customize](#customization) them. Take a look at [Troubleshooting](docs/troubleshooting.md) and [Help](#ask-for-help) for further guidance.
41+
Please be sure to learn more about many [features](#features) of this extension
42+
as well as how to [customize](#customization) them. Take a look at
43+
[Troubleshooting](docs/troubleshooting.md) and [Help](#ask-for-help) for further
44+
guidance.
3145

32-
If you are new to Go, [this article](https://golang.org/doc/code.html) provides the overview on go code organization and basic `go` commands. The recent [Go open source live video](https://opensourcelive.withgoogle.com/events/go/watch?talk=session3) featured VS Code Go and demonstrated how other Gophers use the features to enhance their Go development workflow.
46+
If you are new to Go, [this article](https://golang.org/doc/code.html) provides
47+
the overview on go code organization and basic `go` commands. The recent
48+
[Go open source live video] featured VS Code Go and demonstrated how other
49+
Gophers use the features to enhance their Go development workflow.
3350

3451
## Features
3552

36-
This extension provides many features, including [IntelliSense](docs/features.md#intellisense), [code navigation](docs/features.md#code-navigation), and [code editing](docs/features.md#code-editing) support. It also shows [diagnostics](docs/features.md#diagnostics) as you work and provides enhanced support for [testing](docs/features.md##run-and-test-in-the-editor) and [debugging](#debugging) your programs. See the [full feature breakdown](docs/features.md) for more details and to learn how to tune the behavior.
53+
This extension provides many features, including [IntelliSense],
54+
[code navigation], [code editing] support. It also shows [diagnostics] as you
55+
work and provides enhanced support for [testing] and [debugging] your programs.
56+
See the [full feature breakdown] for more details and to learn how to tune the
57+
behavior.
3758

38-
<p align=center><img src="docs/images/completion-signature-help.gif" width=75%></img>
39-
<br/><em>(Code completion and Signature Help)</em>
59+
<p align=center>
60+
<img src="docs/images/completion-signature-help.gif" width=75%>
61+
<br/>
62+
<em>(Code completion and Signature Help)</em>
4063
</p>
4164

42-
In addition to integrated editing features, the extension provides several commands for working with Go files. You can access any of these by opening the Command Palette (`Ctrl+Shift+P` on Linux/Windows and `Cmd+Shift+P` on Mac), and then typing in the command name. See the [full list of commands](docs/commands.md#detailed-list) provided by the extension.
65+
In addition to integrated editing features, the extension provides several
66+
commands for working with Go files. You can access any of these by opening the
67+
Command Palette (`Ctrl+Shift+P` on Linux/Windows and `Cmd+Shift+P` on Mac), and
68+
then typing in the command name. See the
69+
[full list of commands](docs/commands.md#detailed-list) provided by the
70+
extension.
4371

44-
<p align=center><img src="docs/images/toggletestfile.gif" width=75%></img>
72+
<p align=center>
73+
<img src="docs/images/toggletestfile.gif" width=75%>
4574
<br/><em>(Toggle Test File)</em></p>
4675

47-
**⚠️ Note**: the default syntax highlighting for Go files is provided by the [TextMate rule](https://github.com/jeff-hykin/better-go-syntax) embedded in VS Code, not by this extension.
76+
**⚠️ Note**: the default syntax highlighting for Go files is provided by the
77+
[TextMate rule](https://github.com/jeff-hykin/better-go-syntax) embedded in VS
78+
Code, not by this extension.
4879

4980
## Tools
5081

51-
The extension uses a few command-line tools developed by the Go community. In particular, `go`, `gopls`, and `dlv` are the main tools that implement build/test, language features, and debugging functionalities of this extension. See [Tools](docs/tools.md) for the full list of tools the extension depends on.
52-
53-
In order to locate the command-line tools, the extension searches `$GOPATH/bin` and directories specified in the `PATH` environment variable (or `Path` in Windows) with which the VS Code process has started. If the tools are not found, the extension will prompt you to install the missing tools and show the "⚠️ Analysis Tools Missing" warning in the bottom right corner. Please install them by responding to the warning notification, or by manually running the `Go: Install/Update Go Tools` command. The extension will run the [`go get`](https://golang.org/cmd/go) command to install them.
82+
The extension uses a few command-line tools developed by the Go community. In
83+
particular, `go`, `gopls`, and `dlv` are used to implement build/test, language
84+
features, and debugging functionalities of this extension. See the
85+
[tools documentation](docs/tools.md) for a complete list of tools the extension
86+
depends on.
87+
88+
In order to locate the command-line tools, the extension searches `$GOPATH/bin`
89+
and directories specified in the `PATH` environment variable (or `Path` in
90+
Windows) with which the VS Code process has started. If the tools are not found,
91+
the extension will prompt you to install the missing tools and show the "⚠️
92+
Analysis Tools Missing" warning in the bottom right corner. Please install them
93+
by responding to the warning notification, or by manually running the `Go:
94+
Install/Update Go Tools` command. The extension will run the
95+
[`go get`](https://golang.org/cmd/go) command to install them.
5496

5597
## Setting up your workspace
5698

57-
[Modules](https://golang.org/ref/mod) are how Go manages the versions and dependencies in the recent versions of Go. Modules replace the old `GOPATH`-based approach to specifying which source files are used in a given build, and they are the default build mode after go1.16. While this extension continues to support both Go modules and `GOPATH`-mode, we highly recommend Go development in module mode. If you are working on existing projects, please consider migrating to modules.
58-
59-
Unlike the traditional `GOPATH`-mode, module mode does not require the workspace to be under `GOPATH` nor to use a specific structure. A module is defined by a tree of Go source files with a `go.mod` file in the tree's root directory. Your project may involve one or more modules. If you are working with multiple modules or uncommon project layouts, you will need to specifically configure your workspace, so features like references can work across modules. Please see the [Workspace document](https://github.com/golang/tools/blob/master/gopls/doc/workspace.md) for information on supported workspace layouts.
99+
[Go modules](https://golang.org/ref/mod) are how Go manages dependencies in
100+
recent versions of Go. Modules replace the `GOPATH`-based approach to specifying
101+
which source files are used in a given build, and they are the default build
102+
mode in go1.16+. While this extension continues to support both Go modules and
103+
`GOPATH` mode, we highly recommend Go development in module mode. If you are
104+
working on existing projects, please consider migrating to modules.
105+
106+
Unlike the traditional `GOPATH` mode, module mode does not require the workspace
107+
to be located under `GOPATH` nor to use a specific structure. A module is
108+
defined by a directory tree of Go source files with a `go.mod` file in the
109+
tree's root directory. Your project may involve one or more modules. If you are
110+
working with multiple modules or uncommon project layouts, you will need to
111+
configure your workspace so that the extension knows which code to load, so that
112+
features like references can work across modules. Please see the
113+
for information on supported workspace layouts.
60114

61115
## Customization
62116

63-
The extension needs no configuration and should work out of the box. However, you may wish to modify settings to meet your needs. Please see the [Settings documentation](docs/settings.md) for the comprehensive list of extension configuration options.
64-
65-
### Choosing a different version of Go
66-
67-
The extension chooses the `go` command from the `$PATH` (or `$Path`) environment variable by default. You can configure this extension to choose a different version of Go with one of the following options.
68-
69-
- (Preferred) Adjust your `$PATH` or `$Path` environment variable, and *open VS Code with the adjusted environment* variable, or
70-
- Use the Go extension's `"Go: Choose Go Environment"` command that opens a [menu](docs/ui.md) to change the `go` version, or
71-
- Use the `"go.alternateTools"` settings and specify the absolute path to the `go` command.
72-
```
73-
"go.alternateTools": { "go": "/path/to/go/command" }
74-
```
75-
76-
**note**: For historical reasons, some users use the `"go.goroot"` settings or the `GOROOT` environment variable to select the Go SDK location. With the recent versions of Go, that's unnecessary in most cases.
77-
78-
### Configuring the installation of command-line tools
79-
80-
`Go: Install/Update Tools` command uses the `go get` command to download and install requested tools. By default, `go get` will install the compiled tools in one of the following directories.
81-
- the directory the `$GOBIN` environment variable specifies, or
82-
- the `bin` directory under the first `$GOPATH` (or `"go.gopath"`) directory, or
83-
- the `$HOME/go/bin` (or `$USERPROFILE/go/bin`) directory.
84-
85-
Some users prefer to choose a different installation location. In that case, use the `"go.toolsGopath"` setting.
86-
87-
The extension finds the required tools by their names (`go`, `gopls`, `dlv`, ...). Sometimes, users may need to wrap the tools or want the extension to pick an alternate tool. `"go.alternateTools"` provides a way to configure the extension to use different tools.
88-
89-
### Using a custom linter
90-
91-
A commonly customized feature is the linter, which is a tool used to provide coding style feedback and suggestions.
92-
This extension supports linters such as `staticcheck`, `golangci-lint`, and `revive`. You can choose one of them using the `"go.lintTool"` setting. For customization of the linter, please consult the tools' documentation.
93-
94-
If you are using `staticcheck`, you can enable it via the `gopls` settings block by setting
95-
```
96-
"gopls": {
97-
"ui.diagnostic.staticcheck": true
98-
}
99-
```
100-
101-
<!-- TODO: maybe have tips.md or settings.md to discuss more customization and setting tips (e.g. activating signature help after completion, disabling snippets to reduce the interference with gopls' suggestions, setting proxies, etc.) -->
102-
103-
### Working on the Go standard library and the Go tools
104-
105-
When you need to work on the Go project (https://go.googlesource.com/go), please follow the instruction in the [Standard Library Development](docs/stdlib.md) to adjust your settings.
117+
The extension needs no configuration and should work out of the box. However,
118+
you may wish to adjust settings to customize its behavior. Below are a few
119+
commonly used settings. Please see the
120+
[settings documentation](docs/settings.md) for a comprehensive list of settings.
121+
See [advanced topics](docs/advanced.md) for further customizations and unique
122+
use cases.
106123

107124
## Ask for help
108125

109-
If you're having issues with this extension, please reach out to us by [filing an issue](https://github.com/golang/vscode-go/issues/new/choose) or asking a question on the [Gophers Slack]. We hang out in the `#vscode` channel!
126+
If you're having issues with this extension, please reach out to us by
127+
[filing an issue](https://github.com/golang/vscode-go/issues/new/choose) or
128+
asking a question on the [Gophers Slack]. We hang out in the `#vscode` channel!
110129

111-
Take a look at [learn.go.dev](https://learn.go.dev) and [golang.org/help](https://golang.org/help) for additional guidance.
130+
Take a look at [learn.go.dev](https://learn.go.dev) and
131+
[golang.org/help](https://golang.org/help) for more general guidance on using
132+
Go.
112133

113-
## [Preview version](docs/nightly.md)
134+
## Preview version
114135

115-
If you'd like to get early access to new features and bug fixes, you can use the nightly build of this extension. Learn how to install it in by reading the [Go Nightly documentation](docs/nightly.md).
136+
If you'd like to get early access to new features and bug fixes, you can use the
137+
nightly build of this extension. Learn how to install it in by reading the
138+
[Go Nightly documentation](docs/nightly.md).
116139

117-
## [Contributing](docs/contributing.md)
140+
## Contributing
118141

119-
We welcome your contributions and thank you for working to improve the Go development experience in VS Code. If you would like to help work on the VS Code Go extension, please see our [contribution guide](docs/contributing.md). It explains how to build and run the extension locally, and it describes the process of sending a contribution.
142+
We welcome your contributions and thank you for working to improve the Go
143+
development experience in VS Code. If you would like to help work on the VS Code
144+
Go extension, please see our [contribution guide](docs/contributing.md). It
145+
explains how to build and run the extension locally, and describes the process
146+
of sending a contribution.
120147

121-
## [Code of Conduct](CODE_OF_CONDUCT.md)
148+
## Code of Conduct
122149

123-
This project follows the [Go Community Code of Conduct](https://golang.org/conduct). If you encounter an issue, please mail [email protected].
150+
This project follows the
151+
[Go Community Code of Conduct](https://golang.org/conduct). If you encounter a
152+
conduct-related issue, please mail [email protected].
124153

125-
## [License](LICENSE)
154+
## License
126155

127156
[MIT](LICENSE)
128157

129158
[Gophers Slack]: https://gophers.slack.com/
130159
[`gopls`]: https://golang.org/s/gopls
131160
[`go`]: https://golang.org/cmd/go
161+
[Manage extensions in VS Code]: https://code.visualstudio.com/docs/editor/extension-gallery
162+
[VS Code Go extension]: https://marketplace.visualstudio.com/items?itemName=golang.go
163+
[Go installation guide]: https://golang.org/doc/install
164+
[Go open source live video]: https://opensourcelive.withgoogle.com/events/go/watch?talk=session3
165+
[IntelliSense]: docs/features.md#intellisense
166+
[code navigation]: docs/features.md#code-navigation
167+
[code editing]: docs/features.md#code-editing
168+
[diagnostics]: docs/features.md#diagnostics
169+
[testing]: docs/features.md##run-and-test-in-the-editor
170+
[debugging]: #debugging
171+
[full feature breakdown]: docs/features.md
172+
[workspace documentation]: https://github.com/golang/tools/blob/master/gopls/doc/workspace.md

0 commit comments

Comments
 (0)