[release] prepare v0.18.0 release @9e91b75

9e91b75 test: extract helper function for checking variable value
59e1356 src/goMain: try both gc_details and gopls_gc_details
26d2a33 src/debugAdapter: indicate that conditional breakpoints are supported
8fc4183 src/goLanguageServer: enable survey for the go extension users
6703469 src/debugAdapter: revert cl/253578
d2fbb62 debugAdapter: Fix bugs that cause remote debug to hang
c17c69f src/goModules: exclude vendor paths from inferGopath disable mechanism
0cdccf1 test: increase timeout for debug adapter tests
6a2a004 test: fix breakpoint tests on windows
7d5f58a test: add go directive to fixtures
9e6fac4 src/goInstallTools: prompt again after showing 'release notes'
d57f263 test: adjust tests involving 'check*' when language server is on
560405b src/goInstallTools.ts: handle stderr of go env
8f08cfd src/goEnvironmentStatus.ts: allow to choose go from file browser
263c427 test: test the debug adapter on test launch configurations
51a4b3a test: disconnect from the debug adapter after each test
5b25666 package.json: upgrade vscode-languageclient to use 7.0.0-next.9
a587fea src/goMain.ts: call gc_details command through vscode API
0aea0bf CHANGELOG.md: cherry-pick v0.17.1/v0.17.2 CHANGELOG changes
acf2483 src/util.ts: handle diagnostics errors for all visible files
0c3ec39 docs: improve documentation for debugging CLI applications
7e58c56 snippets: add a placeholder for the for loop index
cfa00f0 test: add debug adapter tests
ec96bd7 src/goStatus.ts: refactor status bar code into goStatus.ts
b2692c9 src/debugAdapter: send terminated event when program exits
70f7a71 src/goLanguageServer.ts: enable language server by default in nightly
39c9a2e build/all.bash: install dependencies without -v
473c0fc vs-code tasks: missed comma in the snippet
89f5d4e goLanguageServer: send the gopls config as initialization options
b6aeab4 goModules: set "go.useLanguageServer" to true if the user installs it
1b82f49 src/goEnvironmentStatus.ts: clear pre-installed terminal PATH mutation
9bf9d64 src/goInstallTools.ts: add GOROOT/bin to PATH when it wasn't found from PATH
50240bf LICENSE: restore LICENSE
dbb38c5 goLanguageServer: correctly reflect modifications to the survey config
690469c src/goStatus.ts: consolidate Go status bar items
9ab1e77 src/goMain.ts: call listeners for active text editor on init
a2c7402 goLanguageServer: add command to toggle gc_details
ab4b257 src/goInstallTools.ts: mutate PATH only when necessary
e0ce53b docs/debugging.md: document lack of symlink support
c65170a docs/stdlib.md: clarify the change in the go.alternateTools section
8e9cae7 src/goInstallTools.ts: return a rejected promise when go isn't found
18cfe6e src/debugAdapter: add 'panic' and 'fatal error' as stopped reasons
f9daaad src/goLogging.ts: add go.logging.level and log PATH mutation
9ebcc1f src/goLanguageServer.ts: include sanitized trace to issue report
9d97bb5 src/debugAdapter: delete unused launch.json
8d0bafa package.json: default 'go.coverMode' to be 'default'
ed434b2 Merge "[latest] v0.17.0"
e2dedc0 [latest] v0.17.0
5c4b766 src/debugAdapter: remove null items in variables response for maps
29cee47 debugAdapter: fix a bug where we are not sending back configuration done response
5879a3e test/gopls: fix completion middleware test
59858d7 src/goDebugConfiguration.ts: add resolveDebugConfiguration back
9a2bc10 src/debugAdapter: send stopped events from continue on breakpoint only
d34fee8 docs/debugging.md: update remote debugging documentation
a5e0287 build/all.bash: build vscode-test-env from the root
c929a2b [latest] v0.16.2
2fe721b [latest] v0.16.1
586c956 [latest] v0.15.2
dc45442 [latest] v0.15.1 release
eab00f7 [latest] v0.15.0 release

Change-Id: If2f9a073a8a86754044e85671d5527b04d7c7ae4
tree: a4e907177ee311b049e90ebbcb7d29f51e896638
  1. .github/
  2. .vscode/
  3. build/
  4. docs/
  5. images/
  6. languages/
  7. snippets/
  8. src/
  9. syntaxes/
  10. test/
  11. third_party/
  12. tools/
  13. typings/
  14. .editorconfig
  15. .gitignore
  16. .prettierrc.json
  17. .vscodeignore
  18. CHANGELOG.md
  19. CODE_OF_CONDUCT.md
  20. LICENSE
  21. package-lock.json
  22. package.json
  23. README.md
  24. SECURITY.md
  25. tsconfig.json
  26. tslint.json
  27. webpack.config.js
README.md

Go for Visual Studio Code

Slack

This extension provides rich language support for the Go programming language in VS Code.

Take a look at the Changelog to learn about new features.

This is the new home for the VS Code Go extension. We just migrated from Microsoft/vscode-go. Learn more about our move on the Go blog.

Overview

Getting started

Welcome! Whether you are new to Go or an experienced Go developer, we hope this extension will fit your needs and enhance your development experience.

Install Go

Before you start coding, make sure that you have already installed Go, as explained in the Go installation guide.

If you are unsure whether you have installed Go, open the Command Palette in VS Code (Ctrl+Shift+P) and run the Go: Locate Configured Go Tools command. If the GOROOT output is empty, you are missing a Go installation. For help installing Go, ask a question on the #newbies Gophers Slack channel.

Set up your environment

Read about Go code organization to learn how to configure your environment. This extension works in both GOPATH and module modes. We suggest using modules, as they are quickly becoming the new standard in the Go community.

Here are some additional resources for learning about how to set up your Go project:

NOTE: If you are using modules, we recommend using the Go language server, which is explained below.

More advanced users may be interested in using different GOPATHs or Go versions per-project. You can learn about the different GOPATH manipulation options in the GOPATH documentation. Take a look at the other customization options as well.

Install the extension

If you haven't already done so, install and open Visual Studio Code. Navigate to the Extensions pane (Ctrl+Shift+X). Search for “Go” and install this extension (the publisher ID is golang.Go).

Activate the Go extension

To activate the extension, open any directory or workspace containing Go code.

You should immediately see a prompt in the bottom-right corner of your screen titled Analysis Tools Missing. This extension relies on a suite of command-line tools, which must be installed separately. Accept the prompt, or use the Go: Install/Update Tools command to pick which tools you would like to install.

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.

Start coding

You're ready to Go!

Be sure to learn more about the many features of this extension, as well as how to customize them. Take a look at Troubleshooting and Help for further guidance.

Support for Go modules

Go modules have added a lot of complexity to the way that most tools and features are built for Go. Some, but not all, features of this extension have been updated to work with Go modules. Some features may also be slower in module mode. The features documentation contains more specific details.

In general, we recommend using gopls, the official Go language server, if you are using modules. Read more below and in the gopls documentation.

Features

This extension has a wide range of features, including Intellisense, code navigation, and code editing support. It also shows build, vet, and lint diagnostics as you work and provides enhanced support for testing and debugging your programs. For more detail, see the full feature breakdown.

In addition to integrated editing features, the extension also provides several commands for working with Go files. You can access any of these by opening the Command Palette (Ctrl+Shift+P) and typing in the name of the command. See the full list of commands provided by the extension.

The majority of the extension‘s functionality comes from command-line tools. If you’re experiencing an issue with a specific feature, you may want to investigate the underlying tool. You can do this by taking a look at the full list of tools used by this extension.

Debugging

Debugging is a major feature offered by this extension. For a comprehensive overview of how to debug your Go programs, please see the debugging guide.

Customization

This extension needs no configuration; it works out of the box. However, you may wish to modify settings to adjust your experience.

Many of the features are configurable to your preference. A few common modifications are mentioned below, but take a look at the full list of settings for an overview.

Linter

A commonly customized feature is the linter, which is a tool used to provide coding style feedback and suggestions. By default, this extension uses the official golint.

However, you are welcome to use more advanced options like staticcheck, golangci-lint, or revive. This can be configured via the "go.lintTool" setting, and the different options are explained more thoroughly in the list of diagnostic tools.

GOPATH

Advanced users may want to set different GOPATHs for different projects or install the Go tools to a different GOPATH. This is possible and explained in the GOPATH documentation.

Language Server

In the default mode, the Go extension relies upon a suite of command-line tools. A new alternative is to use a single language server, which provides language features through the Language Server Protocol.

The Go team at Google has developed gopls, which is the official Go language server. It is currently in an alpha state and under active development.

gopls is recommended for projects that use Go modules.

To opt-in to the language server, set "go.useLanguageServer" to true in your settings. You should then be prompted to install gopls. If you are not prompted, you can install gopls manually by running the Go: Install/Update Tools command and selecting gopls.

For more information, see the gopls documentation.

Ask for help

If you're having issues with this extension, please reach out to us by filing an issue or asking a question on the Gophers Slack. We hang out in the #vscode channel!

Take a look at learn.go.dev and golang.org/help for additional guidance.

Preview version

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.

Contributing

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. It explains how to build and run the extension locally, and it describes the process of sending a contribution.

Code of Conduct

This project follows the Go Community Code of Conduct. If you encounter an issue, please mail conduct@golang.org.

License

MIT