📣 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.- Added the new
"Go: Test Function At Cursor or Test Previous"
command. (PR 1509) "Go: Add Imports"
command usesgopls
instead ofgopkg
. This requiresgopls@v0.7.0
or newer. (Go Issue 43351)
- Fixed
"Go: Lint Workspace"
that failed no editor is active. (Issue 1520) - Fixed
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.
- Change the default path separator to
/
when applyingsubstitutePath
debug configuration. (Issue 1497) - Warn users when
go.goroot
setting is used. (Issue 1501)
- Update to latest version of
dlv-dap
. Some of newest additions todlv 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. - Adjusted feedback survey prompt probability.
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.
- Update to latest version of
dlv-dap
. Documentation of current features and limitations can be found in the documentation - Add debug previous command (Issue 798)
- Add
Go: Initialize go.mod
command to rungo mod init
in the current workspace folder (Issue 1449) - Use
program
in debug configuration to determine mode inauto
(Issue 1422) - Auto update
dlv-dap
if autoUpdates enabled (Issue 1404) - Set
editor.suggest.snippetsPreventQuickSuggestions
to false by default to enable code completion and quick suggestions inside a snippet (Issue 839)
- Set the
GOROOT
to the user specifiedGOROOT
ingo.goroot
- Fixed missing file bug in debug adapter (Issue 1447)
- Fixed inconsistent workpsaceFolder value bug in debug configuration (Issue 1448)
- Allow
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.
- Fixed regression in the
lintOnSave
feature. (Issue 1429) - Fixed
dlv-dap
installation to correcly useGOBIN
environment variable. (Issue 1430) - Fixed duplicate error notifications when missing
dlv-dap
. (Issue 1426)
- Updated the minimum required dlv-dap version. The new version includes support for
substitutePath
and shadowed variable annotation.
- Cleaned up launch configuration snippets for easier debug setup
- To use
dlv-dap
by default for all launch configurations (including codelenses), set thedebugAdapter
field in thego.delveConfig
setting (Issue 1293) - The list of debugging features only available with
dlv-dap
is now available here - Updated extension settings to match gopls v0.6.10
- Tightened the test function detection regex for codelenses (Issue 1417)
- Show error message when dlv-dap fails to launch (Issue 1413)
- Corrected install instructions for dlv-dap in popup (Issue 1395)
- Updated latest version of dlv-dap and gopls (v0.6.10)
🧪 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.
- Supports custom format tools when gopls is enabled. (Issue 1238)
- Allows to use
dlv dap
for debugging.
- Do not lint with
staticcheck
if it is enabled ingopls
. (CL 301053) - Use
go list
to check availability of newly released gopls. (CL 295418) - Use
go env -json
to query go env variables. (CL 301730) - Include gopls, go versions and OS info to the opt-out survey.
- npm audit fix
- Removed the deprecated
go.overwriteGoplsMiddleware
setting. - Added more testing for debug features using dlv-dap.
Thanks for the contributions, @hoanggc, @suzmue, @rstambler, @polinasok!
- Always check the gopls version before activating automated issue reporter regardless of the gopls update settings.
- Updated the hard-coded latest gopls version to v0.6.8 and the gopls settings.
- Updated the gopls version requirement. v0.23.1 requires v0.6.6+. (Issue 1300)
🎉 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
- Changed the default lint/format tools. (Issue 189, 192)
- Enhanced
dlv-dap
start logic (Issue 1270) and improved output/error message forwarding. (CL 296930)
- Fixed the spurious popup message about the use of
goreturns
. (CL 300430) - Fixed orphaned progress notification after restarting
gopls
. (Issue 1153) - Fixed cryptic error messages that appear when
gopls
commands fail. (Issue 1237) - Fixed incomplete folding range info issue caused by parse errors. Complete fix requires
gopls
v0.6.7+ (Issue 1224)
- Updated LSP to 3.16.0 (stable), and DAP to 1.44.0.
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
- Improved debugging workflow of attaching to local process.
(Issue 183)
By setting
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. - Enabled access to Delve DAP again. Simplified the Delve DAP launch workflow
and removed the intermediate Node.JS adapter.
If
"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 ofdlv
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) - Added an opt-in "Always Update" setting for
gopls
auto-update. (Issue 1095) Go: Reset Global State
andGo: Reset Workspace State
commands are available for easier extension state reset.- Enabled survey to collect feedback from users who disabled
gopls
. - Added a new setting (
"go.disableConcurrentTests"
) that prevents concurrentgo test
invocation. (Issue 1089)
- Issue 1113: error message when debugee terminates fast.
- Issue 179: disable stackTrace error pop-ups during debugging.
- CL 290289: check incorrect gopls flag usage before automated gopls crash report.
- Issue 948: show lint tool's name as the lint diagnostic collection name.
- Issue 1252: search
C:\Program Files\Go\bin
,C:\Program Files (x86)\Go\bin\go.exe
, the new default Go installation path in Windows.
- Migrated to use
gts
to enforce consistent coding style. (Issue 1227) - Preview mode features are available in both Nightly and the dev version.
- Enabled integration test in Go module mode.
- Enabled Delve DAP integration test.
- Removed the
latest
branch.
Thanks for your contributions, @Charliekenney23, @eneuschild, @suzmue, @stamblerre, @pjweinbgo, @polinasok!
- Added error details to automated error reports. (CL 287952)
- Used clickable links in
"go.languageServerExperimentalFeatures"
setting deprecation error messages. (CL 288133)
- Fixed a race during language client restarts. (CL 288372, CL 288352)
- Disabled the language server when using workspace folders over ssh. (Issue 1171)
- Added
dlv
to the"go.alternateTools"
example value list. (CL 289231)
- Bumped
ini
to 1.3.8 to address a vulnerability report fromnpm audit
.
Thank you for your contribution, @stamblerre, @hyangah, @patrasap0908!
- The language server,
gopls
, is enabled by default. (Issue 1037)
- Added the new Go welcome page. (Issue 949)
- Updated documentation. (troubleshooting, customization, settings guide)
- Updated the hardcoded latest gopls version to 0.6.4.
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.
- Fixed the
Cannot get property 'get' of undefined
error. (Issue 1104) - Restored the
"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.
- The new
dlvFlags
debug attribute is available for conveniently supply extra flags todlv
. (Issue 978) - Stop using workspace/folder-level settings from untrusted repositories that can be used to run arbitrary binaries. (Issue 1024)
- The extension now deduplicates diagnostics from both the language server and the linter. (Issue 142)
- Disabled
gotype-live
automatically when the language server is enabled. (Issue 1021) - Removed the
"go.languageServerExperimentalFeatures"
setting. (CL 280601). ThedocumentLink
feature is replaced withgopls
'sui.navigation.importShortcut
setting. Thediagnostics
feature replacement is still under discussion. Please provide feedback in Issue 50.
- Experimental features that were available only in the nightly extension are enabled in the master branch, and in presubmit & CI tests running on the master branch.
Thank you for your contribution, @hyangah, @suzmue, @pjweinbgo, @stamblerre!
- Updated
"gopls"
settings to match gopls v0.6.2. (CL 279728)
- Fixed a bug that caused incorrect fallback to a common
go
installation path whengo
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.
- Debugging
- The new
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. - Quick pick menu for creating
launch.json
was added. (Issue 131) - Report that
next
is automatically cancelled by delve if interrupted, for example, because breakpoint is set. See Issue 787 for details. (CL 261078)
- The new
- The new
tyf
snippet fortype name func()
was added. (Issue 1002) - Include the
gopls
settings section definition based ongopls
v0.6.0. (Issue 197, CL 278355) go.buildFlags
andgo.buildTags
are propagated togopls
unless"gopls": {"buildFlags": ..}
is set. (Issue 155)- The new
go.toolsManagement.checkForUpdates
setting allows users to completely disable version checks. This deprecatesgo.useGoProxyToCheckForToolUpdates
. (Issue 963)
- Added a workaround for the VSCode
PATH
setup issue. Whengo
isn't found fromPATH
, the extension will check/usr/local/bin
too (Issue 971). - Fixed language client crashes or duplicate language features on the guest side of a VS Live Share session. The initial fix added in v0.19.0 for VS Live Share wasn't sufficient. (Issue 605, 1024)
- Stop requiring to install legacy tools when the language server is used. (Issue 51)
- Update
gopls
if the existing version in the system is older than the minimum required version when the extension enablesgopls
automatically. (Issue 938) - Show language server start progress and allow only one outstanding language server restart request. (Issue 1011)
- Fixed a gocode-gomod installation bug that caused to ignore
GOBIN
setting. (CL 275877) - Marked settings that are not applicable when using the language server. (Issue 155)
- Deprecated unused settings such as
go.overwriteGoplsMiddleware
and marked deprecated settings. - Improved stability of debug functionality tests on windows.
- Improve the automated gopls issue template message. It includes the extension name and version.
- Prompt users to file an issue for feedback when they choose to opt out of gopls.
- CI test workflow now runs
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.
- Fixed
Run without Debugging
for Windows. This was a regression found in v0.19.0 (Issue 918). - Fixed snippets that used the reserved keyword ('var') as variable names (Issue 969).
- Fixed a file path expansion bug in subtest failure messages (Issue 956).
- Fixed unhandled promise rejection error in debug adapter (Issue 982).
- Disabled the experimental
godlvdap
debug configuration from the stable version. It is still available in Go Nightly (Issue 960). - Enabled user survey (Issue 910).
Thank you for your contribution, @suzmue, @RomanKornev, @hyangah!
A list of all issues and changes can be found in the v0.19.0 milestone.
- Go Nightly users are encouraged to discuss issues and share feedback in the #vscode-go-nightly slack channel as well as the newly created Go Nightly mailing list (Issue 817)
- All experiments have been turned on for Go nightly (Issue 818)
- Added a snippet for TestMain (Issue 629)
- Added
lispcase
,pascalcase
andkeep
as transform variants for go.addTags (Issue 906, 936) - Added support for
gomodifytags
's --template flag (Issue 826) - Language Server
- Upgraded to the latest vscode-languageclient pre-release (Issue 42148)
- Debugging
- package.json: activate extension onDebugInitialConfigurations (Issue 131)
- Fixed test streaming output handling to correctly add -json flag (Issue 471)
- Fixed bug that unnecessarily buffered test output (Issue 917)
- Fixed a bug that occurred when choosing a new Go environment using the file picker (Issue 868, 864)
- Hide running test StatusBarItem after cancelling tests
- Tool Installation
- Filter out unsupported document types to improve VS Code Live Share experience (Issue 605)
- Fixed language server survey computation error
- Debugging
- No longer shows a warning about editing Go files if there is no Go Debug Session running.
- Now removes user set '--gcflags' before passing the program to the debugger, since the debugger adds its own flags before building resulting in an error (Issue 117)
- Fixed bug where the working directory passed in by the user is ignored (Issue 918)
- Debugging
- Improved the extension contributor experience by renaming the test fixtures folder to avoid errors being shown for these files
- Language Server Tests
- Adjusted home directory used in gerrit CI since recent changes in kokoro were restricting access (Issue 833)
- Updated Github workflows actions/setup-go to v2
- Restructured the goTest code to be more readable and easier to test
- Continued to improve the gopls settings documentation generator (Issue 197)
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.
- New
Go: extract language server logs to editor
command was added (CL 263526).
- Fixed a bug that hid the Go status bar when there is no active text editor (Issue 831).
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.
- The new Go status bar provides a menu to manage the go version, open the gopls trace, open the
go.mod
file, and more. The oldGo Modules
status bar was removed in favor of this new unified status bar. See VS Code Go UI documentation to learn more about this. - New
Go: Toggle gc details
command toggles the display of compiler optimization choice for the open Go source file (CL 256658). - Upgraded LSP to
3.16
. Users of recentgopls
can access new features such asCall hierarchy
andSemantic tokens
.
- Debugging:
- Language Server Client: sends
gopls
config as LSP initialization options for correct workspace symbols computation (CL 259138). - Snippets: adds a placeholder for the
for
statement snippet (Issue 734). - Excludes
vendor
directories fromgo.inferGopath
disable mechanism (Issue 301). - New
go.logging.level
setting allows extra logging to help debugging extension issues (CL 256557). - For Nightly extension users,
Go: Show Survey Config
andGo: Reset Survey Config
commands are available.
- Fixed the bug that caused the debug adapter to leave bogus null items in the map type variable presentation (Issue 199).
- Fixed several debug adapter bugs that caused remote debug to hang (Issue 740, 766, 761, 764).
- Restored the correct handling of language server configuration change when users opt for enabling language server and installing
gopls
. (CL 258997). - Fixed a diagnostics error visualization issue when multiple files with errors are open (Issue 743).
- Changed the dependency tool installation to use the
go
command chosen from the currentGOROOT/bin
. This helps avoid using a different version ofgo
command forasdf
ordirenv
users (Issue 757).
- Documented the current limitation of symlink support in debugging (CL 257204), improved the instruction for CLI application debugging (CL 259677), and fixed syntax errors in example task configuration snippets (CL 259077).
- Added an initial set of tests for debug adapters (Issue 137). We will keep working to improve our test coverage.
Thank you for your contributions, @suzmue, @vologab, @amitlevy21, @danielhelfand, @egonk, @quoctruong, @polinasok, @pjweinbgo, @stamblerre, @hyangah!
- Fixed a regression caused by the change for (Issue 679).
If
go
is not found fromPATH
available to the extension, the extension tries a couple of well-known default locations to find thego
binary. In this case, we need to mutatePATH
so other tools includinggopls
ordlv
can choose the same go version. (Issue 713).
- Mutate the
PATH
/Path
environment variable only if users explicitly configure to select the go command usinggo.goroot
,go.alternateTools
, orGo: Choose Go Environment
menu. (Issue 679) - Includes sanitized gopls crash traces in the automated gopls crash report. (CL 256878)
- Changed the default of
go.coverMode
to bedefault
. (Issue 666) - Fixed a missing promise reject when go is not found. (Issue 660)
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.
- Delve's call feature is now accessible.
To use this feature, explicitly specify the
call
command. E.g.call myAwesomeFunc()
. It is an experimental feature in Delve. Please see the current limitations. (Issue 100) - The extension checks the go official download site and notifies users of
newly available Go versions. When a newer version is available,
Go Update Available
status bar item will appear. This feature is available only ifgo.useGoProxyToCheckForToolUpdates
is set true. (Issue 483) - The new
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 thecount
coverage data; feedback and contribution is welcome! (Issue 256, 594)
- Expands
'~'
in thecwd
attribute of the launch configuration. (Issue 116) - Debug config's
showGlobalVariables
is disabled by default, and this change improves speed. You can still inspect the global variables by registering them in theWATCH
section, or by configuringshowGlobalVariables
inlaunch.json
. (Issue 138) gofumpt
,gofumports
is added to recognized formatters list. (Issue 587)- Automatically restarts the language server if
go.toolsEnvVars
configuration is changed. (CL 254370) - Reports
go env
failures. (Issue 555)
- Fixed to use absolute file paths in error messages appearing in the DEBUG OUTPUT. This allows VS Code to locate the correct files. (Issue 456)
- Fixed handling of absolute file paths in coverage profile, on windows. (Issue 553)
- Changed to pass
GOROOT
when invoking thegopkgs
tool sogopkgs
continues to work with different go versions without being recompiled. (CL 254137) - Fixed to provide explicit directory for running go list and go version. (Issue 610, CL 253600, 253602)
- Fixed to trigger extension activation when commands for diagnostics,
such as
Go: Locate Configured Go Tools
are invoked. (Issue 457) - Fixed to prepend
GOROOT/bin
to integrated terminal's PATH environment variable whengo.goroot
is set on OS X. (Issue 544) - Fixed to correctly apply environment variables setting read from
envFile
in the launch configuration. We reworked how the environment variables configuration is processed during this cycle. Now the extension processes theenvFile
attribute instead of asking the debug adapter process to read the specifiedenvFile
. (Issue 452) - Disabled
go.installDependenciesWhenBuilding
by default. When this is enabled, the extension runsgo
commands with-i
, which is no longer recommended with recent versions of Go. (Issue 568) - Fixed a bug where we are not sending back 'configuration done' response. (Issue eclipse-theia/theia#8455, CL 254959)
- Added new documentation about switching go versions, and settings for standard library development.
- Improved debugging instruction and contribution guide. Enhanced automated settings documentation generation.
- Removed the obsolete string-type coverageDecorator support. (Issue 519)
- When gopls integration tests fail, tests print the observed gopls traces to help debugging.
- We plan to delegate computation of various
run test
CodeLenses togopls
. 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!
- Fixed the compile error message parsing bug that prevented correct file name expansion in test output. (Issue 522).
- Fixed the regression that caused to run tests in the local directory mode and result in more verbose output than the package list mode. (Issue 528).
- Fixed
"go.alternateTools"
settings to accept any tool names without settings.json diagnostics warning. (Issue 526)
- Fixed the bug that made test output verbose by default (Issue 471).
- Fixed the extension host crash bug due to a process-wide uncaught exception handler accidentally installed along with the inlined debug adapter. This crash bug also caused connection drops when used with the VS Code Remote extension (Issue 467, 469).
- Readded the predefined variable resolution support for
go.goroot
andgo.toolsEnvVars
(Issue 464, 413).
This version requires VS Code 1.46+.
Older versions of VS Code will not receive updates any more.
- Users can select/install a different version of Go with
Go: Choose Go Environment
command. When clicking theGo
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 thegolang.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 theClear Selection
item. (Issue 253) - When the Go version changes, the extension prepends
$GOROOT/bin
to thePATH
orPath
environment variable which then applies the change to the integrated terminal windows. - This version includes an experimental version of the new Debug Adapter that uses Delve's
native DAP implementation. It currently supports
launch
type requests indebug
ortest
mode. This is still in the early stages and requiresdlv
built from its unreleased, master branch. Subscribe to golang/vscode-go#23 for updates.
- Bundles the extension using webpack, which reduced the extension size (4.7MB -> 1MB) and the extension loading overhead (3.4K files -> 3 files) (Issue 53).
Go: Apply Cover Profile
applies code coverage for multiple packages (CL 238697). We fixed bugs in processing coverage profiles on Windows.- Suggests the official Go download page when no
go
tool is found. - Utilizes the
GOMODCACHE
environment variable, introduced in Go 1.15. - Prevents multiple debug sessions from launching (Issue 109).
- Streams test output when tests run with the
-v
option. This feature requires 1.14 or newer versions of Go (Issue 316). - Sets
additionalProperties
tofalse
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
includesgo env
results (Issue 195).- Avoids prompting users to switch the default format tool in modules mode if users enable the language server.
- Fixed the
PATH
environment variable adjustment when users use a wrapper as an alternate tool forgo
(CL 239697). - Fixed a bug in test output processing, which prevented VS code from linking test log messages with locations in the source file.
- Fixed a
gocode-gomod
installation bug whenGOPATH
includes multiple directories (Issue 368). - Avoids attempting to kill already terminated processes (Issue 334).
- Fixed
godef
to locate standard packages correctly by passing theGOROOT
environment variable. - Fixed a
golangci-lint
integration bug that prevented displaying the lint results correctly when linters likenolintlint
are enabled (Issue 411). - Fixed lost test function name arguments when running
Go: Test Previous
(Issue 269).
- Many enhancements to improve test reliability and test coverage were made during this dev cycle.
- TryBot is enabled, and the test results are posted to Gerrit CL. Currently, only the internal team members can see the details of the test results, but we will continue working to make them public.
- Windows tests are now fixed and enabled in GitHub Action-based CI.
- Refactored code shared by the extension and the debug adapters to prevent accidental debug adapter breakages.
- Updated
json-rpc2
andlodash
to address vulnerability reports fromnpm 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!
- Do not fail tools installation when gocode is not already running (Issue 355).
- Improved
gopls
error report suggestion and changed to send reports to the vscode-go issue tracker instead of the go issue tracker (cl/240506).
- Removed the
preview
note in the published extension (Issue 273).
- The new command
Go: Subtest At Cursor
runs an individual subtest if the subtest's name is a simple string (cl/235447). - The new setting
go.trace.server
controls tracing between VS Code and the language server (cl/232458). Unlike tracing usinggopls
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 thegopls
output channel. The server-side trace has been moved to the newgopls (server)
output channel (cl/233598). - There is now a new Go version status bar item. Clicking it currently only pops up the current
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 settinggo.addTags.promptForTags
is true (Issue 2546).Go: Locate Go Tools
command output includes theGOBIN
value. (cl/235197).- Improved debugging experience
- The debug adapter automatically infers the mapping between remote and local paths for easy remote debugging (cl/234020, Issue 45).
- The debug adapter handles errors that can occur during remote connection setup (cl/237550, Issue 215).
- Failed watch expression evaluation no longer pops up error message windows. The error is visible in the watch window instead (cl/236999, Issue 143).
- Better language server integration
go.gopath
,go.goroot
,go.toolsGopath
are now machine-overridable (cl/236539, Issue 2981).- The extension does not mutate the
GOROOT
environment variable any more.go.goroot
is used to select thego
command under the specified directory (Issue 146). - A redundant code action provider was removed when using the language server (cl/239284).
- Fixed
gopls
version detection and upgrade logic when pre-release versions are involved (cl/235524). - Processes started with
Run > Run Without Debugging (^F5)
are now cleaned up when the run sessions end (cl/236879). - When
go.alternateTools.go
is set, the path to$(go env GOROOT)/bin
is passed to underlying tools to ensure they use the samego
version (cl/239697). - Now the extension avoids invoking buggy
pgrep
on mac OS (cl/236538, Issue 90).
- More test coverage
- Upgraded dependencies including websocket-extensions from 0.1.3 to 0.1.4 (cl/228617, cl/236839, pr/3261).
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)
- Update documentation to reflect repository migration.
-
- Remove old telemetry code.
This is the last version published with ms-vscode
publisher ID.
- Hyang-Ah Hana Kim (@hyangah)
- Fix the bug introduced in the previous update where the code coverage does not disappear when edits to the file are saved.
-
- Add note to use WSL 2 for debugging to work in Windows Subsystem for Linux. PR 3167
-
- Fix the
Go: Fill struct
to work correctly when file has multi byte characters. PR 2611
- Fix the
-
- Allow setting breakpoints on a file from the module cache. PR 3079
-
- Improve the error message seen when debugging for "bad access". PR 3196
- Ramya Rao (@ramya-rao-a)
- Update the version of
vscode-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.
- Update the version of
-
- When debugging with the
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 themain
function. Feature Request 1229 implemented with PR 3016
- When debugging with the
-
- Show debug watch failures as warnings instead of errors to reduce the noise in debug console. Fixes Bug 3006 with commit 430362e
- Use
go run .
instead of passing the current file to thego run
command when the commandRun: Start Without Debugging
command is executed with theprogram
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 78518d7e
-
Carlton Henderson (@CarltonHenderson)
- Fix issue of no linting warnings when using a custom output format with
golangci-lint
. PR 3112
- Fix issue of no linting warnings when using a custom output format with
-
Alexandre Vilain (@alexandrevilain)
- Retain last used cover profile path in the input box when using the command
Go: Apply Cover Profile
. PR 3119
- Retain last used cover profile path in the input box when using the command
-
- Expand suspected relative file paths in test output only in case of error messages. Fixes Bug 1836 with commit 893b29bbf & commit 92d149c8
-
- Include link to
gopls
release notes when prompting to update the tool. - When using
gopls
with parameter hints is disabled , avoid showing the parameter hints after auto-completing a method. Fixes Bug 3075 with PR 3084 - New command
Go: Locate Configured Go Tools
that prints the location of the Go tools that this extension depends on
- Include link to
-
- Fix the cancelling of stale processes on non Windows machines. PR 3131
-
Rebecca Stambler (@stamblerre)
- Remove support for the language server from Sourcegraph. PR 3127
-
- Ensure users on versions older than 0.3.1 of
gopls
get prompted to update the language server.
- Ensure users on versions older than 0.3.1 of
-
- The outline feature now shows constants different from variables, and interfaces different from types. PR 2973
-
- A new command
Go: Apply Cover Profile
to apply code coverage decorators from a custom cover profile. Feature Request 1596 implemented with PR 2361
- A new command
-
- The
envFile
in the debug configuration now supports configuring multiple env files. Feature Request 1746 implemented with PR 2395
- The
-
Jakub Warczarek (@programmer04)
- Improve the code snippet for the for loop by replacing
index
withi
. Feature Request 2943 implemented with PR 3010
- Improve the code snippet for the for loop by replacing
- Ramya Rao (@ramya-rao-a)
- The setting
go.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.- format
- documentLink
- diagnostics
- Fix error "Cannot read property 'clear' of undefined" that appears on running the command
Restart language server
if the language server had not started successfully.
- The setting
-
- New setting
go.coverOnSingleTestFile
to enable applying code coverage resulting from running all tests in current file either using the code lensrun file tests
or the commandGo: Test File
. Feature Request 2873 implemented with PR 2884
- New setting
-
- Add the option
Don'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 2906
- Add the option
-
- Activate the Go extension when the workspace contains Go files rather than wait for a Go file to be opened. Feature Request 2821 implemented with PR 2859
-
- Use tags and options specified in the
go.addTags
andgo.removeTags
settings as placeholders in the input boxes that appear when running theGo: Add Tags To Struct Fields
andGo: Remove Tags From Struct Fields
commands. Feature Request 2929 implemented with PR 2944
- Use tags and options specified in the
-
- Update travis.yml with latest VM and improve time taken during cloning step. For more details, see PR 2915
-
- Update package dependencies. PR 2900
-
- Ensure the build tags from
go.buildTags
andgo.testTags
are respected by theGo: Debug Test At Cursor
command. Fixes Bug 2953 with commit d6b6668 - Ensure that test arguments passed to
go.testFlags
are treated as arguments and not build flags by delve when debugging tests. Fixes Bug 2115 with commit 9ab7b8bff
- Ensure the build tags from
-
Rebecca Stambler (@stamblerre) & Ramya Rao (@ramya-rao-a)
- Use Go proxy to check if user has an older version of
gopls
and prompt to update accordingly. This can be disabled using the new settinggo.useGoProxyToCheckForToolUpdates
.
- Use Go proxy to check if user has an older version of
-
Rebecca Stambler (@stamblerre)
- Support installing Go tools in module mode when using Go 1.11. Previously, this worked only in Go 1.12 and above
- Clear diagnostics when language server restarts to avoid linger errors from the previous run.
- Enable the
Go to Implementation
feature when using the language server.
-
Kaarthik Rao Bekal Radhakrishna (@karthikraobr)
- Add flag
highlight
togo.languageServerExperimentalFeatures
setting to allow disabling of the highlighting feature from language server. Fixes Bug 2664 with PR 2833 - Distinguish between arrays with
nil
value and zero length. Fixes Bug 2813 with PR 2839 - Sort standard library packages before others in the drop down result of the
Go: Add Import
command. Feature Request 2683 implemented with PR 2803
- Add flag
-
- Fix the placeholder text when extracting method. PR 2799
-
- Updated links to
gopls
wiki and added link to recommended VS Code settings when usinggopls
. PR 2852
- Updated links to
-
Kegsay @Kegsay & Zac Bergquist (@zmb3)
- Enable more rules via tslint.
-
Marcus Farkas (@ToothlessGear)
- Re-enable linux tests in travis runs.
-
- Use the new template for bug reports. PR 2840
-
- Fix for bug 2766 where the
Go: Test All Packages In Workspace
command failed to run tests since the last update. - Fix for bug 2765 where the
Go: Build Workspace
command failed to run the build command since the last update - Fix for bug 2770 where failure to find the path to the go binary results in
gopls
results in the extension throwing error & not working as expected since the last update - Use
go vet .
instead ofgo vet ./...
when vetting current package for better performance.
- Fix for bug 2766 where the
- The prompt to update your
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 ofgopls
. Details on the next steps here are captured in the issue 2776
-
- Fix the bug where setting breakpoint fails if the remote program is started through dlv with --continue switch. Bug 2690
- Fix the bug where disconnecting (after attaching to) the remote program terminates it Bug 2592
- Fix the bug where setting breakpoint will fail if a breakpoint already exists (if dlv is started through multi client and another client sets the breakpoint).
-
gopls
can now be used when using Go from the tip- A new status bar item "Go Modules" will show up when the extension has determined that modules are being used. On clicking, this will take you to the wiki page for Go modules support in VS Code
-
- Allow the use of
go.alternateTools
setting to provide an alternative forgopls
. PR 2660
- Allow the use of
-
James George (@jamesgeorge007)
- Update README to contain Table of Contents. PR 2634
-
- Mark only
go.goroot
and notgo.gopath
,go.toolsGopath
setting to be of scopemachine
in order to support the latter two to be configured at worksapce level. More in this is discussed at 2576.
- Mark only
-
- Update the banner color to have a beter color contrast witht he new logo in the marketplace. PR 2631
-
- Update the extension to use new Go logo! PR 2582
-
- Add link to all the code snippets provided by the extension in the README. PR 2603
-
- Support the
output
attribute in the debug configuration whenmode
is set totest
. Fixes Bug 2445 with commit 373f0743 - Fix bug that got introduced in the previous update where nested variables show empty values when debugging. Fixes Bug 2601 with commit e89118e42
- Warnings regarding the inability to find the go binary in the PATH environment variable now includes the value of the PATH being checked.
- The prompt to choose
goimports
instead of the defaultgoreturns
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 usegoimports
. Fixes Bug 2578 with commit 658db8d4 - Avoid unwanted prompt to re-compile tools when current goroot is different from the previous only in terms of casing. Fixes Bug 2606 with commit b0a2d2d
- Preserve text highlighting as part of code coverage in multiple editor groups. Fixes Bug 2608 with commit 0de7e94e
- Update code coverage decorators in the visible editor immediately after corresponding setting is changed rather than wait for focusing on the editor. commit 86df86fd6
- Mark
go.goroot
,go.gopath
andgo.toolsGopath
settings to be of scopemachine
as per upstream request 2576 from VS Code to better support remote scenarios.
- Support the
-
@BetaXOi & Joel Hendrix (@jhendrixMSFT)
- When debugging, support attaching to a local Go process and detaching gracefully without killing the process. This uses the attach command delve. Feature Request 1599 implemented with PR 2125.
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. -
- A new command
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 2530
- A new command
-
Rebecca Stambler (@stamblerre)
- Enable diagnostics feature from
gopls
by default and add the feature to provide to clickable Godoc links for import statements. PR 2518
- Enable diagnostics feature from
-
- Add a new option
incrementalSync
togo.languageServerExperimentalFeatures
setting. If true, the language server will accept incremental document synchronization. PR 2493
- Add a new option
-
- Resolve
${workspaceRoot}
and${workspaceFolder}
for the-vetTtool
flag provided ingo.vetFlags
setting. Feature Request 2527 implemented with PR 2528
- Resolve
-
- Resolve
${workspaceRoot}
and${workspaceFolder}
for the values provided to thego.alternateTools
setting. Feature Request 2543 implemented with PR 2544
- Resolve
-
- Ensure Go binary is in the PATH when running Go tools. Fixes Bug 2514 with commit d93a0aec
- Use
gotype-live
to provide diagnostics as you type only when the user is not usinggopls
and is not in module mode. This is becausegopls
supports this feature out of the box and the tool doesnt support modules. Fixes Bug 1950 with commit d1bf95c5
This patch release has fixes for the below bugs
- Bug 2469: When the setting
go.autocompleteUnimportedPackages
is enabled, packages show up in completion list when typing.
after a variable or existing package. - Bug 2473: Adding of missing imports and removal of unused imports don't work on saving file after using
gopls
.
This patch release has fixes for the below bugs
- Bug 2459:
gopls
crashes when-trace
is set in thego.languageServerFlags
setting - Bug 2461: Extension uses high CPU due to being stuck in an infinite loop when
go.useLanguageServer
is set totrue
, but no language server can be found - Bug 2458: Reference to GOPATH when dependent tools are missing misleads users to think that they need GOPATH for the extension to work
-
- Add grammar for
go.mod
andgo.sum
files, thus providing syntax highlighting for them. Feature Request 1886 implemented with PR 2344
- Add grammar for
-
- Support
gopls
, the language server from Google as the one from Sourcegraph is no longer under active development. Also becausegopls
supports Go modules. PR 2383. Please read our updated README on language servers for the latest on what we recommend. - Use
goimports
for formatting when using Go modules without the language server becausegoreturns
(the default formatting tool) doesn't work with modules yet. Fixes Bug 2309 - Fix build on save, install and debug features when
GO111MODULE
is set toon
inside the GOPATH. Fixes Bug 2238 with commit 15f571e4
- Support
- Aswin M Prabhu (@aswinmprabhu)
- Refactor commands to extract functions and variables using godoctor. Feature Request 588 implemented with PR 2139
Go: Extract to function
Go: Extract to variable
- Refactor commands to extract functions and variables using godoctor. Feature Request 588 implemented with PR 2139
-
- You can now control whether global variables are shown or not in the variable pane while debugging by tweaking the
showGlobalVariables
property in thego.delveConfig
setting. Feature Request 2323 implemented with PR 2351
- You can now control whether global variables are shown or not in the variable pane while debugging by tweaking the
-
Filippo Valsorda (@FiloSottile) & Vlad Barosan (@vladbarosan)
- Avoid prompts to re-compile Go tools when the
go.toolsGopath
is different between workspaces. PR 1589
- Avoid prompts to re-compile Go tools when the
-
- Avoid moving to the next parameter in the Signature Help feature, when provided parameter value is a string with commas. Fixes Bug 1682 with PR 1738
- Improvements to the README for the debug adapter that provides information on how to debug the debug adapter. PR 2341
- Add module definitions for test fixtures. PR 2306
-
- Fix single quotes uses for JSON examples in setting descriptions. PR 2036
-
- Improve the snippet for anonymous go function. PR 2354
-
Jackson Kearl (@JacksonKearl) & Vlad Barosan (@vladbarosan)
- Use the latest apis for the Outline feature. Feature Request 1772 implemented with PR 1795
-
- Clean up the temporary directory created by the Go extension when VS Code window is closed. Fixes Bug 2188 with commit 4a241f80
- Show the start of on save features in the output panel. Fixes Bug 1869 with commit 058eccf17
- Ignore
GOBIN
when user has setgo.toolsGopath
setting. Fixes Bug 2339 with commit 9f99c30
- When the program being debugged closes naturally, avoid showing the error from delve when trying to halt it. Fixes Bug 2313 with commit fd5a488c2
- Fix regression where benchmarks get run without the -bench flag
-
- Display nested content of structs in variables pane. Fixes Bug 1010 with PR 2198
- Display shadowed variables in variables pane. Fixes Bug 1974 with PR 2254
- Fix the slowness during debugging that got introduced a few releases ago, by caching the package info used to call
ListPackageVars
command in delve. PR 2289
-
Adrian Suwała (@Ashiroq) & * Vlad Barosan (@vladbarosan)
- New command
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 2059
- New command
-
- Fix bug that got introduced in the previous release where only the top call stack frame was shown. Fixes Bug 2187 with PR 2200
- Upstream bug fix in VS Code to avoid the frequent jump to
proc.go
file when stepping in/out during debugging. Fixes microsoft/vscode#65920
-
- Use
LoggingDebugSession
to show logs from the VS Code debug adapter. Feature Request 858 implemented with PR 2081
- Use
-
- Trace levels updated to include
log
which would be the oldverbose
. The newverbose
will include logs from the VS Code debug adapter. - Avoid showing global variables by default as it affects performance. PR 2133
- Trace levels updated to include
-
- Use the new respository link for delve. PR 2277
-
- When no folder is opened in VS Code,
Go to definition
feature now works on individual files. Fixes Bug 2246 with commit 58817b8 - When the main module is opened in VS Code,
Go to definition
feature now works for sub modules as well. Fixes Bug 2180 with PR 2262 - Run the on save features only for current file. This will improve performance when multiple files are being saved at once, for eg: after find replace across files. Fixes Bug 2202 with commit cf0a61c
- Allow disabling of documentation in the auto-completion widget to solve the perf issue due to multiple
go doc
processes being spawned. Fixes Bug 2152 with commit e4522ba1. This is done using the flag-excludeDocs
in thego.gocodeFlags
setting.
- When no folder is opened in VS Code,
-
- Show test coverage even if the test fails. Feature Request 2193 implemented with PR 2263
-
Kaarthik Rao Bekal Radhakrishna (@karthikraobr)
- Avoid invalidating code coverage when updating single line comments. PR 1996
-
- Fix tool descriptions in the dropdown from
Go: Install/Update Tools
command. [PR 2235](https://github.com/ microsoft/vscode-go/pull/2235)
- Fix tool descriptions in the dropdown from
-
Rebecca Stambler (@stamblerre)
- Support modules when
GO111MODULE
is explicitly set inside GOPATH.
- Support modules when
-
- Support Go to Definition feature when using modules even when VS Code is not started from the same path as the project.
- Support Go to Definition feature on a symbol from a file from module cache.
-
- Support setting of variables during debugging in the variable pane. Feature Request 1129 implemented with PR 2076
- Show pointer values during debugging in the variable pane. Feature Request 1989 implemented with PR 2075
- Support the paging feature in stack traces during debugging. Feature Request 946 implemented with PR 2080
- Run without debugging should use current file when the debug configuration points to package and respect the args, buildFlags set in the debug configuration. Fixes Bug 2085 & Bug 2086 with PR 2123
-
Kaarthik Rao Bekal Radhakrishna (@karthikraobr)
- Differentiate structs from interfaces in the outline view. PR 2114
-
- Support the
Go to Type Definition
&Peek to Type Definition
commands. Feature Request 2121 implemented with PR 2136
- Support the
-
- Support documentation in auto-completion widget. Feature Request 194 implemented with PR 2054
-
Kaarthik Rao Bekal Radhakrishna (@karthikraobr)
- Support
Copy Value
,Copy as expression
andAdd to Watch
features in the context menu on the variables pane in the debug viewlet. Feature Request 1990 implemented with PR 2020
- Support
-
go.gopath
&go.toolsGopath
settings now support the use of environment variables using the format${env:XXX}
. Feature Request 1732 implemented with PR 1743
-
- Language Server from Sourcegraph is now supported on Windows as well.
- Fallback to using
nsf/gocode
when using Go version 1.8 or older due to mdempsky/gocode#73 golint
andgogetdoc
are no longer supported in Go version 1.8 or older- Use
go doc
instead ofgodoc
for the showing the documentation when hovering over symbols and the Signature Help widget.
Engineering Updates
-
- Fix failing travis tests
-
- Add more tests for util.ts file
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)
-
- Add option
file
togo.lintOnSave
setting to enable linting just the current file instead of package/workspace on file save. Feature Request 1931 implemented with PR 1965
- Add option
-
- New snippet for
select
statements. PR 2004
- New snippet for
-
- Include out of the box commands for Go to definition, implementation and symbol in the
Go: Show All Commands
feature. Feature Request 1822 implmented with PR 1952
- Include out of the box commands for Go to definition, implementation and symbol in the
-
- Use different icons for structs, interfaces and types. PR 1961
-
ShowerYing (@showerying), Ramya Rao (@ramya-rao-a)
- Remove
godoc
from the list of installable Go tools as it doesnt support CLI mode anymore. Usegodoc
binary which is shipped as part of the Go distribution instead.
- Remove
-
- Include bazel option in
go.gocodePackageLookupMode
setting. Note: This only applies when using nsf/gocode. Latest versions of the Go extension uses mdempsky/gocode by default. PR 1908
- Include bazel option in
-
- Fix the regression introduced in the previous update where the testify suites arent being indentified as tests by the codelens unless
go.gotoSymbol.includeImports
was enabled. - Fix the regression where auto-completions are messed up when multiple packages match with the one being used. Fixes Bug 2011 with commit d789de0f
- Fix the regression introduced in the previous update where the testify suites arent being indentified as tests by the codelens unless
Documentation Updates
Engineering Updates
-
- Fix failing tests with PR 2016
-
Nguyen Long Nhat (@torn4dom4n)
- Replace the use of deprecated
$workspaceRoot
with$workspaceFolder
. PR 1977
- Replace the use of deprecated
-
- Fix the bug where code coverage is not displayed when using Go modules. Bug 1927
- Fix the bug where file paths in the test output are not clickable when using Go modules. Bug 1973
- Dont display the
Analysis Tools Missing
warning for the forks ofgodef
andgocode
. 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)
- Use of forks for the tools
godef
andgocode
to provideGo to definition
andAuto-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.
- Use of forks for the tools
-
Bianca Rosa de Mendonça (@biancarosa)
- New commands
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 1899
- New commands
-
- New setting
go.generateTestsFlags
to provide flags for thegotests
tool when generating tests. PR 1841
- New setting
-
Johan Lejdung (@johan-lejdung)
- New setting
go.testTags
to be used for running tests. This way, you can use the existinggo.buildTags
for compiling and a different set of tags for running tests. Feature Request 1842 implemented with PR 1877
- New setting
-
- Fix accessibility issues with the
Analysis Tools Missing
button in the status bar. PR 1922
- Fix accessibility issues with the
-
- Improve snippets for
iferr
andforr
i.e "if err ..." the "for range". Feature Request 1920 implemented with PR 1924
- Improve snippets for
-
- Use random port instead of hard-coded 2345 when running delve. Fixes Bug 1906
- Fix issue where tests using the check package cannot be run using the
Go: Test File
command. Bug 1911 - Disable module support when installing the Go tools. Fixes Bug 1919
- Use version 2 of delve apis by default instead of version 1. Replace existing
useApiV1
setting/configuration withapiVersion
. Feature Request 1876 - Prompt to update
gogetdoc
andgopkgs
if using Go modules. - Disable
go.inferGopath
in workspace settings when using Go modules automatically. - Add support for the below features when using Go modules
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 files- Auto-completion of unimported packages when
go.autocompleteUnimportedPackages
setting is enabled.
- Show package variables and not just local variables in the debug viewlet when debugging. Feature Request 1854 implemented with PR 1865
- Fix issue with anti virus scans blocking download of the Go plugin due to a dependency. Bug 1871
- Fix broken code coverage feature in Windows in Go 1.11 as the cover profile no longer uses backward slashes. Bug 1847
- Update existing Go tools when Go version or goroot changes, instead of the checkbox UI where user has to select the tools to update.
- Extension host crashing with SIGPIPE error on machines that do not have the Go tools that the extension depends on instead of graceful error handling. Bug 1845
- Build fails on unix machines if user doesnt have entry in the /etc/passwd file. Bug 1850
- Avoid repeating gopath when the inferred gopath is the same as env gopath
-
- Introducing a new mode for debugging called
auto
. In this mode, the debugging sessions will run intest
mode automatically if the current active file is a test file. Otherwise this defaults to the usualdebug
mode. Feature Request 1780
- Introducing a new mode for debugging called
-
- Errors from delve api calls are now shown in the debug console when
"showLog": true
is added to the debug configuration. PR 1815.
- Errors from delve api calls are now shown in the debug console when
-
- Fix bug when debugging a program that runs in a loop forever is not stopped when the stop button is clicked. Bug 1814
- Fix bug when a previous failed debugging session due to compile errors results in failure of future sessions after fixing the compile error. Bug 1840
- The environment variables in
go.toolsEnvVars
setting which gets used by all Go tools in this extension will now be passed todlv
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 1839
-
- The
go.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.
- The
-
- Fix error handling when the error returned by the process that runs formatting is not a string. PR 1828
-
- New command
Go: Add Package to Workspace
that will add selected imported package to the current workspace. Feature Request 1733 implemented with PR 1745
- New command
-
Marwan Sulaiman (@marwan-at-work)
- When suggesting unimported custom packages, show the ones form current workspace before the others. PR 1782
-
- Fix error with
Go: Generate Interface Stubs
command when using on an interface that is defined inside an "internal" folder.Bug 1769 - Fix bug where auto-completions dont show built-in types. Bug 1739
- Look at GOROOT before PATH when looking for the Go binary. Fixes Bug 1760 which was a regression.
- Clean up the debug binary that gets generated by delve at the end of the debugging session. Bug 1345
- Fix error with
-
- Support to run tests that use the test suites from stretchr/testify suite using codelens. PR 1707
-
- New setting
go.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 1749
- New setting
-
- Option to install/update selected tools required by the Go extension. Feature Request 1731
-
- Support for Conditional Breakpoints when debugging. Feature Request 1720 implemented with PR 1721
- Fix the watch feature in the debug panel that got introduced in the previous update. Fixes Bug 1714 with PR 1718
-
- New setting
go.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:- Map
go
togoapp
when using App Engine Go - Map
gometalinter
togometalinter.v2
if you want to use the stable version of the tool
- Map
- New setting
-
- Support the new outline feature which is in preview. Bug 1725
- Close
gocode
before updating and show appropriate message when failed to do so.
-
- Status bar item to cancel running tests. Feature Request 1047 implemented with PR 1218
-
- Fix the regression in the code coverage where the coverage doesnt get applied/removed as expected. Fixes Bug 1716 and Bug 1717 with commit abe97240
-
- Use debug configuration to choose to use version 2 of delve apis when debugging. Feature Request 1555 implemented with PR 1647. This enables you to set configuration to increase the size of arrays and strings that are watchable during debugging which fixes Bug 868
-
- Support the use of
golangci-lint
as a linter. Feature Request 1693 implemented with PR 1693
- Support the use of
-
Minko Gechev (@mgechev) and Mark Wolfe (@wolfeidau)
- Support the use of
revive
as a linter. Feature Request 1697 implemented with PR 1699, PR 1703 and commit d31636
- Support the use of
-
- Customize the colors used in highlighting covered/uncovered code or the gutter styles used to indicated covered/uncovered code using the setting
go.coverageDecorator
. Feature Request 1302 implemented with PR 1695.
- Customize the colors used in highlighting covered/uncovered code or the gutter styles used to indicated covered/uncovered code using the setting
-
- Include exported member name in completions when starting a comment above it. Use Ctrl+Space to trigger completions inside comments. Feature Request 1005 implemented with PR 1675 and PR 1706
-
Frederik Ring (@m90), Ramya Rao (@ramya-rao-a)
- Get code completion and formatting features when using language server. Use the new setting
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
- Get code completion and formatting features when using language server. Use the new setting
-
- Resolve
~
,${workspaceRoot}
,${workspaceFolder}
in thego.testFlags
setting. Feature Request 928 - Ensure
Go: Add Import
shows up the list of imports ASAP. Fixes Feature Request 1450 - Prompt user to install missing tool when they change either of
go.formatTool
,go.lintTool
orgo.docsTool
setting to a tool that they dont have installed yet. - Pass the environment variables in the
go.toolsEnvVars
setting to the process that runs the language server. - Include the GOPATH from environment variable in the inferred GOPATH when
go.inferGopath
setting is enabled. Feature Request 1525
- Resolve
-
- Fix code coverage when code is covered by multiple tests. Bug 1683.
-
- Fix the improper usage of Cancellation Tokens that resulted in lint/vet processes getting cancelled. PR 1704
-
- Support
Go to Definition
feature when the entire symbol is selected with cursor at the end. Fixes Bug 891.
- Support
-
- New setting
go.installDependenciesWhenBuilding
to control whether the-i
flag is passed togo build
/go test
when compiling. Feature Request 1464 - Use GOROOT from
go env
if not set as environment variable explicitly. - Fix bug where the output pane keeps showing up when using language server. Bug 1662
- Show rename errors in the output channel. Fixes Bug 1663
- New setting
-
- Fixed regression bug where environment variables set in
go.toolsEnvVars
arent being used. PR 1665
- Fixed regression bug where environment variables set in
-
- Expand function snippet for function types in auto-completions. Feature Request 1553 and PR 1560
-
- New setting
go.gotoSymbol.includeGoroot
. If enabled, the symbols from the standard library are included when doing a workspace symbol search using theGo to Symbol in Workspace
command. Feature Request 1567 and PR 1604
- New setting
-
- New setting
go.coverOnSingleTest
. If enabled, code coverage will be shown in the editor when running individual tests. Feature Request 1637 and PR 1638
- New setting
-
- Use the right icons for completion items of type
const
,package
,type
andvar
. PR 1624
- Use the right icons for completion items of type
-
- Package name suggestion should be
main
in a test file if the folder contains amain.go
. PR 1630
- Package name suggestion should be
-
- Non string values for environment variables are now allowed in settings like
go.testEnvVars
andgo.toolsEnvVars
. Bug 1608 - Support the
Go to Implementation
andPeek Implmentation
commands when using the Go Language Server. Feature Request 1611 - Fix automatic imports of packages when there is a comment in the end of the import block. Bug 1606
- Fix automatic imports of packages when package alias starts with any keyword in the import block. Bug 1618
- Non string values for environment variables are now allowed in settings like
-
- Configure the
output
option of delve in debug configuration.The location provided here is where delve will output the binary it then uses for debugging. PR 1564
- Configure the
-
- Codelens to debug benchmarks. PR 1566
-
- Show build errors at the right column in a line instead of showing them at the start of the line by using columns numbers returned from
go build
. PR 1573
- Show build errors at the right column in a line instead of showing them at the start of the line by using columns numbers returned from
-
- Make links in test output clickable when it fails due to build errors. Feature Request 1562
- Enable
Go to Implementation
to work both ways. Feature Request 1536
-
- Include comments from struct definitions when showing the definitions on hover. PR 1559
-
- Use
go vet
instead ofgo tool vet
from Go 1.10 onwards as the latter now supports all vet flags. PR 1576
- Use
-
- Add option to never show the warning on editing generated files. PR 1537
-
- Show warning when go binary is not found during build. PR 1543
-
- Fix bug where debug codelens would debug all tests that match the current test name. PR 1561
-
- Fix bug where internal packages are allowed to be imported when their path is substring of current package. PR 1535
-
- New command
Go: Fill Struct
integrates thefillstruct
tool that lets you fill struct fields with default values. PR 1506
- New command
-
- Show key value pairs of map variables correctly in the variable pane when debugging. Fixes Bug 1384
-
- Fix the issue of various features not working with Go 1.10 due to regex failure on fetching the version. PR 1523
-
Kevin Wiesmüller @kwiesmueller
- Generating Unit Tests will not open a new editor for generated/updated test file if the file is already open and visible in another editor group. PR 1517
-
- Notify user when
gopkgs
fails to get packages that are needed to provide the completions for unimported packages. PR 1528
- Notify user when
-
Anatoly Milkov (@anatolym) and Christian Winther (@jippi)
- Documentation Updates
- Bug 1449: Rename fails due to cgo not being able to find the go executable.
- Bug 1508: Broken Path in Windows when running Go tools
-
- Feature Request 1456: Show build/vet/lint status in status bar instead of opening output pane when run manually
-
- Bug 1470:
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. - Bug 1469: Formatting adds �� in Chinese files some times.
- Bug 1481: Untitled files in empty workspace results in build errors
- Bug 1483: Generating unit tests for a function generates tests for other functions with similar names
- Bug 1470:
- Ramya Rao (@ramya-rao-a)
- Fix the issue that got introduced in the previous release, where formatter reverts changes unless
goreturns
is updated. Fixes Bug 1447 ~
,$workspaceRoot
and$workspaceFolder
are now supported in thego.goroot
setting
- Fix the issue that got introduced in the previous release, where formatter reverts changes unless
- Ben Wood @(benclarkwood)
-
- Setting
go.inferGopath
will now infer the correct GOPATH even in the below 2 cases which wasnt supported before- When a Go file is opened in VS Code directly without opening any workspace.
- When GOPATH itself is directly opened in VS Code. Fixes Bug 1213
- Use byte offset when calling
gocode
to fix issue with code completion when there are unicode characters in the file. Fixes Bug 1431 - Add descriptions to the contributed snippets. These descriptions will appear in auto-completion and when using the
Insert Snippet
command - Fix "maxBufferExceeded" error by using
spawn
instead ofexec
when running formatters. - Use the new
onDebugResolve
activation event instead ofonDebug
to avoid activating the Go extension when other type of debug sessions are started
- Setting
-
- Fixed the upstream issue with
goreturns
: PR sqs/goreturns#42. This in turn fixes Bug 613 and Bug 630
- Fixed the upstream issue with
-
- Show a warning when user edits a generated file. Feature Request 1295 via PR 1425
- Avihay Kain (@grooveygr)
- Snippets for methods on types during auto-completion. Feature Request 168. PR 1368
- Matt Brandt (@Matt007)
- Debug configuration snippet for remote debugging. PR 1365
- Ramya Rao (@ramya-rao-a)
- Prompt to recompile dependent Go tools when GOROOT changes. Feature Request 1286
- Support for
${workspaceFolder}
in the below settingsgo.gopath
go.toolsGopath
go.testEnvVars
go.testEnvFile
- The
Analysis Tools Missing
message has bee updated to only appear for the tools backing basic features of the extension - Skip showing linting/vetting errors on a line that has build errors. Feature Request 600
- Fix the issue of slow linters resulting in stale problem markers in updated file. Bug 1404
- Deprecate
go.formatOnSave
setting in favor ofeditor.formatOnSave
. To disable formatting on save, add the below setting:This fixes the below issues"[go]": { "editor.formatOnSave": false }
-
New commands
- Frederik Ring (@m90)
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 #1211- Use the setting
go.playground
to control whether to run and/or share a link to the playground and/or open the playground in the browser.
- Use the setting
- Robin Bartholdson @buyology
Go: Benchmark Function At Cursor
and Codelens for running benchmarks in test files. PR 1303. Feature Request #972
- Andrew Nee (@ndrewnee)
Go: Lint Current Package
andGo: Lint Workpsace
to lint using the tool specified in thego.lintTool
setting and the flags specified in thego.lintFlags
setting. PR 1258. Feature Request #1041
- Ramya Rao (@ramya-rao-a)
Go: Vet Current Package
andGo: Vet Workpsace
to vet using the flags specified in thego.vetFlags
setting. Feature Request #1041Go: Build Current Package
andGo: Build Workpsace
to build using the flags specified in thego.buildFlags
setting and build tags specified in the settinggo.buildTags
. Feature Request #287Go: Install Current Package
to install the current package using the flags specified in thego.buildFlags
setting and build tags specified in the settinggo.buildTags
. Feature Request #287
- Frederik Ring (@m90)
-
Completion Improvements
- wangkechun (@wangkechun)
- Completions for standard packages are now shown before custom packages when providing completions for unimported packages. PR 1309
- Ramya Rao (@ramya-rao-a)
gocode
can now use gb specific rules when providing completions. Set the new settinggo.gocodePackageLookupMode
togb
to use this feature. Feature Request #547
- wangkechun (@wangkechun)
-
Performance improvements
- Ramya Rao (@ramya-rao-a)
- The
autobuild
feature ofgocode
which is known to slow completions is now disabled by default. Fixes Bug 1323- Since we use the
-i
flag when building, we do not rely onautobuild
feature ofgocode
to ensure fresh results from dependencies. - If you have disabled the
buildOnSave
setting, then use the newGo: Build Current Package
command once in a while to ensure the dependencies are up to date or enable thego.gocodeAutoBuild
setting.
- Since we use the
- In Go 1.9 and higher, running the vet feature in the absence of vet flags will be faster due to the use of
go vet ./...
instead ofgo tool vet -flags
. Fixes Bug 1215 - Performance issues caused by a large number of lingering processes for vet/lint/hover features are now solved.
- Measures are now in place to kill older processes before starting new ones for vet/lint feature. Fixes Bug 1265
- For other features like hover/outline/definition etc. the cancellation token provided by the core is used to kill processes if the corresponding request from the core is cancelled. Fixes Bug 667
- The
- Ramya Rao (@ramya-rao-a)
-
Others
- Phil Kates (@philk)
- David Marby (@DMarby)
- Fix delve connection issues when verbose build flag is set. PR 1354
- Jan Koehnlein @JanKoehnlein
- Ramya Rao (@ramya-rao-a)
- Apply/Clear coverage in active editors of all editor groups rather than just the first one. Fixes Bug 1343
- Fix the issue of codelens for references showing "0 references" when
guru
fails to provide references. Fixes Bug 1336 - Support multiple buildtags in the
go.buildTags
setting. Fixes [Bug 1355]microsoft/vscode-go#1355).
-
- Do not show suggestions from internal packages of other projects. Fixes Bug 1256.
-
- Snippet for Example functions. PR 1281
Multi Root support when using VS Code Insiders
We now have Multi Root support for Go. PR 1221 Please note:
- The settings at Folder level takes precedence over the ones at the Workspace level which in turn take precedence over the ones at the User level
- You can have the different roots in the multi-root mode use different GOPATHs. The experimental language server feature is not supported in such cases though.
- All current Go related features that refer to "workspace" will refer to the individual roots in the multi root mode. For example: Build/lint/vet/test workspace or
Go to Symbol in workspace
. - Give it a try and log any issues that you find in the vscode-go repo
- Nuruddin Ashr (@uudashr)
- Auto-completion for unimported packages that are newly installed/built will now show up without the need for reloading VS Code.
- Completions from sub vendor packages that were showing up are ignored now. Fixes Bug 1251
- The
package
snippet completion is now smarter when suggesting package names. PR 1220. It suggestsmain
when current file ismain.go
or there exists amain.go
file in current folder- The folder name when the current file is
internal_test.go
- The folder name with
_test
when current file is a test file - If the folder name in above cases has
-
or.
, then what appears after the-
or.
is suggested.
- Alexander Kohler (@alexkohler)
- A new setting
go.useCodeSnippetsOnFunctionSuggestWithoutType
is introduced. This allows completions of functions with their parameter signature but without the parameter types. Feature Request 1241
- A new setting
- Miklós @kmikiy
- 3 New snippets for the
Log
methods from thetesting
package
- 3 New snippets for the
- zhouhaibing089 (@zhouhaibing089)
- Running and debugging tests for packages in symlinked folders is now possible. PR 1164
- Katsuma Ito (@ka2n)
- The Debug Test codelens now uses the buildTags and buildFlags correctly. PR 1248
- Chase Adams (@chaseadamsio)
- You can now run tests from unsaved files. Fixes Bug 1225
- Ramya Rao (@ramya-rao-a)
- Changes done to coverage options and decorators in settings now apply immediately without the need for moving to another file and back. Fixes Bug 1171
- The Run Test and Debug Test codelens react to change in the codelens setting immediately without the need for moving to another file and back. Fixes Bug 1172
$workspaceRoot
will now be resolved when part ofgo.testEnvVars
andgo.toolsEnvVars
setting.
- Nuruddin Ashr (@uudashr)
Go: Browse Packages
command will now include newly installed/built packages without the need for reloading VS Code.
- Hugo (@juicemia)
- A new command
Go: Get Package
is introduced to rungo get
on the package in the import statement under the cursor. PR 1222
- A new command
- Bug #1152: Auto completions for unimported packages do not work anymore on certain machines. PR 1197
- Bug #1194 and Bug #1196: Debugger doesnt use GOPATH from env in debug configuration
- Go to implementation cmd doesnt show up when using the language server.
- Dan Mace (@ironcladlou), Vincent Chinedu Okonkwo (@codmajik) & Dima (@hummerd)
- Support for the
Go To Implementation
command on interfaces. Feature Request #771.
- Support for the
- Craig-Stone (@Craig-Stone)
- Normalize program path in Windows which otherwise prevented breakpoints from being set correctly when remote debugging. PR 1131
- Marwan Sulaiman (@marwan-at-work)
- Refactor the code behind
Go: Browse Packages
to make browsing selected package faster. PR 1136
- Refactor the code behind
- Thomas Darimont (@thomasdarimont)
- A new snippet called
helloweb
that generates a web app with an http endpoint returning a greeting and current time. PR 1113
- A new snippet called
- Nuruddin Ashr (@uudashr)
- Refactor the way test output is shown to show output of
log.Println
. Fixes Issue #1120 with PR 1124
- Refactor the way test output is shown to show output of
- Ramya Rao (@ramya-rao-a)
- Test Improvements
- Show test coverage after the command
Go: Test Package
is run. You can disable this by settinggo.coverOnTestPackage
tofalse
. - Show test coverage even if files are outside of GOPATH. Fixes Issue #1122
- Decouple running test coverage on save from running build/lint/test on save. Fixes the issue where the problems view was not getting updated until
go.coverOnSave
was disabled.
- Show test coverage after the command
- Debugging Improvements
- No need to set GOPATH in debug configuration in the
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. - The debug code lens will now honor the
go.buildFlags
,go.buildTags
andgo.testFlags
settings. Fixes Issue #1117 - Fix issue with stepping over standard library code when remote debugging in Windows. Fixes Issue #1178
- No need to set GOPATH in debug configuration in the
- Other Bug Fixes
- Fix the extra text being selected at the end of formatting run on save. Fixes Issue #899 and Issue #1096.
gometalinter
anddlv
will honor thego.toolsGopath
setting. Fixes Issue #1110- Skip vendor folders from lint and vet results. Fixes Issue #1119 and Issue #1121
- Test Improvements
- Ian Chiles (@fortytw2)
- Option to use megacheck as a linting tool which
can have significantly better performance than
gometalinter
, while only supporting a subset of the tools. Use the settinggo.lintTool
to try this.
- Option to use megacheck as a linting tool which
can have significantly better performance than
- alexandrevez (@alexandrevez)
- Option to highlight gutters rather than full text for code coverage. Use the new setting
go.coverageDecorator
to try this.
- Option to highlight gutters rather than full text for code coverage. Use the new setting
- Ramya Rao (@ramya-rao-a) & Marwan Sulaiman (@marwan-at-work)
- Browse packages and go files with new command
Go: Browse Packages
. Feature Request 330- If cursor is on an import statement, then files from the imported package will be shown in the quick pick control
- Else, all packages are shown in the quick pick control. Select any and corresponding Go files will be shown next.
- Selecting any of the Go files, will open the file in a new editor.
- Browse packages and go files with new command
- Saud Khan (@bidrohi)
- Print import paths of Go tools as they get installed. PR 1032
- Ramya Rao (@ramya-rao-a)
- Prompt to update dependent Go tools when there is a change in the Go version. Feature Request 797
- Better user experience when dependent Go tools are missing. Feature Request 998
- Prompts will only show up for tools that are used for features that are explicitly executed by the user. Eg: Rename, Generate Unit Tests, Modify tags. And not for features that get triggered behind the scenes like linting, hover or format on save.
- When the prompts do show up, closing them will ensure that they wont show up for the duration of the current session of VS Code.
- llife0915 (@llife0915)
- Fix for issue when unverified breakpoints appeear when creating/deleting breakpoints once debugging starts in Windows.
- Roman Peshkov (@rpeshkov)
- Expand file names to file paths in test output for subtests. Bug 1049
- Guilherme Oenning (@goenning)
- Pass GOPATH to debug adapter when debugging tests via codelens. Bug 1057
- Nuruddin Ashr (@uudashr)
- Skip testing vendor folders when using the command
Go: Test all Packages in Workspace
- Skip testing vendor folders when using the command
- Ramya Rao (@ramya-rao-a)
- Start without debugging should fallback to debug mode when configured program is not a file. Bug 1084
- Fix for incorrect package name during autocomplete of unimported packages when package name is not the same as the last part of the import path. Bug 647
- Skip building vendor folders when
go.buildOnSave
is set toworkspace
. Bug 1060 - Honor
go.buildTags
when usinggogetdoc
. Bug 1024 - Fix build failure when
-i
is passed as a build flag. Bug 1064 - Fix vet failure when any flag is passed. Bug 1073
- Better formatting in import blocks when imports get added during auto-completion or when
Go: Add Import
command is used. Bug 1056 Go: Generate Interface Stubs
should work when interface is prefixed with package path
- Jamie Stackhouse (@itsjamie)
- Guilherme Oenning (@goenning)
- New setting
go.testEnvFile
to configure the location of a file that would have environment variables to use while running tests. PR 971- File contents should be of the form
key=value
. - Values from the existing setting
go.test.EnvVars
will override the above - These environment variables will also be used by the "Debug Test" codelens
- When debugging using the debug viewlet or pressing
F5
, the above will not be used. Continue to use theenv
and/orenvFile
property in the debug configurations in thelaunch.json
file.
- File contents should be of the form
- New setting
- Ole (@vapourismo)
- You can now run build/lint/vet on the whole workspace instead of just the current package on file save. PR 1023
- To enable this, the settings
go.buildOnSave
,go.lintOnSave
andgo.vetOnSave
now take valuespackage
,workspace
oroff
instead of the previoustrue
/false
. - These features are backward compatible and so if you are still using
true
/false
for these settings, they will work as they did before, but you will get a warning in your settings file.
- To enable this, the settings
- You can now run build/lint/vet on the whole workspace instead of just the current package on file save. PR 1023
- Ramya Rao (@ramya-rao-a)
- Better build performance when working on main packages and test files by using the
-i
flag. - Better linting experience while running
gometalinter
by using the--aggregate
flag which aggregates similar errors from multiple linters.
- Better build performance when working on main packages and test files by using the
- Ramya Rao (@ramya-rao-a)
- Fix for Bug 968 where rename fails if
---
is anywhere in the file - Fix for Bug 981 where
Go: Test Function At Cursor
fails. - Fix for Bug 983 where the Go binary is not found in MSYS2 as it is not located in GOROOT.
- Fix for Bug 1022 where snippets from function auto complete do not insert the placeholders
- Fix for Bug 962 where references codelens wouldn't work for methods.
- Fix for Bug 968 where rename fails if
- F0zi (@f0zi)
- Fix for Bug 1009 where remote debugging fails to verify breakpoint if GOPATH partially matches remote GOPATH
- Anton Kryukov (@Emreu)
- Use the
go.testEnvVars
while debugging tests using codelens
- Use the
- Ramya Rao (@ramya-rao-a)
- Fix for Bug 963 Fix for perf issues when references codelens is enabled. Commit 352435a
- Fix for Bug 964 The setting
go.referencesCodeLens.enabled
is deprecated in favor ofgo.enableCodeLens
to control multiple types of codelens."go.enableCodeLens": { "references": false, "runtest": true }
- theSoenke (@theSoenke)
- Feature Request 726: Display Reference count above functions using codelens. On clicking, the references are shown just like the
Find All References
command. PR 933 and PR 938. You can disable this by updating the settinggo.referencesCodeLens.enabled
.
- Feature Request 726: Display Reference count above functions using codelens. On clicking, the references are shown just like the
- Guilherme Oenning (@goenning)
- Use Codelens to run each test function, tests in the file and tests in the package. PR 937
- Ramya Rao (@ramya-rao-a)
- Feature Request 879: Use Codelens to debug a test function. Commit 5b1ced7
- Thomas Bradford (@kode4food)
- New setting
go.coverageOptions
to control whether you want to highlight only covered code or only uncovered code or both when code coverage is run. PR 945
- New setting
- Ramya Rao (@ramya-rao-a)
- The command
Go: Test Coverage In Current Package
is renamed toGo: Toggle Test Coverage In Current Package
and it does exactly what the name suggests. Toggles test coverage. Commit cc661daf
- The command
- Ramya Rao (@ramya-rao-a)
- Fix for Bug 529 Code completion for unimported packages now works on unsaved file after deleting imports.
- Fix for Bug 922 Go to Symbol in File feature now includes symbols from unsaved file contents. PR 929
- Fix for Bug 878 Debugging now works on current file even when there is no folder/workspace open. Commit 42646afc
- Fix for Bug 947 Mac users using the latest delve from master may see that all env variables are empty while debugging their code. This is due to delve using the
--backend=lldb
option in Mac by default. You can now change this default value by setting thebackend
property tonative
in thelaunch.json
file. Commit 4beecf1. Root cause is expected to be fixed in delve itself and is being tracked in derekparker/delve/818
- Tyler Bunnell (@tylerb)
- Guilherme Oenning (@goenning)
- Luka Zakrajšek (@bancek) and Ramya Rao (@ramya-rao-a)
- New setting
go.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.
- New setting
- Paweł Słomka (@slomek)
- New snippet for writing table driven tests. PR 952
-
- Add live error feedback using
gotype-live
which isgotype
with support for unsaved file contents. PR 903- New setting
go.liveErrors
controls this feature. - Set
"go.liveErrors": { "enabled": true }
to enable this feature - Edit the delay property in
"go.liveErrors": { "enabled": true, "delay": 500 }
to update the delay (in milliseconds) after whichgotype-live
would be run post a keystroke
- New setting
- Add live error feedback using
-
- GOPATH from settings is now honored when users debug current file without having a
launch.json
file. PR 904- Note: Once you have a
launch.json
file, GOPATH from settings wont be read. You will need to set it in theenv
property as before
- Note: Once you have a
- GOPATH from settings is now honored when users debug current file without having a
-
--config
flag forgometalinter
now supports the use of${workspaceRoot}
and~
that allows users to provide config file path relative to workspace or home directory respectively. PR 909- New command
Go: 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
- Ramya Rao (@ramya-rao-a)
- Use gomodifytags to add/remove tags on selected struct fields. PR 880
- If there is no selection, then the whole struct under the cursor will be selected for the tag modification.
Go: Add Tags
command adds tags configured ingo.addTags
setting to selected struct fields. By default,json
tags are added. Examples:- To add
xml
tags, setgo.addTags
to{"tags": "xml"}
- To add
xml
withcdata
option, setgo.addTags
to{"tags": "xml", "options": "xml=cdata"}
- To add both
json
andxml
tags, setgo.addTags
to{"tags": "json,xml"}
- To add
Go: Remove Tags
command removes tags configured ingo.removeTags
setting from selected struct fields.- By default, all tags are removed.
- To remove only say
xml
tags, setgo.removeTags
to{"tags": "xml"}
- To be prompted for tags instead of using the configured ones, set
go.addTags
and/orgo.removeTags
to{"promptForTags": true}
- Fix rename issue when
diff
tool from Git or Cygwin are in thePATH
in Windows. PR 866 - Keywords are now supported in completion suggestions. PR 865
- Suggestion items to import packages disabled in single line import statements and the line with package definition where they do not make sense. PR 860
- Use gomodifytags to add/remove tags on selected struct fields. PR 880
- Ramya Rao (@ramya-rao-a)
- Support to build and run your Go file. PR 881
- Press
Ctrl+F5
or run the commandDebug: Start Without Debugging
to run using the currently selected launch configuration. - If you don't have a
launch.json
file, then the current file will be run. - Supported only for launch configs with
type
asdebug
andprogram
that points to a Go file and not package
- Press
- New
envFile
attribute inlaunch.json
where you can provide a file with env variables to use while debugging. PR 849 - Use current file's directory instead of folder opened in VS Code to debug in the default configurations. Commit 0915e50a
- Support to build and run your Go file. PR 881
- Ramya Rao (@ramya-rao-a)
- New Setting
go.languageServerFlags
that will be passed while running the Go language server. PR 882- Set this to
["trace"]
to see the traces from the language server in the output pane under the channel "go-langserver" - Set this to
["trace", "logfile", "path to a text file to log the trace]
to log the traces and errors from the language server to a file.
- Set this to
Go: Install Tools
command now installs delve as well in Linux and Windows, but not in Mac OSX. Commit 30ea096 Fixes Bug 874
- New Setting
- netroby @netroby
Go: Install Tools
command now installsgodoc
. PR 854
- Ramya Rao (@ramya-rao-a)
- Use
GOPATH
as defined by thego env
output as default. Usego
binary from default platform specific locations when GOROOT is not set as env variable. Fixes Bug 873 - Fix compiling errors for vendor packages in case of symlinks. PR 864
- Support links in the test output, which then navigates the user to the right line of the test file where tests are failing. PR 885
- Experimental new setting
go.editorContextMenuCommands
to control which commands show up in the editor context menu.
- Use
- Albert Callarisa (@acroca) and Ramya Rao (@ramya-rao-a)
- New setting
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 795
- New setting
- Re-publishing the extension from a non Windows machine as the fix for Bug 438 worked only on Windows machines. For details read the discussion in PR 838.
- Ramya Rao (@ramya-rao-a) and Sourcegraph
- A new setting
go.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 750- This is an experimental feature and is not available in Windows yet.
- If set to true, you will be prompted to install the Go language server. Once installed, you will have to reload VS Code window. The language server will then be run by the Go extension in the background to provide services needed for the above mentioned features.
- A new setting
- Ramya Rao (@ramya-rao-a)
- Vincent Chinedu Okonkwo (@codmajik)
- Added new setting
go.inferGopath
. Whentrue
GOPATH will be inferred from the path of the folder opened in VS Code. This will override the value fromgo.gopath
setting as well as the GOPATH environment variable. PR 762
- Added new setting
- Ramya Rao (@ramya-rao-a)
- Debug current file without a launch configuration file. Simply press
F5
to start the debug session. Alaunch.json
is still required to debug tests or for advanced debug configurations. PR 769 - Launch configuration snippets are now available for common scenarios like debugging file/package or debugging a test package/function.
These snippets can be used through IntelliSense when editing the
launch.json
file. PR 794 - Fix for Bug 492. Now when there are build errors, starting a debug session will display the error instead of hanging. PR 774
- Debug current file without a launch configuration file. Simply press
- Rob Lourens (@roblourens)
- Suraj Barkale (@surajbarkale-dolby)
- F0zi (@f0zi)
- Oleg Bulatov (@dmage)
- Added new setting
go.testOnSave
. Whentrue
, 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
- Added new setting
- Jeff Willette (@deltaskelta)
- Test output is no longer verbose by default. Add
-v
to thego.testFlags
to get verbose output. PR 817
- Test output is no longer verbose by default. Add
- Richard Musiol (@neelance)
- Fix offset for files with multibyte characters so that features like Hover and Go To Definition work as expected. PR 780
- Ramya Rao (@ramya-rao-a)
- Sam Herrmann (@samherrmann), Ramya Rao (@ramya-rao-a)
- A new setting
go.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.- This is useful when you work on different GOPATHs.
- Remember to run
Go: Install Tools
command to install the tools to the new location.
- A new setting
- Ramya Rao (@ramya-rao-a)
- All the "Install tool" options (the pop ups you see) and the
Go: Install Tools
command now supportgometalinter
if it is your chosen linting tool. PR 735.- Since
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 ingo.toolsGopath
- Since
- All the "Install tool" options (the pop ups you see) and the
- Matt Aimonetti (@mattetti)
- While building, we now use the
-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 718
- While building, we now use the
- Ramya Rao (@ramya-rao-a)
- Build errors with no line numbers (for eg. Import cycle) are now displayed in the output window and will be mapped to the first line of the file. PR 740
- Ramya Rao (@ramya-rao-a)
-
A 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 bego.test.package
,go.test.file
orgo.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 commandsGo: Open Test File
andGo: 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
-
- Marcel Voigt (@nochso)
- Show error message in output window when running test coverage fails. PR 721
- Andreas Kuhn (@ankon)
- Honor the
cwd
launch configuration argument. PR 714
- Honor the
- Ramya Rao (@ramya-rao-a)
- GOPATH set in the
env
property inlaunch.json
will also be used to finddlv
tool. PR 725.
- GOPATH set in the
- Rob Lourens (@roblourens)
- New property
trace
inlaunch.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.
- New property
- Yuwei Ba (@ibigbug)
- Use
http.proxy
setting while installing Go tools. PR 639
- Use
- chronos (@bylevel)
- Ramya Rao (@ramya-rao-a)
- Implement Step Out in debgging Commit 6d0f440
- Improve performance by reducing number of calls to
godoc
,godef
,gogetdoc
. PR 711 - Default value for
go.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.
- Jimmy Kuu (@jimmykuu)
- Remove blank space in the end of code snippet on function suggest. PR 628
- Ahmed W. (@OneofOne)
- Remove the multiple -d flags in formatting. PR 644
- Paweł Kowalak (@viru)
- Snippet for Benchmark Test function. PR 648
- Alberto García Hierro (@fiam)
- Fix Go To Definition, Hover and Signature Help when using Go from tip. PR 655
- Cedric Lamoriniere (@cedriclam)
- Fix Generate Test for Current function when the function is a method on a type. PR 657
- Potter Dai (@PotterDai)
- Fix Find all References when using multiple GOPATH where one is the substring of the other. PR 658
- Ramya Rao (@ramya-rao-a)
- lixiaohui (@leaxoy), Arnaud Barisain-Monrose (@abarisain), Zac Bergquist (@zmb3) and Ramya Rao (@ramya-rao-a)
- Added option to use
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 bugs- #440 Hover info does not show doc string for structs
- #442 Goto Definition, Hover, Signature Help do not work for
net
package - #496 Goto Definition, Hover, Signature Help do not work for Dot imported functions
- #515 Go to definition and type info doesn't work with mux.Vars or anything else from gorilla/mux
- #567 Signature Help and Quick Info do not show function comments for unexported functions
- Added option to use
- Ramya Rao (@ramya-rao-a)
- Ramya Rao (@ramya-rao-a)
- Revert the deprecation of
go.formatOnSave
due to popular demand.
- Revert the deprecation of
- Mark LaPerriere (@marklap)
- Snippets for method declaration, main and init functions PR 602
- Rob Lourens @roblourens
- launch.json intellisense to include all "mode" values. Fixes #574
- Ramya Rao (@ramya-rao-a)
- Support for
editor.formatOnSave
and deprecatinggo.formatOnSave
PR 578 - Remove deprecated language configuration settings PR 587
- Feature Request 432: Commands to switch to test file and back. PR 590. You can add your own shortcuts for these commands.
Go: Open Test File
Go: Open Implementation for Test File
- Navigate to test file after generating unit tests using the
Go: Generate unit tests ...
commands. PR 610 - Prompt to set GOPATH if not set already PR 591
- Improvements to auto complete
- #389 Fix issue with autocomplete popping up at the end of a string PR 586
- #598 Importable packages in auto complete should appear after rest of the suggestions. PR 603
- #598 Importing vendored packages from other Go projects should not be allowed. PR 605
- #598 When there is an identifier with same name as an available package, do not show the package in the compeltion list PR 608
- Other Bug Fixes
- Support for
- Rob Lourens @roblourens
- Fix the regression in debugging PR #576
- Ramya Rao(@ramya-rao-a)
- Preserve focus in editor when running tests PR #577
- Ramya Rao(@ramya-rao-a)
- Rob Lourens @roblourens
- Use random port number while debugging PR #553
- Ludwig Valda Vasquez (@bredov)
- New configuration
go.formatFlags
to pass flags to the formatting tool PR #461
- New configuration
- Dan Mace (@ironcladlou
- Cedric Lamoriniere (@cedriclam)
- New commands to generate unit test skeletons using
gotests
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
- New commands to generate unit test skeletons using
- Ramya Rao (@ramya-rao-a)
- New configuration
go.testEnVars
to pass environment variables to Go tests PR #498 - Changes made to GOROOT and GOPATH via settings now take effect immediately without requiring to reload/restart VS Code PR #458
- Go extension ready to use after installing tools without requiring to reload/restart VS Code PR #457
- Enable Undo after Rename. PR #477. Needs
diff
tool which is not available on Windows by default. You can install it from DiffUtils for Windows - Autocomplete for functions from unimported packages and for unimported packages themselves. To enable this set
go.autocompleteUnimportedPackages
to true. PR #497 - Do not allow to import already imported packages via the
Go: Add Import
command. PR #508 - Suggest
gometalinter
to Go 1.5 users sincegolint
dropped support for Go 1.5 PR #509 - Fix broken installation for
goimports
. PR #470 and PR #509
- New configuration
- Arnaud Barisain-Monrose (@abarisain)
- Fix broken installation for
goreturns
in Windows. PR #463
- Fix broken installation for
- Matt Aimonetti (@mattetti)
- New command to install/update all Go tools that the Go extension needs. The command is
Go: Install Tools
PR #428
- New command to install/update all Go tools that the Go extension needs. The command is
- Ryan Veazey (@ryanz)
- Auto-generated launch.json to have
showLog:true
. PR #412
- Auto-generated launch.json to have
- Arnaud Barisain-Monrose (@abarisain)
- Updates to Extra Info feature: Documentation from
godoc
now appears on hover PR #424
- Updates to Extra Info feature: Documentation from
- Sajjad Hashemian (@sijad)
- Option to choose
gometalinter
as tool for linting PR #294
- Option to choose
- Bartosz Wróblewski (@bawr)
- New configuration
showLog
to toggle the debugging output fromdelve
PR #352
- New configuration
- benclarkwood (@benclarkwood)
- Better logging while installing tools PR #375