This repository has been archived by the owner on Jul 15, 2023. It is now read-only.
Releases: microsoft/vscode-go
Releases · microsoft/vscode-go
Codelens to debug benchmarks, ability specify output option for delve and bug fixes
New Features and Enhancements
-
- 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
Bug Fixes
Fill struct fields with default values, show maps correctly when debugging and bug fixes
-
- 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
More bug fixes
* [Bug 1449](https://github.com/Microsoft/vscode-go/issues/1449): Rename fails due to cgo not being able to find the go executable.
* [Bug 1508](https://github.com/Microsoft/vscode-go/issues/1508): Broken Path in Windows when running Go tools
Bug fixes and Bug fixes
-
- 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:
Bug fixes
- 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)
Snippet descriptions in auto-completions, warning when trying to edit generated files and bug fixes
-
- 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
Snippet for methods on types in auto-completions, linting experience improvements and more
- 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 }
Build/vet/lint on demand, perf improvements, run benchmarks and more
-
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]#1355).
Using latest debug apis from VS Code and bug fixes
Multi-root support, Improvements to auto-completions, running/debugging tests and more..
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
Auto-completion improvements
- 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
Improvements around running and debugging tests
- 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.
Improvements around Packages
- 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