Skip to content

Commit bc9cd15

Browse files
adonovangopherbot
authored andcommitted
gopls/internal/settings: remove MemoryMode option
It has had no effect for some time. Fixes golang/go#46902 Change-Id: I429121614a00210cc1053d2031eeb994de18e02c Reviewed-on: https://go-review.googlesource.com/c/tools/+/548739 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Robert Findley <[email protected]> Auto-Submit: Alan Donovan <[email protected]>
1 parent bbc30f1 commit bc9cd15

File tree

4 files changed

+10
-46
lines changed

4 files changed

+10
-46
lines changed

gopls/doc/settings.md

+3-13
Original file line numberDiff line numberDiff line change
@@ -85,23 +85,13 @@ is the part of the file name after the final dot.)
8585

8686
Default: `[]`.
8787

88-
#### **memoryMode** *enum*
88+
#### **memoryMode** *string*
8989

9090
**This setting is experimental and may be deleted.**
9191

92-
memoryMode controls the tradeoff `gopls` makes between memory usage and
93-
correctness.
92+
obsolete, no effect
9493

95-
Values other than `Normal` are untested and may break in surprising ways.
96-
97-
Must be one of:
98-
99-
* `"DegradeClosed"`: In DegradeClosed mode, `gopls` will collect less information about
100-
packages without open files. As a result, features like Find
101-
References and Rename will miss results in such packages.
102-
* `"Normal"`
103-
104-
Default: `"Normal"`.
94+
Default: `""`.
10595

10696
#### **expandWorkspaceToModule** *bool*
10797

gopls/internal/settings/api_json.go

+4-11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gopls/internal/settings/default.go

-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ func DefaultOptions(overrides ...func(*Options)) *Options {
6262
UserOptions: UserOptions{
6363
BuildOptions: BuildOptions{
6464
ExpandWorkspaceToModule: true,
65-
MemoryMode: ModeNormal,
6665
DirectoryFilters: []string{"-**/node_modules"},
6766
TemplateExtensions: []string{},
6867
StandaloneTags: []string{"ignore"},

gopls/internal/settings/settings.go

+3-21
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,8 @@ type BuildOptions struct {
175175
// is the part of the file name after the final dot.)
176176
TemplateExtensions []string
177177

178-
// MemoryMode controls the tradeoff `gopls` makes between memory usage and
179-
// correctness.
180-
//
181-
// Values other than `Normal` are untested and may break in surprising ways.
182-
MemoryMode MemoryMode `status:"experimental"`
178+
// obsolete, no effect
179+
MemoryMode string `status:"experimental"`
183180

184181
// ExpandWorkspaceToModule instructs `gopls` to adjust the scope of the
185182
// workspace to find the best available module root. `gopls` first looks for
@@ -661,16 +658,6 @@ const (
661658
Structured HoverKind = "Structured"
662659
)
663660

664-
type MemoryMode string
665-
666-
const (
667-
ModeNormal MemoryMode = "Normal"
668-
// In DegradeClosed mode, `gopls` will collect less information about
669-
// packages without open files. As a result, features like Find
670-
// References and Rename will miss results in such packages.
671-
ModeDegradeClosed MemoryMode = "DegradeClosed"
672-
)
673-
674661
type VulncheckMode string
675662

676663
const (
@@ -941,12 +928,7 @@ func (o *Options) set(name string, value interface{}, seen map[string]struct{})
941928
o.DirectoryFilters = filters
942929

943930
case "memoryMode":
944-
if s, ok := result.asOneOf(
945-
string(ModeNormal),
946-
string(ModeDegradeClosed),
947-
); ok {
948-
o.MemoryMode = MemoryMode(s)
949-
}
931+
result.deprecated("")
950932
case "completionDocumentation":
951933
result.setBool(&o.CompletionDocumentation)
952934
case "usePlaceholders":

0 commit comments

Comments
 (0)