📣 Delve's native DAP implementation (dlv-dap
) is enabled by default for local debugging. We updated the Documentation for Debugging to show the new features available with dlv-dap. This change does not apply to remote debugging yet. For remote debugging, keep following the instruction in the legacy debug adapter documentation.
A list of all issues and changes can be found in the v0.27.1 milestone and commit history.
replay
and core
debug launch modes. (PR 1268)CGO_CFLAGS
is set. (Issue 1678)dlv-dap
installation issue. (Issue 1682)Thanks for your contributions, Luis Gabriel Gomez, Suzy Mueller, and Hana Kim!
📣 Delve's native DAP implementation (dlv-dap
) is enabled by default for local debugging. We updated the Documentation for Debugging to show the new features available with dlv-dap. This change does not apply to remote debugging yet. For remote debugging, keep following the instruction in the legacy debug adapter documentation.
A list of all issues and changes can be found in the v0.27.0 milestone and commit history.
go.terminal.activateEnvironment
allows to prevent the extension from changing integrated terminal's environment variables. (Issue 1558, 1098) Go: Locate Configured Go Tools
command prints the build information of detected tools. dlv-dap
as the default debug adapter for local debugging. The new debug adapter offers many new features and improvements.Go: Subtest At Cursor
command prompts for subtest name if there is no subtest at cursor (Issue 1602). logOutput
property without showLog: true
does not break debugging any more. cwd
is not set. (Issue 1608) dlv-dap
mode ignore the port
property. It was initially suggested as a temporary alternative to the remote debugging, but we decided to revisit the functionality for better remote debugging support. Use the debugServer
property if you want to connect to a manually launched dlv dap
server.dlv-dap
is pinned to v1.7.1-0.20210804080032-f95340ae1bf9 and dlv-dap
is marked as a required tool.tools/relnotes
, a script to help generate CHANGELOG.md. Thank you for your contribution, Ahmed W, Hana, Michael Currin, Polina Sokolova, Rebecca Stambler, Suzy Mueller, and Sven Efftinge!
📣 Delve
's native DAP implementation is now available for use. In order to use this new debug adapter (dlv-dap
) when debugging Go programs, add the following settings in your settings.json
:
"go.delveConfig": { "debugAdapter": "dlv-dap", },
Please learn more about the new adapter's features and configuration parameters, and share your feedback and report the issues in our issue tracker.
A list of all issues and changes can be found in the v0.26.0 milestone and commit history.
dlv-dap
is ready for use in local debugging."Go: Test Function At Cursor or Test Previous"
command. (PR 1509)"Go: Add Imports"
command uses gopls
instead of gopkg
. This requires gopls@v0.7.0
or newer. (Go Issue 43351)"Go: Lint Workspace"
that failed no editor is active. (Issue 1520)gopls
crash caused by Untitled files. (Issue 1559)Thanks for your contributions, @mislav, @marwan-at-work, @findleyr, @lggomez, @fflewddur, @suzmue, @hyangah!
A list of all issues and changes can be found in the v0.25.1 milestone.
/
when applying substitutePath
debug configuration. (Issue 1497)go.goroot
setting is used. (Issue 1501)dlv-dap
. Some of newest additions to dlv dap
include optimized function detection, exception info, pause, function breakpoints while running, evaluate over hover, set variables. Documentation of current features and limitations can be found in the documentation.Thanks for the contribution, @suzmue, @fflewddur!
A list of all issues and changes can be found in the v0.25.0 milestone.
If you have a feature requests for this extension, please file it through the github issue tracker.
dlv-dap
. Documentation of current features and limitations can be found in the documentationGo: Initialize go.mod
command to run go mod init
in the current workspace folder (Issue 1449)program
in debug configuration to determine mode in auto
(Issue 1422)dlv-dap
if autoUpdates enabled (Issue 1404)editor.suggest.snippetsPreventQuickSuggestions
to false by default to enable code completion and quick suggestions inside a snippet (Issue 839)GOROOT
to the user specified GOROOT
in go.goroot
dlv-dap
to shut down gracefully and clean up debugged process (Issue 120)Thank you for your contribution, @hyangah, @JadenSimon, @rstambler, @polinasok, @rfindley, and @suzmue!
A list of all issues and changes can be found in the v0.24.2 milestone.
lintOnSave
feature. (Issue 1429)dlv-dap
installation to correcly use GOBIN
environment variable. (Issue 1430)dlv-dap
. (Issue 1426)substitutePath
and shadowed variable annotation.dlv-dap
by default for all launch configurations (including codelenses), set the debugAdapter
field in the go.delveConfig
setting (Issue 1293)dlv-dap
is now available here🧪 We re-enabled the option to use dlv dap
(Delve‘s native DAP implementation) instead of the old debug adapter when debugging go code. See the documentation to learn more about Delve’s native DAP implementation, and how to choose dlv dap
.
Full list of issues and changes can be found in the v0.24.0 milestone and the changes since v0.23.3.
dlv dap
for debugging.staticcheck
if it is enabled in gopls
. (CL 301053)go list
to check availability of newly released gopls. (CL 295418)go env -json
to query go env variables. (CL 301730)go.overwriteGoplsMiddleware
setting.Thanks for the contributions, @hoanggc, @suzmue, @rstambler, @polinasok!
🎉 We use staticcheck
as the default lint tool. We also changed to use goimports
for formatting when not using gopls
.
This version requires VS Code 1.52 or newer.
A list of all issues and changes can be found in the v0.23.1 milestone and the changes since v0.22.1
dlv-dap
start logic (Issue 1270) and improved output/error message forwarding. (CL 296930)goreturns
. (CL 300430)gopls
. (Issue 1153)gopls
commands fail. (Issue 1237)gopls
v0.6.7+ (Issue 1224)Delve DAP is a new debug adapter embedded in dlv
, the Go debugger. It is written in Go, understands Go's data types and runtime better, and is under active development. In this release, we added back access to Delve DAP. Delve DAP is still in the experimental stage and we appreciate any feedback and bug reports!
A list of all issues and changes can be found in the v0.23.0 milestone and the changes since v0.22.1
processId
to the command name of the process, ${command:pickProcess}
, or ${command:pickGoProcess}
a quick pick menu will show a list of processes to choose from."debugAdapter": "dlv-dap"
is specified in launch.json configurations, the extension will use Delve DAP for the debug session. When using Delve DAP, install the dev version of dlv
built from master (cd; GO111MODULE=on go get github.com/go-delve/delve/cmd/dlv@master
) to pick up the latest bug fixes and feature improvement. (Issue 23, 822, 844)gopls
auto-update. (Issue 1095)Go: Reset Global State
and Go: Reset Workspace State
commands are available for easier extension state reset.gopls
."go.disableConcurrentTests"
) that prevents concurrent go test
invocation. (Issue 1089)C:\Program Files\Go\bin
, C:\Program Files (x86)\Go\bin\go.exe
, the new default Go installation path in Windows.gts
to enforce consistent coding style. (Issue 1227)latest
branch.Thanks for your contributions, @Charliekenney23, @eneuschild, @suzmue, @stamblerre, @pjweinbgo, @polinasok!
"go.languageServerExperimentalFeatures"
setting deprecation error messages. (CL 288133)dlv
to the "go.alternateTools"
example value list. (CL 289231)ini
to 1.3.8 to address a vulnerability report from npm audit
.Thank you for your contribution, @stamblerre, @hyangah, @patrasap0908!
gopls
, is enabled by default. (Issue 1037)Thank you for your contribution, @suzmue, @stamblerre, @findleyr, @heschik, @hyangah!
A list of all issues and changes can be found in the v0.21.1 milestone.
Cannot get property 'get' of undefined
error. (Issue 1104)"go.languageServerExperimentalFeatures"
setting for users who depend on this to run custom vet analyzers. (Issue 1110)A list of all issues and changes can be found in the v0.21.0 milestone.
dlvFlags
debug attribute is available for conveniently supply extra flags to dlv
. (Issue 978)gotype-live
automatically when the language server is enabled. (Issue 1021)"go.languageServerExperimentalFeatures"
setting. (CL 280601). The documentLink
feature is replaced with gopls
's ui.navigation.importShortcut
setting. The diagnostics
feature replacement is still under discussion. Please provide feedback in Issue 50.Thank you for your contribution, @hyangah, @suzmue, @pjweinbgo, @stamblerre!
"gopls"
settings to match gopls v0.6.2. (CL 279728)go
installation path when go
couldn't be found from the regular PATH (Issue 1065)A list of all issues and changes can be found in the v0.20.0 milestone.
substitutePath
config property allows users to translate their symlinked directories to the actual paths, and the local paths to the remote paths. See Launch Configurations and Remote Debugging for details.launch.json
was added. (Issue 131)next
is automatically cancelled by delve if interrupted, for example, because breakpoint is set. See Issue 787 for details. (CL 261078)tyf
snippet for type name func()
was added. (Issue 1002)gopls
settings section definition based on gopls
v0.6.0. (Issue 197, CL 278355)go.buildFlags
and go.buildTags
are propagated to gopls
unless "gopls": {"buildFlags": ..}
is set. (Issue 155)go.toolsManagement.checkForUpdates
setting allows users to completely disable version checks. This deprecates go.useGoProxyToCheckForToolUpdates
. (Issue 963)PATH
setup issue. When go
isn't found from PATH
, the extension will check /usr/local/bin
too (Issue 971).gopls
if the existing version in the system is older than the minimum required version when the extension enables gopls
automatically. (Issue 938)GOBIN
setting. (CL 275877)go.overwriteGoplsMiddleware
and marked deprecated settings.vsce package
to detect packaging errors early.Thank you for your contribution, @hyangah, @suzmue, and @programmer04!
A list of all issues and changes can be found in the v0.19.1 milestone.
Run without Debugging
for Windows. This was a regression found in v0.19.0 (Issue 918). godlvdap
debug configuration from the stable version. It is still available in Go Nightly (Issue 960).Thank you for your contribution, @suzmue, @RomanKornev, @hyangah!
A list of all issues and changes can be found in the v0.19.0 milestone.
lispcase
, pascalcase
and keep
as transform variants for go.addTags (Issue 906, 936) gomodifytags
's --template flag (Issue 826) Thank you for your contribution, @pofl, @hyangah, @perrito666, @pjweinbgo, @quoctruong, @stamblerre, @skaldesh, and @suzmue!
A list of all issues and changes can be found in the v0.18.1 milestone.
Go: extract language server logs to editor
command was added (CL 263526).Thank you for your contributions, @suzmue, @pjweinbgo!
Unified Go status UI ⚡, many debugger feature improvements, and LSP 3.16 features! A list of all issues fixed with this release can be found in the v0.18.0 milestone.
go.mod
file, and more. The old Go Modules
status bar was removed in favor of this new unified status bar. See VS Code Go UI documentation to learn more about this.Go: Toggle gc details
command toggles the display of compiler optimization choice for the open Go source file (CL 256658).3.16
. Users of recent gopls
can access new features such as Call hierarchy
and Semantic tokens
.gopls
config as LSP initialization options for correct workspace symbols computation (CL 259138).for
statement snippet (Issue 734).vendor
directories from go.inferGopath
disable mechanism (Issue 301).go.logging.level
setting allows extra logging to help debugging extension issues (CL 256557).Go: Show Survey Config
and Go: Reset Survey Config
commands are available.gopls
. (CL 258997).go
command chosen from the current GOROOT/bin
. This helps avoid using a different version of go
command for asdf
or direnv
users (Issue 757).Thank you for your contributions, @suzmue, @vologab, @amitlevy21, @danielhelfand, @egonk, @quoctruong, @polinasok, @pjweinbgo, @stamblerre, @hyangah!
go
is not found from PATH
available to the extension, the extension tries a couple of well-known default locations to find the go
binary. In this case, we need to mutate PATH
so other tools including gopls
or dlv
can choose the same go version. (Issue 713).PATH
/Path
environment variable only if users explicitly configure to select the go command using go.goroot
, go.alternateTools
, or Go: Choose Go Environment
menu. (Issue 679)go.coverMode
to be default
. (Issue 666)Thank you for reporting issues!
Go code debugging and code coverage support is getting better.
The extension will help you stay updated with the new Go releases.
call
command. E.g. call myAwesomeFunc()
. It is an experimental feature in Delve. Please see the current limitations. (Issue 100)Go Update Available
status bar item will appear. This feature is available only if go.useGoProxyToCheckForToolUpdates
is set true. (Issue 483)go.coverMode
setting allows to use different coverage modes (atomic
, count
, set (default)
). go.coverShowCounts
, go.coverageDecorator.{coveredBorderColor, uncoveredBorderColor}
were newly added. We are still investigating better ways to visualize the count
coverage data; feedback and contribution is welcome! (Issue 256, 594)'~'
in the cwd
attribute of the launch configuration. (Issue 116)showGlobalVariables
is disabled by default, and this change improves speed. You can still inspect the global variables by registering them in the WATCH
section, or by configuring showGlobalVariables
in launch.json
. (Issue 138)gofumpt
, gofumports
is added to recognized formatters list. (Issue 587)go.toolsEnvVars
configuration is changed. (CL 254370)go env
failures. (Issue 555)GOROOT
when invoking the gopkgs
tool so gopkgs
continues to work with different go versions without being recompiled. (CL 254137)Go: Locate Configured Go Tools
are invoked. (Issue 457)GOROOT/bin
to integrated terminal's PATH environment variable when go.goroot
is set on OS X. (Issue 544)envFile
in the launch configuration. We reworked how the environment variables configuration is processed during this cycle. Now the extension processes the envFile
attribute instead of asking the debug adapter process to read the specified envFile
. (Issue 452)go.installDependenciesWhenBuilding
by default. When this is enabled, the extension runs go
commands with -i
, which is no longer recommended with recent versions of Go. (Issue 568)run test
CodeLenses to gopls
. This experimental feature can be enabled with the following setting:"go.useLanguageServer": true, "gopls": { "codelens": { "test": true } }
Thank you for your contribution, @suzmue, @pjweinbgo, @ekulabuhov, @stamblerre, @tpbg, @FiloSottile, @findleyr, @quoctruong, @polinasok, @hyangah!
"go.alternateTools"
settings to accept any tool names without settings.json diagnostics warning. (Issue 526)go.goroot
and go.toolsEnvVars
(Issue 464, 413).This version requires VS Code 1.46+.
Older versions of VS Code will not receive updates any more.
Go: Choose Go Environment
command. When clicking the Go
status bar that displays the currently active Go version, users will be prompted with the list of Go versions installed locally or available for download. This feature was built based on the golang.org/dl
tools. The selected Go version applies to the workspace, takes precedence over the system default or the "go.goroot"
and "go.alternateTools"
settings, and persists across sessions. You can clear the choice by selecting the Clear Selection
item. (Issue 253)$GOROOT/bin
to the PATH
or Path
environment variable which then applies the change to the integrated terminal windows.launch
type requests in debug
or test
mode. This is still in the early stages and requires dlv
built from its unreleased, master branch. Subscribe to golang/vscode-go#23 for updates.Go: Apply Cover Profile
applies code coverage for multiple packages (CL 238697). We fixed bugs in processing coverage profiles on Windows.go
tool is found.GOMODCACHE
environment variable, introduced in Go 1.15.-v
option. This feature requires 1.14 or newer versions of Go (Issue 316).additionalProperties
to false
for the settings that don't expect more properties. This allows VS Code to handle these settings better in its new settings GUI (Issue 284).Go: Locate Configured Go Tools
includes go env
results (Issue 195).PATH
environment variable adjustment when users use a wrapper as an alternate tool for go
(CL 239697).gocode-gomod
installation bug when GOPATH
includes multiple directories (Issue 368).godef
to locate standard packages correctly by passing the GOROOT
environment variable.golangci-lint
integration bug that prevented displaying the lint results correctly when linters like nolintlint
are enabled (Issue 411).Go: Test Previous
(Issue 269).json-rpc2
and lodash
to address vulnerability reports from npm audit
.Thank you for your contribution, fujimoto kyosuke, OneOfOne, Aditya Thakral, Oleg Butuzov, Rebecca Stambler, Peter Weinberger, Brayden Cloud, Eli Bendersky, Robert Findley, Hana Kim!
gopls
error report suggestion and changed to send reports to the vscode-go issue tracker instead of the go issue tracker (cl/240506).preview
note in the published extension (Issue 273).Go: Subtest At Cursor
runs an individual subtest if the subtest's name is a simple string (cl/235447).go.trace.server
controls tracing between VS Code and the language server (cl/232458). Unlike tracing using gopls
flags, this controls client-side tracing, and does not require to restart the server to change the value. This client-side trace is presented in the gopls
output channel. The server-side trace has been moved to the new gopls (server)
output channel (cl/233598).GOROOT
. We plan to add Go version switch, and other features using this status bar item.Go: Add Tags To Struct Fields
prompts transform parameter input if the setting go.addTags.promptForTags
is true (Issue 2546).Go: Locate Go Tools
command output includes the GOBIN
value. (cl/235197).go.gopath
, go.goroot
, go.toolsGopath
are now machine-overridable (cl/236539, Issue 2981).GOROOT
environment variable any more. go.goroot
is used to select the go
command under the specified directory (Issue 146).gopls
version detection and upgrade logic when pre-release versions are involved (cl/235524).Run > Run Without Debugging (^F5)
are now cleaned up when the run sessions end (cl/236879).go.alternateTools.go
is set, the path to $(go env GOROOT)/bin
is passed to underlying tools to ensure they use the same go
version (cl/239697).pgrep
on mac OS (cl/236538, Issue 90).Thank you for your contribution, Brayden Cloud, Bulent Rahim Kazanci, Eli Bendersky, Hana Kim, Polina Sokolova, Quoc Truong, Rebecca Stambler, Rohan Talip, Ryan Koski, Sean Caffery, Ted Silbernagel, Vincent Jo, and codekid!
This is the first version published with golang
publisher ID. This version is functionally identical to 0.14.3 except the following modifications.
Rebecca Stambler (@stamblerre)
This is the last version published with ms-vscode
publisher ID.
Go: Fill struct
to work correctly when file has multi byte characters. PR 2611vscode-languageclient
being used to make use of all the upstream fixes. This changes the min version of the VS Code for upcoming updates of this extension to be 1.41. Older versions of VS Code will no longer receive any updates from this extension.program
attribute in the debug configuration pointing to a file, debug just the file and not the entire package. This allows one to debug single files when a folder has multiple files with the main
function. Feature Request 1229 implemented with PR 3016go run .
instead of passing the current file to the go run
command when the command Run: Start Without Debugging
command is executed with the program
attribute in the debug configuration pointing to a folder. Previously, this would result in errors for cases when the current file uses members from a separate file in the same pacakge. Feature Request 3096 implemented with commit 78518d7eCarlton Henderson (@CarltonHenderson)
golangci-lint
. PR 3112Alexandre Vilain (@alexandrevilain)
Go: Apply Cover Profile
. PR 3119gopls
release notes when prompting to update the tool.gopls
with parameter hints is disabled , avoid showing the parameter hints after auto-completing a method. Fixes Bug 3075 with PR 3084Go: Locate Configured Go Tools
that prints the location of the Go tools that this extension depends onRebecca Stambler (@stamblerre)
gopls
get prompted to update the language server.Go: Apply Cover Profile
to apply code coverage decorators from a custom cover profile. Feature Request 1596 implemented with PR 2361envFile
in the debug configuration now supports configuring multiple env files. Feature Request 1746 implemented with PR 2395Jakub Warczarek (@programmer04)
index
with i
. Feature Request 2943 implemented with PR 3010go.languageServerExperimentalFeatures
which allows you to disable experimental features from the language server has been trimmed the features that can be thus disabled to the below as rest of the features are deemed to be stable.Restart language server
if the language server had not started successfully.go.coverOnSingleTestFile
to enable applying code coverage resulting from running all tests in current file either using the code lens run file tests
or the command Go: Test File
. Feature Request 2873 implemented with PR 2884Don't show again
to the warning that appears on saving changes to files when in the midst of debugging. Feature Request 2880 implemented with PR 2906go.addTags
and go.removeTags
settings as placeholders in the input boxes that appear when running the Go: Add Tags To Struct Fields
and Go: Remove Tags From Struct Fields
commands. Feature Request 2929 implemented with PR 2944go.buildTags
and go.testTags
are respected by the Go: Debug Test At Cursor
command. Fixes Bug 2953 with commit d6b6668go.testFlags
are treated as arguments and not build flags by delve when debugging tests. Fixes Bug 2115 with commit 9ab7b8bffRebecca Stambler (@stamblerre) & Ramya Rao (@ramya-rao-a)
gopls
and prompt to update accordingly. This can be disabled using the new setting go.useGoProxyToCheckForToolUpdates
.Rebecca Stambler (@stamblerre)
Go to Implementation
feature when using the language server.Kaarthik Rao Bekal Radhakrishna (@karthikraobr)
highlight
to go.languageServerExperimentalFeatures
setting to allow disabling of the highlighting feature from language server. Fixes Bug 2664 with PR 2833nil
value and zero length. Fixes Bug 2813 with PR 2839Go: Add Import
command. Feature Request 2683 implemented with PR 2803gopls
wiki and added link to recommended VS Code settings when using gopls
. PR 2852Kegsay @Kegsay & Zac Bergquist (@zmb3)
Marcus Farkas (@ToothlessGear)
Go: Test All Packages In Workspace
command failed to run tests since the last update.Go: Build Workspace
command failed to run the build command since the last updategopls
results in the extension throwing error & not working as expected since the last updatego vet .
instead of go vet ./...
when vetting current package for better performance.gopls
that was introduced in the previous update, relied on making calls to https://proxy.golang.org. In this patch release, we replace such calls with a check against a known hard-coded value for the latest version of gopls
. Details on the next steps here are captured in the issue 2776gopls
can now be used when using Go from the tipgo.alternateTools
setting to provide an alternative for gopls
. PR 2660James George (@jamesgeorge007)
go.goroot
and not go.gopath
, go.toolsGopath
setting to be of scope machine
in order to support the latter two to be configured at worksapce level. More in this is discussed at 2576.output
attribute in the debug configuration when mode
is set to test
. Fixes Bug 2445 with commit 373f0743goimports
instead of the default goreturns
as the formatting tool when using modules without the language server, now has the option to not be shown again for cases when you don't want to use goimports
. Fixes Bug 2578 with commit 658db8d4go.goroot
, go.gopath
and go.toolsGopath
settings to be of scope machine
as per upstream request 2576 from VS Code to better support remote scenarios.@BetaXOi & Joel Hendrix (@jhendrixMSFT)
Please note the feature of attaching to a local process using process id only works when the process is started by running the compiled code i.e the executable and not by using the command go run
. This is a limitation from delve.
Go: Restart Language Server
to restart the language server which previously was possible only by reloading the VS Code window. Feature Request 2500 implemented with PR 2530Rebecca Stambler (@stamblerre)
gopls
by default and add the feature to provide to clickable Godoc links for import statements. PR 2518incrementalSync
to go.languageServerExperimentalFeatures
setting. If true, the language server will accept incremental document synchronization. PR 2493${workspaceRoot}
and ${workspaceFolder}
for the -vetTtool
flag provided in go.vetFlags
setting. Feature Request 2527 implemented with PR 2528${workspaceRoot}
and ${workspaceFolder}
for the values provided to the go.alternateTools
setting. Feature Request 2543 implemented with PR 2544gotype-live
to provide diagnostics as you type only when the user is not using gopls
and is not in module mode. This is because gopls
supports this feature out of the box and the tool doesnt support modules. Fixes Bug 1950 with commit d1bf95c5This patch release has fixes for the below bugs
go.autocompleteUnimportedPackages
is enabled, packages show up in completion list when typing .
after a variable or existing package.gopls
.This patch release has fixes for the below bugs
gopls
crashes when -trace
is set in the go.languageServerFlags
settinggo.useLanguageServer
is set to true
, but no language server can be foundgo.mod
and go.sum
files, thus providing syntax highlighting for them. Feature Request 1886 implemented with PR 2344gopls
, the language server from Google as the one from Sourcegraph is no longer under active development. Also because gopls
supports Go modules. PR 2383. Please read our updated README on language servers for the latest on what we recommend.goimports
for formatting when using Go modules without the language server because goreturns
(the default formatting tool) doesn't work with modules yet. Fixes Bug 2309GO111MODULE
is set to on
inside the GOPATH. Fixes Bug 2238 with commit 15f571e4Go: Extract to function
Go: Extract to variable
showGlobalVariables
property in the go.delveConfig
setting. Feature Request 2323 implemented with PR 2351Filippo Valsorda (@FiloSottile) & Vlad Barosan (@vladbarosan)
go.toolsGopath
is different between workspaces. PR 1589Jackson Kearl (@JacksonKearl) & Vlad Barosan (@vladbarosan)
GOBIN
when user has set go.toolsGopath
setting. Fixes Bug 2339 with commit 9f99c30ListPackageVars
command in delve. PR 2289Adrian Suwała (@Ashiroq) & * Vlad Barosan (@vladbarosan)
Go: Debug Test at Cursor
to debug the test function under the cursor. This provides the same feature as the debug codelens, but in the form of a command. Feature Request 1088 implemented with PR 2059proc.go
file when stepping in/out during debugging. Fixes https://github.com/Microsoft/vscode/issues/65920LoggingDebugSession
to show logs from the VS Code debug adapter. Feature Request 858 implemented with PR 2081log
which would be the old verbose
. The new verbose
will include logs from the VS Code debug adapter.Go to definition
feature now works on individual files. Fixes Bug 2246 with commit 58817b8Go to definition
feature now works for sub modules as well. Fixes Bug 2180 with PR 2262go doc
processes being spawned. Fixes Bug 2152 with commit e4522ba1. This is done using the flag -excludeDocs
in the go.gocodeFlags
setting.Kaarthik Rao Bekal Radhakrishna (@karthikraobr)
Go: Install/Update Tools
command. [PR 2235](https://github.com/ Microsoft/vscode-go/pull/2235)Rebecca Stambler (@stamblerre)
GO111MODULE
is explicitly set inside GOPATH.Kaarthik Rao Bekal Radhakrishna (@karthikraobr)
Go to Type Definition
& Peek to Type Definition
commands. Feature Request 2121 implemented with PR 2136Kaarthik Rao Bekal Radhakrishna (@karthikraobr)
Copy Value
, Copy as expression
and Add to Watch
features in the context menu on the variables pane in the debug viewlet. Feature Request 1990 implemented with PR 2020go.gopath
& go.toolsGopath
settings now support the use of environment variables using the format ${env:XXX}
. Feature Request 1732 implemented with PR 1743nsf/gocode
when using Go version 1.8 or older due to mdempsky/gocode#73golint
and gogetdoc
are no longer supported in Go version 1.8 or oldergo doc
instead of godoc
for the showing the documentation when hovering over symbols and the Signature Help widget.Engineering Updates
Documentation Updates
Fix for issue with installing/updating tools when using the Go: Install/Update Tools
command. Bug 2024 fixed by Kaarthik Rao Bekal Radhakrishna (@karthikraobr) and Ramya Rao (@ramya-rao-a)
file
to go.lintOnSave
setting to enable linting just the current file instead of package/workspace on file save. Feature Request 1931 implemented with PR 1965select
statements. PR 2004Go: Show All Commands
feature. Feature Request 1822 implmented with PR 1952ShowerYing (@showerying), Ramya Rao (@ramya-rao-a)
godoc
from the list of installable Go tools as it doesnt support CLI mode anymore. Use godoc
binary which is shipped as part of the Go distribution instead.go.gocodePackageLookupMode
setting. Note: This only applies when using nsf/gocode. Latest versions of the Go extension uses mdempsky/gocode by default. PR 1908go.gotoSymbol.includeImports
was enabled.Documentation Updates
Engineering Updates
Nguyen Long Nhat (@torn4dom4n)
$workspaceRoot
with $workspaceFolder
. PR 1977Analysis Tools Missing
warning for the forks of godef
and gocode
. They are needed only when using Go modules and there are prompts to install them when the extension detects the use of modules.Rebecca Stambler (@stamblerre)
godef
and gocode
to provide Go to definition
and Auto-completion
features respectively when using Go modules. The binaries installed from these forks will have the suffix -gomod
and will only be used when you use Go modules.Bianca Rosa de Mendonça (@biancarosa)
Go: Benchmark File
, Go: Benchmark Package
and codelens to run all the benchmarks in current file & package respectively. Feature Request 1522 with PR 1898 & PR 1899go.generateTestsFlags
to provide flags for the gotests
tool when generating tests. PR 1841Johan Lejdung (@johan-lejdung)
go.testTags
to be used for running tests. This way, you can use the existing go.buildTags
for compiling and a different set of tags for running tests. Feature Request 1842 implemented with PR 1877Analysis Tools Missing
button in the status bar. PR 1922iferr
and forr
i.e “if err ...” the “for range”. Feature Request 1920 implemented with PR 1924Go: Test File
command. Bug 1911useApiV1
setting/configuration with apiVersion
. Feature Request 1876gogetdoc
and gopkgs
if using Go modules.go.inferGopath
in workspace settings when using Go modules automatically.Go: Add Import
command that gives you a list of importable packages to add to the import block of current fileGo: Browse Packages
command that lets you browse available packages and their filesgo.autocompleteUnimportedPackages
setting is enabled.auto
. In this mode, the debugging sessions will run in test
mode automatically if the current active file is a test file. Otherwise this defaults to the usual debug
mode. Feature Request 1780"showLog": true
is added to the debug configuration. PR 1815.go.toolsEnvVars
setting which gets used by all Go tools in this extension will now be passed to dlv
as well during debugging sessions. With this change you dont need to repeat the variables in the debug configuration if you have already added it in the settings. Feature Request 1839go.gopath
command when run programatically by other extensions now returns the GOPATH as determined by this extension. Useful for other extensions that want to provide additional features but do not want to repeat the work done by this extension to determine the GOPATH.Go: Add Package to Workspace
that will add selected imported package to the current workspace. Feature Request 1733 implemented with PR 1745Marwan Sulaiman (@marwan-at-work)
Go: Generate Interface Stubs
command when using on an interface that is defined inside an “internal” folder.Bug 1769go.delveConfig
to configure the use of v2 apis from delve to be used when debugging tests as well normal code. Feature Request 1735 implemented with PR 1749go.alternateTools
to provide alternate tools or alternate paths for the same tools used by the Go extension. Provide either absolute path or the name of the binary in GOPATH/bin, GOROOT/bin or PATH. Useful when you want to use wrapper script for the Go tools or versioned tools from https://gopkg.in. PR 1297. Some scenarios:go
to goapp
when using App Engine Gogometalinter
to gometalinter.v2
if you want to use the stable version of the toolgocode
before updating and show appropriate message when failed to do so.golangci-lint
as a linter. Feature Request 1693 implemented with PR 1693Minko Gechev (@mgechev) and Mark Wolfe (@wolfeidau)
revive
as a linter. Feature Request 1697 implemented with PR 1699, PR 1703 and commit d31636go.coverageDecorator
. Feature Request 1302 implemented with PR 1695.Frederik Ring (@m90), Ramya Rao (@ramya-rao-a)
go.languageServerExperimentalFeatures
to opt-in to try such new features from the language server that might not be feature complete yet. Feature Request 1593 implemented with PR 1607~
, ${workspaceRoot}
, ${workspaceFolder}
in the go.testFlags
setting. Feature Request 928Go: Add Import
shows up the list of imports ASAP. Fixes Feature Request 1450go.formatTool
, go.lintTool
or go.docsTool
setting to a tool that they dont have installed yet.go.toolsEnvVars
setting to the process that runs the language server.go.inferGopath
setting is enabled. Feature Request 1525Go to Definition
feature when the entire symbol is selected with cursor at the end. Fixes Bug 891.go.installDependenciesWhenBuilding
to control whether the -i
flag is passed to go build
/go test
when compiling. Feature Request 1464go env
if not set as environment variable explicitly.go.toolsEnvVars
arent being used. PR 1665go.gotoSymbol.includeGoroot
. If enabled, the symbols from the standard library are included when doing a workspace symbol search using the Go to Symbol in Workspace
command. Feature Request 1567 and PR 1604go.coverOnSingleTest
. If enabled, code coverage will be shown in the editor when running individual tests. Feature Request 1637 and PR 1638const
, package
, type
and var
. PR 1624main
in a test file if the folder contains a main.go
. PR 1630go.testEnvVars
and go.toolsEnvVars
. Bug 1608Go to Implementation
and Peek Implmentation
commands when using the Go Language Server. Feature Request 1611output
option of delve in debug configuration.The location provided here is where delve will output the binary it then uses for debugging. PR 1564go build
. PR 1573Go to Implementation
to work both ways. Feature Request 1536go vet
instead of go tool vet
from Go 1.10 onwards as the latter now supports all vet flags. PR 1576Go: Fill Struct
integrates the fillstruct
tool that lets you fill struct fields with default values. PR 1506Kevin Wiesmüller @kwiesmueller
gopkgs
fails to get packages that are needed to provide the completions for unimported packages. PR 1528Anatoly Milkov (@anatolym) and Christian Winther (@jippi)
Go: Build Workspace
command or the setting "go.buildOnSave": "workspace"
results in persistent error from trying to build the root directory with no Go files.goreturns
is updated. Fixes Bug 1447~
, $workspaceRoot
and $workspaceFolder
are now supported in the go.goroot
settinggo.inferGopath
will now infer the correct GOPATH even in the below 2 cases which wasnt supported beforegocode
to fix issue with code completion when there are unicode characters in the file. Fixes Bug 1431Insert Snippet
commandspawn
instead of exec
when running formatters.onDebugResolve
activation event instead of onDebug
to avoid activating the Go extension when other type of debug sessions are startedgoreturns
: PR sqs/goreturns#42. This in turn fixes Bug 613 and Bug 630${workspaceFolder}
in the below settingsgo.gopath
go.toolsGopath
go.testEnvVars
go.testEnvFile
Analysis Tools Missing
message has bee updated to only appear for the tools backing basic features of the extensiongo.formatOnSave
setting in favor of editor.formatOnSave
. To disable formatting on save, add the below setting:"[go]": { "editor.formatOnSave": false }This fixes the below issues
New commands
Go: Run on Go Playground
to run the current file (only if all its dependencies are from the std library) in the Go Playground using goplay. PR 1270. Feature Request #1211go.playground
to control whether to run and/or share a link to the playground and/or open the playground in the browser.Go: Benchmark Function At Cursor
and Codelens for running benchmarks in test files. PR 1303. Feature Request #972Go: Lint Current Package
and Go: Lint Workpsace
to lint using the tool specified in the go.lintTool
setting and the flags specified in the go.lintFlags
setting. PR 1258. Feature Request #1041Go: Vet Current Package
and Go: Vet Workpsace
to vet using the flags specified in the go.vetFlags
setting. Feature Request #1041Go: Build Current Package
and Go: Build Workpsace
to build using the flags specified in the go.buildFlags
setting and build tags specified in the setting go.buildTags
. Feature Request #287Go: Install Current Package
to install the current package using the flags specified in the go.buildFlags
setting and build tags specified in the setting go.buildTags
. Feature Request #287Completion Improvements
gocode
can now use gb specific rules when providing completions. Set the new setting go.gocodePackageLookupMode
to gb
to use this feature. Feature Request #547Performance improvements
autobuild
feature of gocode
which is known to slow completions is now disabled by default. Fixes Bug 1323-i
flag when building, we do not rely on autobuild
feature of gocode
to ensure fresh results from dependencies.buildOnSave
setting, then use the new Go: Build Current Package
command once in a while to ensure the dependencies are up to date or enable the go.gocodeAutoBuild
setting.go vet ./...
instead of go tool vet -flags
. Fixes Bug 1215Others
guru
fails to provide references. Fixes Bug 1336go.buildTags
setting. Fixes [Bug 1355]https://github.com/Microsoft/vscode-go/issues/1355).We now have Multi Root support for Go. PR 1221 Please note:
Go to Symbol in workspace
.package
snippet completion is now smarter when suggesting package names. PR 1220. It suggestsmain
when current file is main.go
or there exists a main.go
file in current folderinternal_test.go
_test
when current file is a test file-
or .
, then what appears after the -
or .
is suggested.go.useCodeSnippetsOnFunctionSuggestWithoutType
is introduced. This allows completions of functions with their parameter signature but without the parameter types. Feature Request 1241Log
methods from the testing
package$workspaceRoot
will now be resolved when part of go.testEnvVars
and go.toolsEnvVars
setting.Go: Browse Packages
command will now include newly installed/built packages without the need for reloading VS Code.Go: Get Package
is introduced to run go get
on the package in the import statement under the cursor. PR 1222Go To Implementation
command on interfaces. Feature Request #771.Go: Browse Packages
to make browsing selected package faster. PR 1136helloweb
that generates a web app with an http endpoint returning a greeting and current time. PR 1113log.Println
. Fixes Issue #1120 with PR 1124Go: Test Package
is run. You can disable this by setting go.coverOnTestPackage
to false
.go.coverOnSave
was disabled.launch.json
file anymore. When no GOPATH is provided this way, the debug adapter will now infer the GOPATH based on the path of the file/package being debugged. This fixes Issue #840.go.buildFlags
, go.buildTags
and go.testFlags
settings. Fixes Issue #1117gometalinter
and dlv
will honor the go.toolsGopath
setting. Fixes Issue #1110gometalinter
, while only supporting a subset of the tools. Use the setting go.lintTool
to try this.go.coverageDecorator
to try this.Go: Browse Packages
. Feature Request 330Go: Test all Packages in Workspace
go.buildOnSave
is set to workspace
. Bug 1060go.buildTags
when using gogetdoc
. Bug 1024-i
is passed as a build flag. Bug 1064Go: Add Import
command is used. Bug 1056Go: Generate Interface Stubs
should work when interface is prefixed with package pathgo.testEnvFile
to configure the location of a file that would have environment variables to use while running tests. PR 971key=value
.go.test.EnvVars
will override the aboveF5
, the above will not be used. Continue to use the env
and/or envFile
property in the debug configurations in the launch.json
file.go.buildOnSave
, go.lintOnSave
and go.vetOnSave
now take values package
, workspace
or off
instead of the previous true
/false
.true
/false
for these settings, they will work as they did before, but you will get a warning in your settings file.-i
flag.gometalinter
by using the --aggregate
flag which aggregates similar errors from multiple linters.---
is anywhere in the fileGo: Test Function At Cursor
fails.go.testEnvVars
while debugging tests using codelensgo.referencesCodeLens.enabled
is deprecated in favor of go.enableCodeLens
to control multiple types of codelens."go.enableCodeLens": { "references": false, "runtest": true }
Find All References
command. PR 933 and PR 938. You can disable this by updating the setting go.referencesCodeLens.enabled
.go.coverageOptions
to control whether you want to highlight only covered code or only uncovered code or both when code coverage is run. PR 945Go: Test Coverage In Current Package
is renamed to Go: Toggle Test Coverage In Current Package
and it does exactly what the name suggests. Toggles test coverage. Commit cc661daf--backend=lldb
option in Mac by default. You can now change this default value by setting the backend
property to native
in the launch.json
file. Commit 4beecf1. Root cause is expected to be fixed in delve itself and is being tracked in derekparker/delve/818go.toolsEnvVars
where you can specify env vars to be used by the Go tools that are used in the Go extension. PR 932 and commit bca4dd5f. This fixes Bug 632 as well.gotype-live
which is gotype
with support for unsaved file contents. PR 903go.liveErrors
controls this feature."go.liveErrors": { "enabled": true }
to enable this feature"go.liveErrors": { "enabled": true, "delay": 500 }
to update the delay (in milliseconds) after which gotype-live
would be run post a keystrokelaunch.json
file. PR 904launch.json
file, GOPATH from settings wont be read. You will need to set it in the env
property as before--config
flag for gometalinter
now supports the use of ${workspaceRoot}
and ~
that allows users to provide config file path relative to workspace or home directory respectively. PR 909Go: Test All Packages in Workspace
to run tests from all packages in the workspace.Fix for Bug 892 which breaks build when the user has multiple GOPATHs and the Go project being worked on is not the first one among the multiple GOPATHs. Commit d417fd6
Go: Add Tags
command adds tags configured in go.addTags
setting to selected struct fields. By default, json
tags are added. Examples:xml
tags, set go.addTags
to {"tags": "xml"}
xml
with cdata
option, set go.addTags
to {"tags": "xml", "options": "xml=cdata"}
json
and xml
tags, set go.addTags
to {"tags": "json,xml"}
Go: Remove Tags
command removes tags configured in go.removeTags
setting from selected struct fields.xml
tags, set go.removeTags
to {"tags": "xml"}
go.addTags
and/or go.removeTags
to {"promptForTags": true}
diff
tool from Git or Cygwin are in the PATH
in Windows. PR 866Ctrl+F5
or run the command Debug: Start Without Debugging
to run using the currently selected launch configuration.launch.json
file, then the current file will be run.type
as debug
and program
that points to a Go file and not packageenvFile
attribute in launch.json
where you can provide a file with env variables to use while debugging. PR 849go.languageServerFlags
that will be passed while running the Go language server. PR 882["trace"]
to see the traces from the language server in the output pane under the channel “go-langserver”["trace", "logfile", "path to a text file to log the trace]
to log the traces and errors from the language server to a file.Go: Install Tools
command now installs delve as well in Linux and Windows, but not in Mac OSX. Commit 30ea096 Fixes Bug 874Go: Install Tools
command now installs godoc
. PR 854GOPATH
as defined by the go env
output as default. Use go
binary from default platform specific locations when GOROOT is not set as env variable. Fixes Bug 873go.editorContextMenuCommands
to control which commands show up in the editor context menu.go.gotoSymbol.ignoreFolders
that allows to ignore folders while using the “Go to Symbol in Workspace” feature. This takes in an array of folder names (not paths). Best used to ignore vendor folders while doing a workspace symbol search. PR 795go.useLanguageServer
to use the Go language server from Sourcegraph for features like Hover, Definition, Find All References, Signature Help, Go to Symbol in File and Workspace. PR 750go.inferGopath
. When true
GOPATH will be inferred from the path of the folder opened in VS Code. This will override the value from go.gopath
setting as well as the GOPATH environment variable. PR 762F5
to start the debug session. A launch.json
is still required to debug tests or for advanced debug configurations. PR 769launch.json
file. PR 794go.testOnSave
. When true
, all tests in the current package will be run on saving a Go file. The status of the tests will be shown in the status bar at the bottom of the VS Code window. It is not advised to have this on when you have Auto Save enabled. PR 810-v
to the go.testFlags
to get verbose output. PR 817go.toolsGopath
for providing an alternate location to install all the Go tools that the extension depends on, if you don't want them cluttering your GOPATH. PR 351 and PR 737.Go: Install Tools
command to install the tools to the new location.Go: Install Tools
command now support gometalinter
if it is your chosen linting tool. PR 735.gometalinter
internally installs linters and expects them to be in the user's GOPATH, gometalinter
will get installed to your GOPATH and not the alternate location specified in go.toolsGopath
-i
flag (for non main packages) which installs dependent packages, which in turn get used in subsequent builds resulting in faster builds in bigger workspaces. PR 718A new setting go.testFlags
that can be used to run tests. If null, go.buildFlags
will be used. PR 482
Customize flags for each of the test command by using different keybindings. PR 482. In the below example, ctrl+shift+t
is bound to run the tests in current file with -short
flag. The commands here can be go.test.package
, go.test.file
or go.test.cursor
.
{ "key": "ctrl+shift+t", "command": "go.test.file", "args": { "flags": ["-short"] }, "when": "editorTextFocus" }
New toggle command Go: Toggle Test File
that lets you toggle between your Go file and the corresponding test file. Previous commands Go: Open Test File
and Go: Open Implementation For Test File
have been deprecated in favor of this new command. PR 739. You can add a keyboard binding to this as below:
{ "key": "ctrl+shift+t", "command": "go.toggle.test.file", "when": "editorTextFocus && editorLangId == 'go'" }
If current file is not a test file, show error message while running test commands, instead of displaying success message. Fixes #303
cwd
launch configuration argument. PR 714env
property in launch.json
will also be used to find dlv
tool. PR 725.trace
in launch.json
to provide option to have verbose logging while debugging using vscode-debug-logger. PR 753. This will help in diagnosing issues with debugging in the Go extension.http.proxy
setting while installing Go tools. PR 639godoc
, godef
, gogetdoc
. PR 711go.autocompleteUnimportedPackages
is now false to reduce noise in the suggestion list. Members of unimported packages will still show up in suggestion list after typing dot after package name.gogetdoc
for Goto Definition , Hover and Signature Help features. PR 622 To use this, add a setting "go.docstool": "gogetdoc"
to your settings and reload/restart VS Code. This fixes the below bugsnet
packagego.formatOnSave
due to popular demand.editor.formatOnSave
and deprecating go.formatOnSave
PR 578Go: Open Test File
Go: Open Implementation for Test File
Go: Generate unit tests ...
commands. PR 610go.formatFlags
to pass flags to the formatting tool PR #461gotests
tool. Needs Go 1.6 or higher. PR #489Go: Generate unit tests for current file
Go: Generate unit tests for current function
Go: Generate unit tests for current package
go.testEnVars
to pass environment variables to Go tests PR #498diff
tool which is not available on Windows by default. You can install it from DiffUtils for Windowsgo.autocompleteUnimportedPackages
to true. PR #497Go: Add Import
command. PR #508gometalinter
to Go 1.5 users since golint
dropped support for Go 1.5 PR #509goimports
. PR #470 and PR #509goreturns
in Windows. PR #463Go: Install Tools
PR #428showLog:true
. PR #412godoc
now appears on hover PR #424gometalinter
as tool for linting PR #294showLog
to toggle the debugging output from delve
PR #352