You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/settings.md
+31-46
Original file line number
Diff line number
Diff line change
@@ -576,8 +576,19 @@ Default: `package`
576
576
577
577
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.
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
+
579
590
#### `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.
581
592
A map of the names of analysis passes that should be enabled/disabled.
582
593
A full list of analyzers that gopls uses can be found [here](analyzers.md)
583
594
@@ -607,15 +618,15 @@ It is applied to queries like `go list`, which is used when discovering files.
607
618
The most common use is to set `-tags`.
608
619
609
620
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"
612
623
section of settings.md for the list of supported lenses.
613
624
614
625
Example Usage:
615
626
```json5
616
627
"gopls": {
617
628
...
618
-
"codelens": {
629
+
"codelenses": {
619
630
"generate":false, // Don't show the `go generate` lens.
620
631
"gc_details":true// Show a code lens toggling the display of gc's choices.
621
632
}
@@ -624,10 +635,6 @@ Example Usage:
624
635
```
625
636
626
637
627
-
#### `completeUnimported`
628
-
(Experimental) completeUnimported enables completion for packages that you do not currently import.
629
-
630
-
631
638
#### `completionBudget`
632
639
(For Debugging) completionBudget is the soft latency goal for completion requests. Most
633
640
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
636
643
results. Zero means unlimited.
637
644
638
645
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.
645
653
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
-
funcmain() {
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`
664
658
665
659
666
660
#### `env`
@@ -710,7 +704,7 @@ SingleLine and Structured are intended for use only by authors of editor plugins
710
704
711
705
712
706
#### `importShortcut`
713
-
(Experimental) importShortcut specifies whether import statements should link to
707
+
importShortcut specifies whether import statements should link to
714
708
documentation or go to definitions.
715
709
716
710
@@ -725,7 +719,7 @@ If company chooses to use its own `godoc.org`, its address can be used as well.
725
719
726
720
727
721
#### `linksInHover`
728
-
(Experimental) linksInHover toggles the presence of links to documentation in hover.
722
+
linksInHover toggles the presence of links to documentation in hover.
729
723
730
724
731
725
#### `local`
@@ -734,7 +728,7 @@ It should be the prefix of the import path whose imports should be grouped separ
734
728
735
729
736
730
#### `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.
738
732
739
733
740
734
#### `semanticTokens`
@@ -747,11 +741,11 @@ semantic tokens to the client.
747
741
748
742
749
743
#### `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.
751
745
752
746
753
747
#### `symbolStyle`
754
-
(Experimental) symbolStyle controls how symbols are qualified in symbol responses.
748
+
symbolStyle controls how symbols are qualified in symbol responses.
755
749
756
750
Example Usage:
757
751
```json5
@@ -763,19 +757,10 @@ Example Usage:
763
757
```
764
758
765
759
766
-
#### `tempModfile`
767
-
(Experimental) tempModfile controls the use of the -modfile flag in Go 1.14.
768
-
769
-
770
760
#### `usePlaceholders`
771
761
placeholders enables placeholders for function parameters or struct fields in completion responses.
Copy file name to clipboardExpand all lines: package.json
+46-58
Original file line number
Diff line number
Diff line change
@@ -2124,13 +2124,13 @@
2124
2124
},
2125
2125
"analyses": {
2126
2126
"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",
2128
2128
"default": {},
2129
2129
"scope": "resource"
2130
2130
},
2131
-
"codelens": {
2131
+
"codelenses": {
2132
2132
"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",
2134
2134
"default": {
2135
2135
"gc_details": false,
2136
2136
"generate": true,
@@ -2141,27 +2141,31 @@
2141
2141
},
2142
2142
"scope": "resource"
2143
2143
},
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": {
2151
2145
"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",
2153
2147
"default": true,
2154
2148
"scope": "resource"
2155
2149
},
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",
2160
2164
"scope": "resource"
2161
2165
},
2162
2166
"matcher": {
2163
2167
"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",
2165
2169
"enum": [
2166
2170
"CaseInsensitive",
2167
2171
"CaseSensitive",
@@ -2175,21 +2179,9 @@
2175
2179
"default": "Fuzzy",
2176
2180
"scope": "resource"
2177
2181
},
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
-
},
2190
2182
"symbolMatcher": {
2191
2183
"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",
2193
2185
"enum": [
2194
2186
"CaseInsensitive",
2195
2187
"CaseSensitive",
@@ -2205,7 +2197,7 @@
2205
2197
},
2206
2198
"symbolStyle": {
2207
2199
"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",
2209
2201
"enum": [
2210
2202
"Dynamic",
2211
2203
"Full",
@@ -2216,40 +2208,24 @@
2216
2208
"`\"Full\"` is fully qualified symbols, i.e.\n\"path/to/pkg.Foo.Field\".\n",
2217
2209
"`\"Package\"` is package qualified symbols i.e.\n\"pkg.Foo.Field\".\n"
2218
2210
],
2219
-
"default": "Package",
2211
+
"default": "Dynamic",
2220
2212
"scope": "resource"
2221
2213
},
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": [],
2232
2218
"scope": "resource"
2233
2219
},
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": {},
2248
2224
"scope": "resource"
2249
2225
},
2250
-
"verboseWorkDoneProgress": {
2226
+
"staticcheck": {
2251
2227
"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",
2253
2229
"default": false,
2254
2230
"scope": "resource"
2255
2231
},
@@ -2274,7 +2250,7 @@
2274
2250
"experimentalDiagnosticsDelay": {
2275
2251
"type": "string",
2276
2252
"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",
2278
2254
"scope": "resource"
2279
2255
},
2280
2256
"experimentalPackageCacheKey": {
@@ -2283,6 +2259,18 @@
2283
2259
"default": true,
2284
2260
"scope": "resource"
2285
2261
},
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",
0 commit comments