Skip to content

Commit 30087b8

Browse files
committed
[release] package.json: update gopls settings
Using gopls v0.7.4 Updates #1930 Change-Id: I73fa85df9532c22b177177c5310baa1d4d4fe486 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/370878 Trust: Hyang-Ah Hana Kim <[email protected]> Run-TryBot: Hyang-Ah Hana Kim <[email protected]> Trust: Peter Weinberger <[email protected]> Reviewed-by: Robert Findley <[email protected]> TryBot-Result: kokoro <[email protected]> (cherry picked from commit f5e6bec) Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/372334
1 parent 50aee73 commit 30087b8

File tree

2 files changed

+16
-17
lines changed

2 files changed

+16
-17
lines changed

docs/settings.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -573,13 +573,6 @@ comprehensively test.
573573

574574

575575
Default: `true`
576-
### `build.experimentalTemplateSupport`
577-
578-
(Experimental) experimentalTemplateSupport opts into the experimental support
579-
for template files.
580-
581-
582-
Default: `false`
583576
### `build.experimentalUseInvalidMetadata`
584577

585578
(Experimental) experimentalUseInvalidMetadata enables gopls to fall back on outdated
@@ -612,6 +605,12 @@ References and Rename will miss results in such packages.
612605

613606

614607
Default: `"Normal"`
608+
### `build.templateExtensions`
609+
610+
templateExtensions gives the extensions of file names that are treateed
611+
as template files. (The extension
612+
is the part of the file name after the final dot.)
613+
615614
### `formatting.gofumpt`
616615

617616
gofumpt indicates if we should run gofumpt formatting.
@@ -720,11 +719,11 @@ Example Usage:
720719
| `deepequalerrors` | check for calls of reflect.DeepEqual on error values <br/> The deepequalerrors checker looks for calls of the form: <br/> reflect.DeepEqual(err1, err2) <br/> where err1 and err2 are errors. Using reflect.DeepEqual to compare errors is discouraged. <br/> Default: `true` |
721720
| `errorsas` | report passing non-pointer or non-error values to errors.As <br/> The errorsas analysis reports calls to errors.As where the type of the second argument is not a pointer to a type implementing error. <br/> Default: `true` |
722721
| `fieldalignment` | find structs that would use less memory if their fields were sorted <br/> This analyzer find structs that can be rearranged to use less memory, and provides a suggested edit with the optimal order. <br/> Note that there are two different diagnostics reported. One checks struct size, and the other reports "pointer bytes" used. Pointer bytes is how many bytes of the object that the garbage collector has to potentially scan for pointers, for example: <br/> <pre>struct { uint32; string }</pre><br/> have 16 pointer bytes because the garbage collector has to scan up through the string's inner pointer. <br/> <pre>struct { string; *uint32 }</pre><br/> has 24 pointer bytes because it has to scan further through the *uint32. <br/> <pre>struct { string; uint32 }</pre><br/> has 8 because it can stop immediately after the string pointer. <br/> <br/> Default: `false` |
723-
| `fillreturns` | suggested fixes for "wrong number of return values (want %d, got %d)" <br/> This checker provides suggested fixes for type errors of the type "wrong number of return values (want %d, got %d)". For example: <pre>func m() (int, string, *bool, error) {<br/> return<br/>}</pre>will turn into <pre>func m() (int, string, *bool, error) {<br/> return 0, "", nil, nil<br/>}</pre><br/> This functionality is similar to https://github.com/sqs/goreturns. <br/> <br/> Default: `true` |
722+
| `fillreturns` | suggest fixes for errors due to an incorrect number of return values <br/> This checker provides suggested fixes for type errors of the type "wrong number of return values (want %d, got %d)". For example: <pre>func m() (int, string, *bool, error) {<br/> return<br/>}</pre>will turn into <pre>func m() (int, string, *bool, error) {<br/> return 0, "", nil, nil<br/>}</pre><br/> This functionality is similar to https://github.com/sqs/goreturns. <br/> <br/> Default: `true` |
724723
| `fillstruct` | note incomplete struct initializations <br/> This analyzer provides diagnostics for any struct literals that do not have any fields initialized. Because the suggested fix for this analysis is expensive to compute, callers should compute it separately, using the SuggestedFix function below. <br/> <br/> Default: `true` |
725724
| `httpresponse` | check for mistakes using HTTP responses <br/> A common mistake when using the net/http package is to defer a function call to close the http.Response Body before checking the error that determines whether the response is valid: <br/> <pre>resp, err := http.Head(url)<br/>defer resp.Body.Close()<br/>if err != nil {<br/> log.Fatal(err)<br/>}<br/>// (defer statement belongs here)</pre><br/> This checker helps uncover latent nil dereference bugs by reporting a diagnostic for such mistakes. <br/> Default: `true` |
726725
| `ifaceassert` | detect impossible interface-to-interface type assertions <br/> This checker flags type assertions v.(T) and corresponding type-switch cases in which the static type V of v is an interface that cannot possibly implement the target interface T. This occurs when V and T contain methods with the same name but different signatures. Example: <br/> <pre>var v interface {<br/> Read()<br/>}<br/>_ = v.(io.Reader)</pre><br/> The Read method in v has a different signature than the Read method in io.Reader, so this assertion cannot succeed. <br/> <br/> Default: `true` |
727-
| `infertypeargs` | check for unnecessary type arguments in call expressions <br/> Explicit type arguments may be omitted from call expressions if they can be inferred from function arguments, or from other type arguments: <br/> func f[T any](T) {} <br/> func _() { <pre>f[string]("foo") // string could be inferred</pre>} <br/> <br/> Default: `true` |
726+
| `infertypeargs` | check for unnecessary type arguments in call expressions <br/> Explicit type arguments may be omitted from call expressions if they can be inferred from function arguments, or from other type arguments: <br/> <pre>func f[T any](T) {}<br/><br/><br/>func _() {<br/> f[string]("foo") // string could be inferred<br/>}</pre><br/> <br/> Default: `true` |
728727
| `loopclosure` | check references to loop variables from within nested functions <br/> This analyzer checks for references to loop variables from within a function literal inside the loop body. It checks only instances where the function literal is called in a defer or go statement that is the last statement in the loop body, as otherwise we would need whole program analysis. <br/> For example: <br/> <pre>for i, v := range s {<br/> go func() {<br/> println(i, v) // not what you might expect<br/> }()<br/>}</pre><br/> See: https://golang.org/doc/go_faq.html#closures_and_goroutines <br/> Default: `true` |
729728
| `lostcancel` | check cancel func returned by context.WithCancel is called <br/> The cancellation function returned by context.WithCancel, WithTimeout, and WithDeadline must be called or the new context will remain live until its parent context is cancelled. (The background context is never cancelled.) <br/> Default: `true` |
730729
| `nilfunc` | check for useless comparisons between functions and nil <br/> A useless comparison is one like f == nil as opposed to f() == nil. <br/> Default: `true` |

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1999,12 +1999,6 @@
19991999
"default": true,
20002000
"scope": "resource"
20012001
},
2002-
"build.experimentalTemplateSupport": {
2003-
"type": "boolean",
2004-
"markdownDescription": "(Experimental) experimentalTemplateSupport opts into the experimental support\nfor template files.\n",
2005-
"default": false,
2006-
"scope": "resource"
2007-
},
20082002
"build.experimentalUseInvalidMetadata": {
20092003
"type": "boolean",
20102004
"markdownDescription": "(Experimental) experimentalUseInvalidMetadata enables gopls to fall back on outdated\npackage metadata to provide editor features if the go command fails to\nload packages for some reason (like an invalid go.mod file). This will\neventually be the default behavior, and this setting will be removed.\n",
@@ -2031,6 +2025,12 @@
20312025
"default": "Normal",
20322026
"scope": "resource"
20332027
},
2028+
"build.templateExtensions": {
2029+
"type": "array",
2030+
"markdownDescription": "templateExtensions gives the extensions of file names that are treateed\nas template files. (The extension\nis the part of the file name after the final dot.)\n",
2031+
"default": "[\"tmpl\",\"gotmpl\"]",
2032+
"scope": "resource"
2033+
},
20342034
"formatting.gofumpt": {
20352035
"type": "boolean",
20362036
"markdownDescription": "gofumpt indicates if we should run gofumpt formatting.\n",
@@ -2186,7 +2186,7 @@
21862186
},
21872187
"fillreturns": {
21882188
"type": "boolean",
2189-
"markdownDescription": "suggested fixes for \"wrong number of return values (want %d, got %d)\"\n\nThis checker provides suggested fixes for type errors of the\ntype \"wrong number of return values (want %d, got %d)\". For example:\n\tfunc m() (int, string, *bool, error) {\n\t\treturn\n\t}\nwill turn into\n\tfunc m() (int, string, *bool, error) {\n\t\treturn 0, \"\", nil, nil\n\t}\n\nThis functionality is similar to https://github.com/sqs/goreturns.\n",
2189+
"markdownDescription": "suggest fixes for errors due to an incorrect number of return values\n\nThis checker provides suggested fixes for type errors of the\ntype \"wrong number of return values (want %d, got %d)\". For example:\n\tfunc m() (int, string, *bool, error) {\n\t\treturn\n\t}\nwill turn into\n\tfunc m() (int, string, *bool, error) {\n\t\treturn 0, \"\", nil, nil\n\t}\n\nThis functionality is similar to https://github.com/sqs/goreturns.\n",
21902190
"default": true
21912191
},
21922192
"fillstruct": {
@@ -2206,7 +2206,7 @@
22062206
},
22072207
"infertypeargs": {
22082208
"type": "boolean",
2209-
"markdownDescription": "check for unnecessary type arguments in call expressions\n\nExplicit type arguments may be omitted from call expressions if they can be\ninferred from function arguments, or from other type arguments:\n\nfunc f[T any](T) {}\n\nfunc _() {\n\tf[string](\"foo\") // string could be inferred\n}\n",
2209+
"markdownDescription": "check for unnecessary type arguments in call expressions\n\nExplicit type arguments may be omitted from call expressions if they can be\ninferred from function arguments, or from other type arguments:\n\n\tfunc f[T any](T) {}\n\t\n\tfunc _() {\n\t\tf[string](\"foo\") // string could be inferred\n\t}\n",
22102210
"default": true
22112211
},
22122212
"loopclosure": {

0 commit comments

Comments
 (0)