Releases: microsoft/vscode-go
Language server support for modules, debugging improvements and more
Go Modules support improvements
-
- 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
New features
- 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
Debugging improvements
-
- 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
Others
-
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
0.9.2
Release 0.9.2
Pause debugging, add/remove breakpoints while debugging and whole lot of other improvements to the debugging process along with code navigation improvements in module mode
Debugging improvements
-
- 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
Others
-
- 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/
/pull/2235)
- Fix tool descriptions in the dropdown from
Set variables, see pointer values, use paging in stack trace when debugging, improved modules support and more!
Modules
-
- 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.
Debugging
-
- 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
- Run without debugging should
Code Navigation
-
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
Diagnostics
Testing
Others
Docs in auto-completion widget, Language server support in Windows and more!
Features:
-
- 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 By
Fix bug with install/update of Go tools
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)
Hacktoberfest!
-
- 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
Code coverage and few other fixes, when using Go modules
-
- 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.
Auto-completion, Go to definition features when using Go modules, commands to run all benchmarks in file and package, using v2 of delve api by default, and more!
Read our wiki on Go modules in VS Code which tracks the progress of Go modules support.
-
- 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
-
- 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.
Watch package variables when debugging and getting ready for Go 1.11 ....
- 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.