Skip to content

Commit

Permalink
gopls/internal/settings: remove MemoryMode option
Browse files Browse the repository at this point in the history
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-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
  • Loading branch information
adonovan authored and gopherbot committed Dec 12, 2023
1 parent bbc30f1 commit bc9cd15
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 46 deletions.
16 changes: 3 additions & 13 deletions gopls/doc/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,23 +85,13 @@ is the part of the file name after the final dot.)

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*

Expand Down
15 changes: 4 additions & 11 deletions gopls/internal/settings/api_json.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion gopls/internal/settings/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ func DefaultOptions(overrides ...func(*Options)) *Options {
UserOptions: UserOptions{
BuildOptions: BuildOptions{
ExpandWorkspaceToModule: true,
MemoryMode: ModeNormal,
DirectoryFilters: []string{"-**/node_modules"},
TemplateExtensions: []string{},
StandaloneTags: []string{"ignore"},
Expand Down
24 changes: 3 additions & 21 deletions gopls/internal/settings/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,8 @@ type BuildOptions struct {
// 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
Expand Down Expand Up @@ -661,16 +658,6 @@ const (
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 (
Expand Down Expand Up @@ -941,12 +928,7 @@ func (o *Options) set(name string, value interface{}, seen map[string]struct{})
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":
Expand Down

0 comments on commit bc9cd15

Please sign in to comment.