Gopher Robot submitted this change.
1 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:
```
The name of the file: gopls/internal/settings/settings.go
Insertions: 1, Deletions: 1.
@@ -928,7 +928,7 @@
o.DirectoryFilters = filters
case "memoryMode":
- // obsolete, no effect
+ result.deprecated("")
case "completionDocumentation":
result.setBool(&o.CompletionDocumentation)
case "usePlaceholders":
```
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 <golang...@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Findley <rfin...@google.com>
Auto-Submit: Alan Donovan <adon...@google.com>
---
M gopls/doc/settings.md
M gopls/internal/settings/api_json.go
M gopls/internal/settings/default.go
M gopls/internal/settings/settings.go
4 files changed, 10 insertions(+), 46 deletions(-)
diff --git a/gopls/doc/settings.md b/gopls/doc/settings.md
index 4ded290..95ca498 100644
--- a/gopls/doc/settings.md
+++ b/gopls/doc/settings.md
@@ -85,23 +85,13 @@
Default: `[]`.
-#### **memoryMode** *enum*
+#### **memoryMode** *string*
**This setting is experimental and may be deleted.**
-memoryMode controls the tradeoff `gopls` makes between memory usage and
-correctness.
+obsolete, no effect
-Values other than `Normal` are untested and may break in surprising ways.
-
-Must be one of:
-
-* `"DegradeClosed"`: In DegradeClosed mode, `gopls` will collect less information about
-packages without open files. As a result, features like Find
-References and Rename will miss results in such packages.
-* `"Normal"`
-
-Default: `"Normal"`.
+Default: `""`.
#### **expandWorkspaceToModule** *bool*
diff --git a/gopls/internal/settings/api_json.go b/gopls/internal/settings/api_json.go
index fe5e571..e9c2d63 100644
--- a/gopls/internal/settings/api_json.go
+++ b/gopls/internal/settings/api_json.go
@@ -34,17 +34,10 @@
Hierarchy: "build",
},
{
- Name: "memoryMode",
- Type: "enum",
- Doc: "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",
- EnumValues: []EnumValue{
- {
- Value: "\"DegradeClosed\"",
- Doc: "`\"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",
- },
- {Value: "\"Normal\""},
- },
- Default: "\"Normal\"",
+ Name: "memoryMode",
+ Type: "string",
+ Doc: "obsolete, no effect\n",
+ Default: "\"\"",
Status: "experimental",
Hierarchy: "build",
},
diff --git a/gopls/internal/settings/default.go b/gopls/internal/settings/default.go
index 46859b3..87192e0 100644
--- a/gopls/internal/settings/default.go
+++ b/gopls/internal/settings/default.go
@@ -62,7 +62,6 @@
UserOptions: UserOptions{
BuildOptions: BuildOptions{
ExpandWorkspaceToModule: true,
- MemoryMode: ModeNormal,
DirectoryFilters: []string{"-**/node_modules"},
TemplateExtensions: []string{},
StandaloneTags: []string{"ignore"},
diff --git a/gopls/internal/settings/settings.go b/gopls/internal/settings/settings.go
index d906bbe..c13d373 100644
--- a/gopls/internal/settings/settings.go
+++ b/gopls/internal/settings/settings.go
@@ -175,11 +175,8 @@
// is the part of the file name after the final dot.)
TemplateExtensions []string
- // MemoryMode controls the tradeoff `gopls` makes between memory usage and
- // correctness.
- //
- // Values other than `Normal` are untested and may break in surprising ways.
- MemoryMode MemoryMode `status:"experimental"`
+ // obsolete, no effect
+ MemoryMode string `status:"experimental"`
// ExpandWorkspaceToModule instructs `gopls` to adjust the scope of the
// workspace to find the best available module root. `gopls` first looks for
@@ -661,16 +658,6 @@
Structured HoverKind = "Structured"
)
-type MemoryMode string
-
-const (
- ModeNormal MemoryMode = "Normal"
- // In DegradeClosed mode, `gopls` will collect less information about
- // packages without open files. As a result, features like Find
- // References and Rename will miss results in such packages.
- ModeDegradeClosed MemoryMode = "DegradeClosed"
-)
-
type VulncheckMode string
const (
@@ -941,12 +928,7 @@
o.DirectoryFilters = filters
case "memoryMode":
- if s, ok := result.asOneOf(
- string(ModeNormal),
- string(ModeDegradeClosed),
- ); ok {
- o.MemoryMode = MemoryMode(s)
- }
+ result.deprecated("")
case "completionDocumentation":
result.setBool(&o.CompletionDocumentation)
case "usePlaceholders":
To view, visit change 548739. To unsubscribe, or for help writing mail filters, visit settings.