Releases: microsoft/vscode-go
Bug fixes
- 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
Workarounds for upstream electron issue
Due to an upstream issue with newer version of electron that was shipped with VS Code 1.26.0 recently, some users might see an SIGPIPE
error instead of graceful error handling of the absence of certain Go tools. This release attempts to work around this issue by trying to catch such cases earlier and prompting the user to install the missing tool.
Upstream Issue in VS Code: microsoft/vscode#56301
Upstream Issue in Electron: electron/electron#13254 and electron/electron#13679
Debugging improvements and bug fixes
Debugging improvements
-
- 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.
Others
-
- 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
Add imported package to workspace, fix for perf issues with linters and outline view, and more bug fixes
-
- 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
Run tests that use stretchr/testify via codelens, and option to install/update selected dependent Go tools
-
- 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
Conditional Breakpoints when debugging and configure alternate tools to be used by the Go extension
-
- 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.
Cancel long running tests, use mdempsky/gocode instead of nsf/gocode and bug fix on code coverage
-
- 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
Support for v2 apis from delve, new linters, customizable colors in code coverage and more!
Features
-
- 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
Bug Fixes
Smarter snippets in auto-completions for functions and bug fixes
-
- 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
lukehoban.Go is now ms-vscode.Go!
The Go extension is now published under the official Microsoft VS Code publisher id. You will now find it as ms-vscode.Go
instead of the previous lukehoban.Go
in the Marketplace
Features and Bug Fixes in this update:
-
- New setting
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