Skip to content

Commit cf03db6

Browse files
committed
package.json: update gopls settings based on gopls v0.6.0
Change-Id: I37bd795a48b597196cbfafb3acd44b7f6f1e3043 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/278355 Trust: Hyang-Ah Hana Kim <[email protected]> Run-TryBot: Hyang-Ah Hana Kim <[email protected]> TryBot-Result: kokoro <[email protected]> Reviewed-by: Rebecca Stambler <[email protected]>
1 parent 1985e90 commit cf03db6

File tree

2 files changed

+77
-104
lines changed

2 files changed

+77
-104
lines changed

docs/settings.md

+31-46
Original file line numberDiff line numberDiff line change
@@ -576,8 +576,19 @@ Default: `package`
576576

577577
Configure the default Go language server ('gopls'). In most cases, configuring this section is unnecessary. See [the documentation](https://github.com/golang/tools/blob/master/gopls/doc/settings.md) for all available settings.
578578

579+
#### `allowImplicitNetworkAccess`
580+
(Experimental) allowImplicitNetworkAccess disables GOPROXY=off, allowing implicit module
581+
downloads rather than requiring user action. This option will eventually
582+
be removed.
583+
584+
585+
#### `allowModfileModifications`
586+
(Experimental) allowModfileModifications disables -mod=readonly, allowing imports from
587+
out-of-scope modules. This option will eventually be removed.
588+
589+
579590
#### `analyses`
580-
(Experimental) analyses specify analyses that the user would like to enable or disable.
591+
analyses specify analyses that the user would like to enable or disable.
581592
A map of the names of analysis passes that should be enabled/disabled.
582593
A full list of analyzers that gopls uses can be found [here](analyzers.md)
583594

@@ -607,15 +618,15 @@ It is applied to queries like `go list`, which is used when discovering files.
607618
The most common use is to set `-tags`.
608619

609620

610-
#### `codelens`
611-
(Experimental) codelens overrides the enabled/disabled state of code lenses. See the "Code Lenses"
621+
#### `codelenses`
622+
codelenses overrides the enabled/disabled state of code lenses. See the "Code Lenses"
612623
section of settings.md for the list of supported lenses.
613624

614625
Example Usage:
615626
```json5
616627
"gopls": {
617628
...
618-
"codelens": {
629+
"codelenses": {
619630
"generate": false, // Don't show the `go generate` lens.
620631
"gc_details": true // Show a code lens toggling the display of gc's choices.
621632
}
@@ -624,10 +635,6 @@ Example Usage:
624635
```
625636

626637

627-
#### `completeUnimported`
628-
(Experimental) completeUnimported enables completion for packages that you do not currently import.
629-
630-
631638
#### `completionBudget`
632639
(For Debugging) completionBudget is the soft latency goal for completion requests. Most
633640
requests finish in a couple milliseconds, but in some cases deep
@@ -636,31 +643,18 @@ dynamically reduce the search scope to ensure we return timely
636643
results. Zero means unlimited.
637644

638645

639-
#### `completionDocumentation`
640-
(Experimental) completionDocumentation enables documentation with completion results.
641-
642-
643-
#### `deepCompletion`
644-
(Experimental) deepCompletion enables the ability to return completions from deep inside relevant entities, rather than just the locally accessible ones.
646+
#### `directoryFilters`
647+
directoryFilters can be used to exclude unwanted directories from the
648+
workspace. By default, all directories are included. Filters are an
649+
operator, `+` to include and `-` to exclude, followed by a path prefix
650+
relative to the workspace folder. They are evaluated in order, and
651+
the last filter that applies to a path controls whether it is included.
652+
The path prefix can be empty, so an initial `-` excludes everything.
645653

646-
Consider this example:
647-
648-
```go
649-
package main
650-
651-
import "fmt"
652-
653-
type wrapString struct {
654-
str string
655-
}
656-
657-
func main() {
658-
x := wrapString{"hello world"}
659-
fmt.Printf(<>)
660-
}
661-
```
662-
663-
At the location of the `<>` in this program, deep completion would suggest the result `x.str`.
654+
Examples:
655+
Exclude node_modules: `-node_modules`
656+
Include only project_a: `-` (exclude everything), `+project_a`
657+
Include only project_a, but not node_modules inside it: `-`, `+project_a`, `-project_a/node_modules`
664658

665659

666660
#### `env`
@@ -710,7 +704,7 @@ SingleLine and Structured are intended for use only by authors of editor plugins
710704

711705

712706
#### `importShortcut`
713-
(Experimental) importShortcut specifies whether import statements should link to
707+
importShortcut specifies whether import statements should link to
714708
documentation or go to definitions.
715709

716710

@@ -725,7 +719,7 @@ If company chooses to use its own `godoc.org`, its address can be used as well.
725719

726720

727721
#### `linksInHover`
728-
(Experimental) linksInHover toggles the presence of links to documentation in hover.
722+
linksInHover toggles the presence of links to documentation in hover.
729723

730724

731725
#### `local`
@@ -734,7 +728,7 @@ It should be the prefix of the import path whose imports should be grouped separ
734728

735729

736730
#### `matcher`
737-
(Experimental) matcher sets the algorithm that is used when calculating completion candidates.
731+
matcher sets the algorithm that is used when calculating completion candidates.
738732

739733

740734
#### `semanticTokens`
@@ -747,11 +741,11 @@ semantic tokens to the client.
747741

748742

749743
#### `symbolMatcher`
750-
(Experimental) symbolMatcher sets the algorithm that is used when finding workspace symbols.
744+
symbolMatcher sets the algorithm that is used when finding workspace symbols.
751745

752746

753747
#### `symbolStyle`
754-
(Experimental) symbolStyle controls how symbols are qualified in symbol responses.
748+
symbolStyle controls how symbols are qualified in symbol responses.
755749

756750
Example Usage:
757751
```json5
@@ -763,19 +757,10 @@ Example Usage:
763757
```
764758

765759

766-
#### `tempModfile`
767-
(Experimental) tempModfile controls the use of the -modfile flag in Go 1.14.
768-
769-
770760
#### `usePlaceholders`
771761
placeholders enables placeholders for function parameters or struct fields in completion responses.
772762

773763

774764
#### `verboseOutput`
775765
(For Debugging) verboseOutput enables additional debug logging.
776766

777-
778-
#### `verboseWorkDoneProgress`
779-
(Experimental) verboseWorkDoneProgress controls whether the LSP server should send
780-
progress reports for all work done outside the scope of an RPC.
781-

package.json

+46-58
Original file line numberDiff line numberDiff line change
@@ -2124,13 +2124,13 @@
21242124
},
21252125
"analyses": {
21262126
"type": "object",
2127-
"markdownDescription": "(Experimental) analyses specify analyses that the user would like to enable or disable.\nA map of the names of analysis passes that should be enabled/disabled.\nA full list of analyzers that gopls uses can be found [here](analyzers.md)\n\nExample Usage:\n```json5\n...\n\"analyses\": {\n \"unreachable\": false, // Disable the unreachable analyzer.\n \"unusedparams\": true // Enable the unusedparams analyzer.\n}\n...\n```\n",
2127+
"markdownDescription": "analyses specify analyses that the user would like to enable or disable.\nA map of the names of analysis passes that should be enabled/disabled.\nA full list of analyzers that gopls uses can be found [here](analyzers.md)\n\nExample Usage:\n```json5\n...\n\"analyses\": {\n \"unreachable\": false, // Disable the unreachable analyzer.\n \"unusedparams\": true // Enable the unusedparams analyzer.\n}\n...\n```\n",
21282128
"default": {},
21292129
"scope": "resource"
21302130
},
2131-
"codelens": {
2131+
"codelenses": {
21322132
"type": "object",
2133-
"markdownDescription": "(Experimental) codelens overrides the enabled/disabled state of code lenses. See the \"Code Lenses\"\nsection of settings.md for the list of supported lenses.\n\nExample Usage:\n```json5\n\"gopls\": {\n...\n \"codelens\": {\n \"generate\": false, // Don't show the `go generate` lens.\n \"gc_details\": true // Show a code lens toggling the display of gc's choices.\n }\n...\n}\n```\n",
2133+
"markdownDescription": "codelenses overrides the enabled/disabled state of code lenses. See the \"Code Lenses\"\nsection of settings.md for the list of supported lenses.\n\nExample Usage:\n```json5\n\"gopls\": {\n...\n \"codelenses\": {\n \"generate\": false, // Don't show the `go generate` lens.\n \"gc_details\": true // Show a code lens toggling the display of gc's choices.\n }\n...\n}\n```\n",
21342134
"default": {
21352135
"gc_details": false,
21362136
"generate": true,
@@ -2141,27 +2141,31 @@
21412141
},
21422142
"scope": "resource"
21432143
},
2144-
"completionDocumentation": {
2145-
"type": "boolean",
2146-
"markdownDescription": "(Experimental) completionDocumentation enables documentation with completion results.\n",
2147-
"default": true,
2148-
"scope": "resource"
2149-
},
2150-
"completeUnimported": {
2144+
"linksInHover": {
21512145
"type": "boolean",
2152-
"markdownDescription": "(Experimental) completeUnimported enables completion for packages that you do not currently import.\n",
2146+
"markdownDescription": "linksInHover toggles the presence of links to documentation in hover.\n",
21532147
"default": true,
21542148
"scope": "resource"
21552149
},
2156-
"deepCompletion": {
2157-
"type": "boolean",
2158-
"markdownDescription": "(Experimental) deepCompletion enables the ability to return completions from deep inside relevant entities, rather than just the locally accessible ones.\n\nConsider this example:\n\n```go\npackage main\n\nimport \"fmt\"\n\ntype wrapString struct {\n str string\n}\n\nfunc main() {\n x := wrapString{\"hello world\"}\n fmt.Printf(<>)\n}\n```\n\nAt the location of the `<>` in this program, deep completion would suggest the result `x.str`.\n",
2159-
"default": true,
2150+
"importShortcut": {
2151+
"type": "string",
2152+
"markdownDescription": "importShortcut specifies whether import statements should link to\ndocumentation or go to definitions.\n",
2153+
"enum": [
2154+
"Both",
2155+
"Definition",
2156+
"Link"
2157+
],
2158+
"markdownEnumDescriptions": [
2159+
"",
2160+
"",
2161+
""
2162+
],
2163+
"default": "Both",
21602164
"scope": "resource"
21612165
},
21622166
"matcher": {
21632167
"type": "string",
2164-
"markdownDescription": "(Experimental) matcher sets the algorithm that is used when calculating completion candidates.\n",
2168+
"markdownDescription": "matcher sets the algorithm that is used when calculating completion candidates.\n",
21652169
"enum": [
21662170
"CaseInsensitive",
21672171
"CaseSensitive",
@@ -2175,21 +2179,9 @@
21752179
"default": "Fuzzy",
21762180
"scope": "resource"
21772181
},
2178-
"annotations": {
2179-
"type": "object",
2180-
"markdownDescription": "(Experimental) annotations suppress various kinds of optimization diagnostics\nthat would be reported by the gc_details command.\n * noNilcheck suppresses display of nilchecks.\n * noEscape suppresses escape choices.\n * noInline suppresses inlining choices.\n * noBounds suppresses bounds checking diagnostics.\n",
2181-
"default": {},
2182-
"scope": "resource"
2183-
},
2184-
"staticcheck": {
2185-
"type": "boolean",
2186-
"markdownDescription": "(Experimental) staticcheck enables additional analyses from staticcheck.io.\n",
2187-
"default": false,
2188-
"scope": "resource"
2189-
},
21902182
"symbolMatcher": {
21912183
"type": "string",
2192-
"markdownDescription": "(Experimental) symbolMatcher sets the algorithm that is used when finding workspace symbols.\n",
2184+
"markdownDescription": "symbolMatcher sets the algorithm that is used when finding workspace symbols.\n",
21932185
"enum": [
21942186
"CaseInsensitive",
21952187
"CaseSensitive",
@@ -2205,7 +2197,7 @@
22052197
},
22062198
"symbolStyle": {
22072199
"type": "string",
2208-
"markdownDescription": "(Experimental) symbolStyle controls how symbols are qualified in symbol responses.\n\nExample Usage:\n```json5\n\"gopls\": {\n...\n \"symbolStyle\": \"dynamic\",\n...\n}\n```\n",
2200+
"markdownDescription": "symbolStyle controls how symbols are qualified in symbol responses.\n\nExample Usage:\n```json5\n\"gopls\": {\n...\n \"symbolStyle\": \"dynamic\",\n...\n}\n```\n",
22092201
"enum": [
22102202
"Dynamic",
22112203
"Full",
@@ -2216,40 +2208,24 @@
22162208
"`\"Full\"` is fully qualified symbols, i.e.\n\"path/to/pkg.Foo.Field\".\n",
22172209
"`\"Package\"` is package qualified symbols i.e.\n\"pkg.Foo.Field\".\n"
22182210
],
2219-
"default": "Package",
2211+
"default": "Dynamic",
22202212
"scope": "resource"
22212213
},
2222-
"linksInHover": {
2223-
"type": "boolean",
2224-
"markdownDescription": "(Experimental) linksInHover toggles the presence of links to documentation in hover.\n",
2225-
"default": true,
2226-
"scope": "resource"
2227-
},
2228-
"tempModfile": {
2229-
"type": "boolean",
2230-
"markdownDescription": "(Experimental) tempModfile controls the use of the -modfile flag in Go 1.14.\n",
2231-
"default": true,
2214+
"directoryFilters": {
2215+
"type": "array",
2216+
"markdownDescription": "directoryFilters can be used to exclude unwanted directories from the\nworkspace. By default, all directories are included. Filters are an\noperator, `+` to include and `-` to exclude, followed by a path prefix\nrelative to the workspace folder. They are evaluated in order, and\nthe last filter that applies to a path controls whether it is included.\nThe path prefix can be empty, so an initial `-` excludes everything.\n\nExamples:\nExclude node_modules: `-node_modules`\nInclude only project_a: `-` (exclude everything), `+project_a`\nInclude only project_a, but not node_modules inside it: `-`, `+project_a`, `-project_a/node_modules`\n",
2217+
"default": [],
22322218
"scope": "resource"
22332219
},
2234-
"importShortcut": {
2235-
"type": "string",
2236-
"markdownDescription": "(Experimental) importShortcut specifies whether import statements should link to\ndocumentation or go to definitions.\n",
2237-
"enum": [
2238-
"Both",
2239-
"Definition",
2240-
"Link"
2241-
],
2242-
"markdownEnumDescriptions": [
2243-
"",
2244-
"",
2245-
""
2246-
],
2247-
"default": "Both",
2220+
"annotations": {
2221+
"type": "object",
2222+
"markdownDescription": "(Experimental) annotations suppress various kinds of optimization diagnostics\nthat would be reported by the gc_details command.\n * noNilcheck suppresses display of nilchecks.\n * noEscape suppresses escape choices.\n * noInline suppresses inlining choices.\n * noBounds suppresses bounds checking diagnostics.\n",
2223+
"default": {},
22482224
"scope": "resource"
22492225
},
2250-
"verboseWorkDoneProgress": {
2226+
"staticcheck": {
22512227
"type": "boolean",
2252-
"markdownDescription": "(Experimental) verboseWorkDoneProgress controls whether the LSP server should send\nprogress reports for all work done outside the scope of an RPC.\n",
2228+
"markdownDescription": "(Experimental) staticcheck enables additional analyses from staticcheck.io.\n",
22532229
"default": false,
22542230
"scope": "resource"
22552231
},
@@ -2274,7 +2250,7 @@
22742250
"experimentalDiagnosticsDelay": {
22752251
"type": "string",
22762252
"markdownDescription": "(Experimental) experimentalDiagnosticsDelay controls the amount of time that gopls waits\nafter the most recent file modification before computing deep diagnostics.\nSimple diagnostics (parsing and type-checking) are always run immediately\non recently modified packages.\n\nThis option must be set to a valid duration string, for example `\"250ms\"`.\n",
2277-
"default": "0s",
2253+
"default": "250ms",
22782254
"scope": "resource"
22792255
},
22802256
"experimentalPackageCacheKey": {
@@ -2283,6 +2259,18 @@
22832259
"default": true,
22842260
"scope": "resource"
22852261
},
2262+
"allowModfileModifications": {
2263+
"type": "boolean",
2264+
"markdownDescription": "(Experimental) allowModfileModifications disables -mod=readonly, allowing imports from\nout-of-scope modules. This option will eventually be removed.\n",
2265+
"default": false,
2266+
"scope": "resource"
2267+
},
2268+
"allowImplicitNetworkAccess": {
2269+
"type": "boolean",
2270+
"markdownDescription": "(Experimental) allowImplicitNetworkAccess disables GOPROXY=off, allowing implicit module\ndownloads rather than requiring user action. This option will eventually\nbe removed.\n",
2271+
"default": false,
2272+
"scope": "resource"
2273+
},
22862274
"verboseOutput": {
22872275
"type": "boolean",
22882276
"markdownDescription": "(For Debugging) verboseOutput enables additional debug logging.\n",

0 commit comments

Comments
 (0)