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
+20-1Lines changed: 20 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -508,8 +508,11 @@ the last filter that applies to a path controls whether it is included.
508
508
The path prefix can be empty, so an initial `-` excludes everything.
509
509
510
510
Examples:
511
+
511
512
Exclude node_modules: `-node_modules`
513
+
512
514
Include only project_a: `-` (exclude everything), `+project_a`
515
+
513
516
Include only project_a, but not node_modules inside it: `-`, `+project_a`, `-project_a/node_modules`
514
517
515
518
### `build.env`
@@ -546,6 +549,22 @@ for multi-module workspaces.
546
549
547
550
548
551
Default: `false`
552
+
### `build.memoryMode`
553
+
554
+
(Experimental) memoryMode controls the tradeoff `gopls` makes between memory usage and
555
+
correctness.
556
+
557
+
Values other than `Normal` are untested and may break in surprising ways.
558
+
<br/>
559
+
Allowed Options:
560
+
561
+
*`DegradeClosed`: `"DegradeClosed"`: In DegradeClosed mode, `gopls` will collect less information about
562
+
packages without open files. As a result, features like Find
563
+
References and Rename will miss results in such packages.
564
+
*`Normal`
565
+
566
+
567
+
Default: `"Normal"`
549
568
### `formatting.gofumpt`
550
569
551
570
gofumpt indicates if we should run gofumpt formatting.
@@ -653,7 +672,7 @@ Example Usage:
653
672
|`copylocks`| check for locks erroneously passed by value <br/> Inadvertently copying a value containing a lock, such as sync.Mutex or sync.WaitGroup, may cause both copies to malfunction. Generally such values should be referred to through a pointer. <br/> Default: `true`|
654
673
|`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`|
655
674
|`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`|
656
-
|`fieldalignment`| find structs that would take less memory if their fields were sorted <br/> This analyzer find structs that can be rearranged to take less memory, and provides a suggested edit with the optimal order. <br/> <br/> Default: `false`|
675
+
|`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`|
657
676
|`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`|
658
677
|`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`|
659
678
|`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`|
Copy file name to clipboardExpand all lines: package.json
+16-2Lines changed: 16 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1802,7 +1802,7 @@
1802
1802
},
1803
1803
"build.directoryFilters": {
1804
1804
"type": "array",
1805
-
"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",
1805
+
"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:\n\nExclude node_modules: `-node_modules`\n\nInclude only project_a: `-` (exclude everything), `+project_a`\n\nInclude only project_a, but not node_modules inside it: `-`, `+project_a`, `-project_a/node_modules`\n",
1806
1806
"scope": "resource"
1807
1807
},
1808
1808
"build.env": {
@@ -1828,6 +1828,20 @@
1828
1828
"default": false,
1829
1829
"scope": "resource"
1830
1830
},
1831
+
"build.memoryMode": {
1832
+
"type": "string",
1833
+
"markdownDescription": "(Experimental) memoryMode controls the tradeoff `gopls` makes between memory usage and\ncorrectness.\n\nValues other than `Normal` are untested and may break in surprising ways.\n",
1834
+
"enum": [
1835
+
"DegradeClosed",
1836
+
"Normal"
1837
+
],
1838
+
"markdownEnumDescriptions": [
1839
+
"`\"DegradeClosed\"`: In DegradeClosed mode, `gopls` will collect less information about\npackages without open files. As a result, features like Find\nReferences and Rename will miss results in such packages.\n",
1840
+
""
1841
+
],
1842
+
"default": "Normal",
1843
+
"scope": "resource"
1844
+
},
1831
1845
"formatting.gofumpt": {
1832
1846
"type": "boolean",
1833
1847
"markdownDescription": "gofumpt indicates if we should run gofumpt formatting.\n",
@@ -1978,7 +1992,7 @@
1978
1992
},
1979
1993
"fieldalignment": {
1980
1994
"type": "boolean",
1981
-
"markdownDescription": "find structs that would take less memory if their fields were sorted\n\nThis analyzer find structs that can be rearranged to take less memory, and provides\na suggested edit with the optimal order.\n",
1995
+
"markdownDescription": "find structs that would use less memory if their fields were sorted\n\nThis analyzer find structs that can be rearranged to use less memory, and provides\na suggested edit with the optimal order.\n\nNote that there are two different diagnostics reported. One checks struct size,\nand the other reports \"pointer bytes\" used. Pointer bytes is how many bytes of the\nobject that the garbage collector has to potentially scan for pointers, for example:\n\n\tstruct { uint32; string }\n\nhave 16 pointer bytes because the garbage collector has to scan up through the string's\ninner pointer.\n\n\tstruct { string; *uint32 }\n\nhas 24 pointer bytes because it has to scan further through the *uint32.\n\n\tstruct { string; uint32 }\n\nhas 8 because it can stop immediately after the string pointer.\n",
0 commit comments