Skip to content

Commit 76241b8

Browse files
committed
fix: resolve conflicts with master branch
2 parents fa778fe + 7ab6cc5 commit 76241b8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+897
-342
lines changed

CHANGELOG.md

+34
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,37 @@
1+
## v0.32.0 - 8 Mar, 2022
2+
3+
This version includes features to enhance Go 1.18 support. It works best when paired with the latest Go Language Server ([`gopls` v0.8.0+](https://github.com/golang/tools/releases/tag/gopls%2Fv0.8.0)) and Delve ([`dlv` v1.8.0+](https://github.com/go-delve/delve/blob/master/CHANGELOG.md#changelog)).
4+
5+
[Go 1.18](https://go.dev/doc/go1.18) introduces substantial changes to [the language spec](https://go.dev/doc/go1.18#generics), so many tools need rebuilding with Go 1.18 or newer. The extension now suggests updates of tools if it finds they were built with old versions of `go` which are inadequate for the version used for the project. If you [opted in for auto-update](https://github.com/golang/vscode-go/blob/master/docs/settings.md#gotoolsmanagementautoupdate), tools will be auto-updated.
6+
7+
In order to use Go 1.18, please follow [the instruction to configure your Visual Studio Code to locate the right go binary](https://github.com/golang/vscode-go/blob/master/docs/advanced.md#using-go118), and run the Go tools using the "Go: Install/Update Tools" command.
8+
9+
A list of all issues and changes can be found in the [v0.32.0 milestone](https://github.com/golang/vscode-go/milestone/42) and [commit history](https://github.com/golang/vscode-go/compare/v0.31.1...v0.32.0).
10+
11+
### Changes
12+
13+
- Starting with Go 1.18, the `go` command provides native support for multi-module workspaces, via [`go.work`](https://go.dev/ref/mod#workspaces) files. The new "Open 'go.work'" option in the Go status bar's quickpick menu allows users to access the corresponding `go.work` file.
14+
![go work short](https://user-images.githubusercontent.com/4999471/157268414-fba63843-5a14-44ba-be82-d42765568856.gif)
15+
16+
- The extension no longer depends on [`gopkgs`](https://github.com/uudashr/gopkgs/cmd/gopkgs). Its use for "Go: Browse Packages" and "Go: Add Import" commands had been replaced with `go list` or commands in `gopls`. ([Issue 258](https://github.com/golang/vscode-go/issues/258))
17+
18+
- The extension uses `gopls` instead of `go-outline` if `gopls` v0.8.0 or newer is used. We plan to complete the replacement work in the next release. ([Issue 1020](https://github.com/golang/vscode-go/issue/1020))
19+
20+
- The new [`"go.toolsManagement.go"` setting](https://github.com/golang/vscode-go/blob/master/docs/settings.md#gotoolsmanagementgo) allows users to specify the Go command for tools installation/updates separate from the Go command used for the project.
21+
22+
- The latest `gopls` requires go 1.13+ for installation, so the extension no longer asks for `gopls` updates when an older versions of `go` is used. ([Issue 2030](https://github.com/golang/vscode-go/issues/2030)) Note `gopls` compiled with go 1.13 or newer can still process projects that use go 1.12. If you want to update `gopls` while working with an older version of Go, utilize the new `"go.toolsManagement.go"` setting.
23+
24+
- Reduced the verbosity of "Go: Locate Configured Go Tools" output.
25+
26+
### Code Health
27+
- Updated to [email protected] (CVE-2021-23566).
28+
- Deflaked debug tests.
29+
- Changed to check `go.dev/dl` instead of `golang.org/dl` for Go release.
30+
- Improved documentation for the default formatting behavior and template support.
31+
32+
### Thanks
33+
@jamalc @suzmue @pavlelee @dekimsey @hyangah
34+
135
## v0.31.1 - 8 Feb, 2022
236

337
A list of all issues and changes can be found in the [v0.31.1 milestone](https://github.com/golang/vscode-go/milestone/44) and [commit history](https://github.com/golang/vscode-go/compare/v0.31.0...v0.31.1).

codereview.cfg

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
issuerepo: golang/vscode-go

docs/commands.md

+8
Original file line numberDiff line numberDiff line change
@@ -242,3 +242,11 @@ Reset keys in workspace state to undefined.
242242
### `Go: Reset Global State`
243243

244244
Reset keys in global state to undefined.
245+
246+
### `Go Explorer: Refresh`
247+
248+
Refresh the Go explorer. Only available as a menu item in the explorer.
249+
250+
### `Go Explorer: Open File`
251+
252+
Open a file from the Go explorer. Only available as a menu item in the explorer.

docs/settings.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ Experimental Feature: Enable/Disable entries from the context menu in the editor
174174
| `fillStruct` | If true, adds command to fill struct literal with default values to the editor context menu <br/> Default: `true` |
175175
| `generateTestForFile` | If true, adds command to generate unit tests for current file to the editor context menu <br/> Default: `true` |
176176
| `generateTestForFunction` | If true, adds command to generate unit tests for function under the cursor to the editor context menu <br/> Default: `true` |
177-
| `generateTestForPackage` | If true, adds command to generate unit tests for currnt package to the editor context menu <br/> Default: `true` |
177+
| `generateTestForPackage` | If true, adds command to generate unit tests for current package to the editor context menu <br/> Default: `true` |
178178
| `playground` | If true, adds command to upload the current file or selection to the Go Playground <br/> Default: `true` |
179179
| `removeTags` | If true, adds command to remove configured tags from struct fields to the editor context menu <br/> Default: `true` |
180180
| `testAtCursor` | If true, adds command to run the test under the cursor to the editor context menu <br/> Default: `false` |
@@ -456,6 +456,11 @@ Allowed Options:
456456

457457

458458
Default: `"proxy"`
459+
### `go.toolsManagement.go`
460+
461+
The path to the `go` binary used to install the Go tools. If it's empty, the same `go` binary chosen for the project will be used for tool installation.
462+
463+
Default: `""`
459464
### `go.trace.server`
460465

461466
Trace the communication between VS Code and the Go language server.<br/>
@@ -743,6 +748,7 @@ Example Usage:
743748
| `stdmethods` | check signature of methods of well-known interfaces <br/> Sometimes a type may be intended to satisfy an interface but may fail to do so because of a mistake in its method signature. For example, the result of this WriteTo method should be (int64, error), not error, to satisfy io.WriterTo: <br/> <pre>type myWriterTo struct{...}</pre> func (myWriterTo) WriteTo(w io.Writer) error { ... } <br/> This check ensures that each method whose name matches one of several well-known interface methods from the standard library has the correct signature for that interface. <br/> Checked method names include: <pre>Format GobEncode GobDecode MarshalJSON MarshalXML<br/>Peek ReadByte ReadFrom ReadRune Scan Seek<br/>UnmarshalJSON UnreadByte UnreadRune WriteByte<br/>WriteTo</pre><br/> <br/> Default: `true` |
744749
| `stringintconv` | check for string(int) conversions <br/> This checker flags conversions of the form string(x) where x is an integer (but not byte or rune) type. Such conversions are discouraged because they return the UTF-8 representation of the Unicode code point x, and not a decimal string representation of x as one might expect. Furthermore, if x denotes an invalid code point, the conversion cannot be statically rejected. <br/> For conversions that intend on using the code point, consider replacing them with string(rune(x)). Otherwise, strconv.Itoa and its equivalents return the string representation of the value in the desired base. <br/> <br/> Default: `true` |
745750
| `structtag` | check that struct field tags conform to reflect.StructTag.Get <br/> Also report certain struct tags (json, xml) used with unexported fields. <br/> Default: `true` |
751+
| `stubmethods` | stub methods analyzer <br/> This analyzer generates method stubs for concrete types in order to implement a target interface <br/> Default: `true` |
746752
| `testinggoroutine` | report calls to (*testing.T).Fatal from goroutines started by a test. <br/> Functions that abruptly terminate a test, such as the Fatal, Fatalf, FailNow, and Skip{,f,Now} methods of *testing.T, must be called from the test goroutine itself. This checker detects calls to these functions that occur within a goroutine started by the test. For example: <br/> func TestFoo(t *testing.T) { go func() { t.Fatal("oops") // error: (*T).Fatal called from non-test goroutine }() } <br/> <br/> Default: `true` |
747753
| `tests` | check for common mistaken usages of tests and examples <br/> The tests checker walks Test, Benchmark and Example functions checking malformed names, wrong signatures and examples documenting non-existent identifiers. <br/> Please see the documentation for package testing in golang.org/pkg/testing for the conventions that are enforced for Tests, Benchmarks, and Examples. <br/> Default: `true` |
748754
| `undeclaredname` | suggested fixes for "undeclared name: <>" <br/> This checker provides suggested fixes for type errors of the type "undeclared name: <>". It will either insert a new statement, such as: <br/> "<> := " <br/> or a new function declaration, such as: <br/> func <>(inferred parameters) { <pre>panic("implement me!")</pre>} <br/> <br/> Default: `true` |
@@ -752,7 +758,7 @@ Example Usage:
752758
| `unusedparams` | check for unused parameters of functions <br/> The unusedparams analyzer checks functions to see if there are any parameters that are not being used. <br/> To reduce false positives it ignores: - methods - parameters that do not have a name or are underscored - functions in test files - functions with empty bodies or those with just a return stmt <br/> Default: `false` |
753759
| `unusedresult` | check for unused results of calls to some functions <br/> Some functions like fmt.Errorf return a result and have no side effects, so it is always a mistake to discard the result. This analyzer reports calls to certain functions in which the result of the call is ignored. <br/> The set of functions may be controlled using flags. <br/> Default: `true` |
754760
| `unusedwrite` | checks for unused writes <br/> The analyzer reports instances of writes to struct fields and arrays that are never read. Specifically, when a struct object or an array is copied, its elements are copied implicitly by the compiler, and any element write to this copy does nothing with the original object. <br/> For example: <br/> <pre>type T struct { x int }<br/>func f(input []T) {<br/> for i, v := range input { // v is a copy<br/> v.x = i // unused write to field x<br/> }<br/>}</pre><br/> Another example is about non-pointer receiver: <br/> <pre>type T struct { x int }<br/>func (t T) f() { // t is a copy<br/> t.x = i // unused write to field x<br/>}</pre><br/> <br/> Default: `false` |
755-
| `useany` | check for constraints that could be simplified to "any" <br/> Default: `true` |
761+
| `useany` | check for constraints that could be simplified to "any" <br/> Default: `false` |
756762
### `ui.diagnostic.annotations`
757763

758764
(Experimental) annotations specifies the various kinds of optimization diagnostics

media/go-logo-white.svg

+1
Loading

package-lock.json

+13-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+63-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "go",
33
"displayName": "Go",
4-
"version": "0.32.0-dev",
4+
"version": "0.33.0-dev",
55
"preview": true,
66
"publisher": "golang",
77
"description": "Rich Go language support for Visual Studio Code",
@@ -61,6 +61,7 @@
6161
"vscode-debugprotocol": "1.45.0",
6262
"vscode-languageclient": "7.0.0",
6363
"vscode-languageserver-protocol": "3.16.0",
64+
"vscode-uri": "3.0.3",
6465
"web-request": "1.0.7"
6566
},
6667
"devDependencies": {
@@ -116,7 +117,8 @@
116117
"go.goroot",
117118
"go.inferGopath",
118119
"go.toolsGopath",
119-
"go.toolsEnvVars"
120+
"go.toolsEnvVars",
121+
"go.toolsManagement.go"
120122
]
121123
}
122124
},
@@ -178,6 +180,11 @@
178180
"scopeName": "go.mod",
179181
"path": "./syntaxes/go.mod.tmGrammar.json"
180182
},
183+
{
184+
"language": "go.work",
185+
"scopeName": "go.mod",
186+
"path": "./syntaxes/go.mod.tmGrammar.json"
187+
},
181188
{
182189
"language": "go.sum",
183190
"scopeName": "go.sum",
@@ -486,6 +493,20 @@
486493
"command": "go.runMain",
487494
"title": "Go: Run main() func on file",
488495
"description": "Run main() func on file"
496+
},
497+
{
498+
"command": "go.explorer.refresh",
499+
"title": "Go Explorer: Refresh",
500+
"description": "Refresh the Go explorer. Only available as a menu item in the explorer.",
501+
"category": "Explorer",
502+
"icon": "$(refresh)"
503+
},
504+
{
505+
"command": "go.explorer.open",
506+
"title": "Go Explorer: Open File",
507+
"description": "Open a file from the Go explorer. Only available as a menu item in the explorer.",
508+
"category": "Explorer",
509+
"icon": "$(go-to-file)"
489510
}
490511
],
491512
"breakpoints": [
@@ -1533,6 +1554,12 @@
15331554
"description": "The logging level the extension logs at, defaults to 'error'",
15341555
"scope": "machine-overridable"
15351556
},
1557+
"go.toolsManagement.go": {
1558+
"type": "string",
1559+
"default": "",
1560+
"description": "The path to the `go` binary used to install the Go tools. If it's empty, the same `go` binary chosen for the project will be used for tool installation.",
1561+
"scope": "machine-overridable"
1562+
},
15361563
"go.toolsManagement.checkForUpdates": {
15371564
"type": "string",
15381565
"default": "proxy",
@@ -1780,7 +1807,7 @@
17801807
"generateTestForPackage": {
17811808
"type": "boolean",
17821809
"default": true,
1783-
"description": "If true, adds command to generate unit tests for currnt package to the editor context menu"
1810+
"description": "If true, adds command to generate unit tests for current package to the editor context menu"
17841811
},
17851812
"addImport": {
17861813
"type": "boolean",
@@ -2336,6 +2363,11 @@
23362363
"markdownDescription": "check that struct field tags conform to reflect.StructTag.Get\n\nAlso report certain struct tags (json, xml) used with unexported fields.",
23372364
"default": true
23382365
},
2366+
"stubmethods": {
2367+
"type": "boolean",
2368+
"markdownDescription": "stub methods analyzer\n\nThis analyzer generates method stubs for concrete types\nin order to implement a target interface",
2369+
"default": true
2370+
},
23392371
"testinggoroutine": {
23402372
"type": "boolean",
23412373
"markdownDescription": "report calls to (*testing.T).Fatal from goroutines started by a test.\n\nFunctions that abruptly terminate a test, such as the Fatal, Fatalf, FailNow, and\nSkip{,f,Now} methods of *testing.T, must be called from the test goroutine itself.\nThis checker detects calls to these functions that occur within a goroutine\nstarted by the test. For example:\n\nfunc TestFoo(t *testing.T) {\n go func() {\n t.Fatal(\"oops\") // error: (*T).Fatal called from non-test goroutine\n }()\n}\n",
@@ -2384,7 +2416,7 @@
23842416
"useany": {
23852417
"type": "boolean",
23862418
"markdownDescription": "check for constraints that could be simplified to \"any\"",
2387-
"default": true
2419+
"default": false
23882420
}
23892421
}
23902422
},
@@ -2548,6 +2580,14 @@
25482580
{
25492581
"command": "go.test.deleteProfile",
25502582
"when": "false"
2583+
},
2584+
{
2585+
"command": "go.explorer.refresh",
2586+
"when": "false"
2587+
},
2588+
{
2589+
"command": "go.explorer.open",
2590+
"when": "false"
25512591
}
25522592
],
25532593
"editor/context": [
@@ -2649,14 +2689,33 @@
26492689
"group": "profile"
26502690
}
26512691
],
2692+
"view/title": [
2693+
{
2694+
"command": "go.explorer.refresh",
2695+
"when": "view == go.explorer",
2696+
"group": "navigation"
2697+
}
2698+
],
26522699
"view/item/context": [
26532700
{
26542701
"command": "go.test.deleteProfile",
26552702
"when": "viewItem == go:test:file"
2703+
},
2704+
{
2705+
"command": "go.explorer.open",
2706+
"when": "view == go.explorer && viewItem == go:explorer:envitem:file",
2707+
"group": "inline"
26562708
}
26572709
]
26582710
},
26592711
"views": {
2712+
"explorer": [
2713+
{
2714+
"id": "go.explorer",
2715+
"name": "go",
2716+
"icon": "media/go-logo-white.svg"
2717+
}
2718+
],
26602719
"test": [
26612720
{
26622721
"id": "go.test.profile",

0 commit comments

Comments
 (0)