@@ -79,7 +79,7 @@ Default: `false`
79
79
80
80
### ` go.buildFlags `
81
81
82
- Flags to ` go build ` /` go test ` used during build-on-save or running tests. (e.g. [ "-ldflags='-s'"] ) This is propagated to the language server if ` gopls.buildFlags ` is not specified.
82
+ Flags to ` go build ` /` go test ` used during build-on-save or running tests. (e.g. [ "-ldflags='-s'"] ) This is propagated to the language server if ` gopls.build. buildFlags ` is not specified.
83
83
84
84
### ` go.buildOnSave `
85
85
@@ -91,7 +91,7 @@ Default: `package`
91
91
92
92
### ` go.buildTags `
93
93
94
- The Go build tags to use for all commands, that support a ` -tags '...' ` argument. When running tests, go.testTags will be used instead if it was set. This is propagated to the language server if ` gopls.buildFlags ` is not specified.
94
+ The Go build tags to use for all commands, that support a ` -tags '...' ` argument. When running tests, go.testTags will be used instead if it was set. This is propagated to the language server if ` gopls.build. buildFlags ` is not specified.
95
95
96
96
Default: ``
97
97
@@ -576,76 +576,26 @@ 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.
578
578
579
- #### ` allowImplicitNetworkAccess `
579
+ #### ` build. allowImplicitNetworkAccess`
580
580
(Experimental) allowImplicitNetworkAccess disables GOPROXY=off, allowing implicit module
581
581
downloads rather than requiring user action. This option will eventually
582
582
be removed.
583
583
584
584
585
- #### ` allowModfileModifications `
585
+ #### ` build. allowModfileModifications`
586
586
(Experimental) allowModfileModifications disables -mod=readonly, allowing imports from
587
587
out-of-scope modules. This option will eventually be removed.
588
588
589
589
590
- #### ` analyses `
591
- analyses specify analyses that the user would like to enable or disable.
592
- A map of the names of analysis passes that should be enabled/disabled.
593
- A full list of analyzers that gopls uses can be found [ here] ( analyzers.md )
594
-
595
- Example Usage:
596
- ``` json5
597
- ...
598
- " analyses" : {
599
- " unreachable" : false , // Disable the unreachable analyzer.
600
- " unusedparams" : true // Enable the unusedparams analyzer.
601
- }
602
- ...
603
- ```
604
-
605
-
606
- #### ` annotations `
607
- (Experimental) annotations suppress various kinds of optimization diagnostics
608
- that would be reported by the gc_details command.
609
- * noNilcheck suppresses display of nilchecks.
610
- * noEscape suppresses escape choices.
611
- * noInline suppresses inlining choices.
612
- * noBounds suppresses bounds checking diagnostics.
613
-
614
-
615
- #### ` buildFlags `
590
+ #### ` build.buildFlags `
616
591
buildFlags is the set of flags passed on to the build system when invoked.
617
592
It is applied to queries like ` go list ` , which is used when discovering files.
618
593
The most common use is to set ` -tags ` .
619
594
620
595
If unspecified, values of ` go.buildFlags, go.buildTags ` will be propagated.
621
596
622
597
623
- #### ` codelenses `
624
- codelenses overrides the enabled/disabled state of code lenses. See the "Code Lenses"
625
- section of settings.md for the list of supported lenses.
626
-
627
- Example Usage:
628
- ``` json5
629
- " gopls" : {
630
- ...
631
- " codelens" : {
632
- " generate" : false , // Don't show the `go generate` lens.
633
- " gc_details" : true // Show a code lens toggling the display of gc's choices.
634
- }
635
- ...
636
- }
637
- ```
638
-
639
-
640
- #### ` completionBudget `
641
- (For Debugging) completionBudget is the soft latency goal for completion requests. Most
642
- requests finish in a couple milliseconds, but in some cases deep
643
- completions can take much longer. As we use up our budget we
644
- dynamically reduce the search scope to ensure we return timely
645
- results. Zero means unlimited.
646
-
647
-
648
- #### ` directoryFilters `
598
+ #### ` build.directoryFilters `
649
599
directoryFilters can be used to exclude unwanted directories from the
650
600
workspace. By default, all directories are included. Filters are an
651
601
operator, ` + ` to include and ` - ` to exclude, followed by a path prefix
@@ -659,11 +609,11 @@ Include only project_a: `-` (exclude everything), `+project_a`
659
609
Include only project_a, but not node_modules inside it: ` - ` , ` +project_a ` , ` -project_a/node_modules `
660
610
661
611
662
- #### ` env `
612
+ #### ` build. env`
663
613
env adds environment variables to external commands run by ` gopls ` , most notably ` go list ` .
664
614
665
615
666
- #### ` expandWorkspaceToModule `
616
+ #### ` build. expandWorkspaceToModule`
667
617
(Experimental) expandWorkspaceToModule instructs ` gopls ` to adjust the scope of the
668
618
workspace to find the best available module root. ` gopls ` first looks for
669
619
a go.mod file in any parent directory of the workspace folder, expanding
@@ -672,16 +622,7 @@ found, gopls will check if there is exactly one child directory containing
672
622
a go.mod file, narrowing the scope to that directory if it exists.
673
623
674
624
675
- #### ` experimentalDiagnosticsDelay `
676
- (Experimental) experimentalDiagnosticsDelay controls the amount of time that gopls waits
677
- after the most recent file modification before computing deep diagnostics.
678
- Simple diagnostics (parsing and type-checking) are always run immediately
679
- on recently modified packages.
680
-
681
- This option must be set to a valid duration string, for example ` "250ms" ` .
682
-
683
-
684
- #### ` experimentalPackageCacheKey `
625
+ #### ` build.experimentalPackageCacheKey `
685
626
(Experimental) experimentalPackageCacheKey controls whether to use a coarser cache key
686
627
for package type information to increase cache hits. This setting removes
687
628
the user's environment, build flags, and working directory from the cache
@@ -691,65 +632,129 @@ by an experiment because caching behavior is subtle and difficult to
691
632
comprehensively test.
692
633
693
634
694
- #### ` experimentalWorkspaceModule `
635
+ #### ` build. experimentalWorkspaceModule`
695
636
(Experimental) experimentalWorkspaceModule opts a user into the experimental support
696
637
for multi-module workspaces.
697
638
698
639
699
- #### ` gofumpt `
640
+ #### ` formatting. gofumpt`
700
641
gofumpt indicates if we should run gofumpt formatting.
701
642
702
643
703
- #### ` hoverKind `
704
- hoverKind controls the information that appears in the hover text.
705
- SingleLine and Structured are intended for use only by authors of editor plugins.
644
+ #### ` formatting.local `
645
+ local is the equivalent of the ` goimports -local ` flag, which puts
646
+ imports beginning with this string after third-party packages. It should
647
+ be the prefix of the import path whose imports should be grouped
648
+ separately.
706
649
707
650
708
- #### ` importShortcut `
709
- importShortcut specifies whether import statements should link to
710
- documentation or go to definitions.
651
+ #### ` ui.codelenses `
652
+ codelenses overrides the enabled/disabled state of code lenses. See the
653
+ "Code Lenses" section of the
654
+ [ Settings page] ( https://github.com/golang/tools/blob/master/gopls/doc/settings.md )
655
+ for the list of supported lenses.
711
656
657
+ Example Usage:
712
658
713
- #### ` linkTarget `
714
- linkTarget controls where documentation links go.
715
- It might be one of:
659
+ ``` json5
660
+ " gopls" : {
661
+ ...
662
+ " codelens" : {
663
+ " generate" : false , // Don't show the `go generate` lens.
664
+ " gc_details" : true // Show a code lens toggling the display of gc's choices.
665
+ }
666
+ ...
667
+ }
668
+ ```
716
669
717
- * ` "godoc.org" `
718
- * ` "pkg.go.dev" `
719
670
720
- If company chooses to use its own ` godoc.org ` , its address can be used as well.
671
+ #### ` ui.completion.completionBudget `
672
+ (For Debugging) completionBudget is the soft latency goal for completion requests. Most
673
+ requests finish in a couple milliseconds, but in some cases deep
674
+ completions can take much longer. As we use up our budget we
675
+ dynamically reduce the search scope to ensure we return timely
676
+ results. Zero means unlimited.
721
677
722
678
723
- #### ` linksInHover `
724
- linksInHover toggles the presence of links to documentation in hover.
679
+ #### ` ui.completion.matcher `
680
+ (Advanced) matcher sets the algorithm that is used when calculating completion
681
+ candidates.
725
682
726
683
727
- #### ` local `
728
- local is the equivalent of the ` goimports -local ` flag, which puts imports beginning with this string after 3rd-party packages.
729
- It should be the prefix of the import path whose imports should be grouped separately .
684
+ #### ` ui.completion.usePlaceholders `
685
+ placeholders enables placeholders for function parameters or struct
686
+ fields in completion responses .
730
687
731
688
732
- #### ` matcher `
733
- matcher sets the algorithm that is used when calculating completion candidates.
689
+ #### ` ui.diagnostic.analyses `
690
+ analyses specify analyses that the user would like to enable or disable.
691
+ A map of the names of analysis passes that should be enabled/disabled.
692
+ A full list of analyzers that gopls uses can be found
693
+ [ here] ( https://github.com/golang/tools/blob/master/gopls/doc/analyzers.md ) .
734
694
695
+ Example Usage:
735
696
736
- #### ` semanticTokens `
737
- (Experimental) semanticTokens controls whether the LSP server will send
738
- semantic tokens to the client.
697
+ ``` json5
698
+ ...
699
+ " analyses" : {
700
+ " unreachable" : false , // Disable the unreachable analyzer.
701
+ " unusedparams" : true // Enable the unusedparams analyzer.
702
+ }
703
+ ...
704
+ ```
705
+
706
+
707
+ #### ` ui.diagnostic.annotations `
708
+ (Experimental) annotations specifies the various kinds of optimization diagnostics
709
+ that should be reported by the gc_details command.
710
+
711
+
712
+ #### ` ui.diagnostic.experimentalDiagnosticsDelay `
713
+ (Experimental) experimentalDiagnosticsDelay controls the amount of time that gopls waits
714
+ after the most recent file modification before computing deep diagnostics.
715
+ Simple diagnostics (parsing and type-checking) are always run immediately
716
+ on recently modified packages.
717
+
718
+ This option must be set to a valid duration string, for example ` "250ms" ` .
739
719
740
720
741
- #### ` staticcheck `
721
+ #### ` ui.diagnostic. staticcheck`
742
722
(Experimental) staticcheck enables additional analyses from staticcheck.io.
743
723
744
724
745
- #### ` symbolMatcher `
746
- symbolMatcher sets the algorithm that is used when finding workspace symbols.
725
+ #### ` ui.documentation.hoverKind `
726
+ hoverKind controls the information that appears in the hover text.
727
+ SingleLine and Structured are intended for use only by authors of editor plugins.
747
728
748
729
749
- #### ` symbolStyle `
750
- symbolStyle controls how symbols are qualified in symbol responses.
730
+ #### ` ui.documentation.linkTarget `
731
+ linkTarget controls where documentation links go.
732
+ It might be one of:
733
+
734
+ * ` "godoc.org" `
735
+ * ` "pkg.go.dev" `
736
+
737
+ If company chooses to use its own ` godoc.org ` , its address can be used as well.
738
+
739
+
740
+ #### ` ui.documentation.linksInHover `
741
+ linksInHover toggles the presence of links to documentation in hover.
742
+
743
+
744
+ #### ` ui.navigation.importShortcut `
745
+ importShortcut specifies whether import statements should link to
746
+ documentation or go to definitions.
747
+
748
+
749
+ #### ` ui.navigation.symbolMatcher `
750
+ (Advanced) symbolMatcher sets the algorithm that is used when finding workspace symbols.
751
+
752
+
753
+ #### ` ui.navigation.symbolStyle `
754
+ (Advanced) symbolStyle controls how symbols are qualified in symbol responses.
751
755
752
756
Example Usage:
757
+
753
758
``` json5
754
759
" gopls" : {
755
760
...
@@ -759,8 +764,9 @@ Example Usage:
759
764
```
760
765
761
766
762
- #### ` usePlaceholders `
763
- placeholders enables placeholders for function parameters or struct fields in completion responses.
767
+ #### ` ui.semanticTokens `
768
+ (Experimental) semanticTokens controls whether the LSP server will send
769
+ semantic tokens to the client.
764
770
765
771
766
772
#### ` verboseOutput `
0 commit comments