Skip to content

Commit

Permalink
gopls: remove the LiteralCompletions option
Browse files Browse the repository at this point in the history
With the old marker tests gone, it is no longer used.

Updates golang/go#54845

Change-Id: If44e6f8b53286cfb66ed0422f30f1d79197a239f
Reviewed-on: https://go-review.googlesource.com/c/tools/+/542636
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
  • Loading branch information
findleyr committed Nov 20, 2023
1 parent cc42fd3 commit 6b2c993
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 12 deletions.
2 changes: 0 additions & 2 deletions gopls/internal/lsp/source/completion/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ type completionOptions struct {
documentation bool
fullDocumentation bool
placeholders bool
literal bool
snippets bool
postfix bool
matcher settings.Matcher
Expand Down Expand Up @@ -550,7 +549,6 @@ func Completion(ctx context.Context, snapshot source.Snapshot, fh file.Handle, p
documentation: opts.CompletionDocumentation && opts.HoverKind != settings.NoDocumentation,
fullDocumentation: opts.HoverKind == settings.FullDocumentation,
placeholders: opts.UsePlaceholders,
literal: opts.LiteralCompletions && opts.InsertTextFormat == protocol.SnippetTextFormat,
budget: opts.CompletionBudget,
snippets: opts.InsertTextFormat == protocol.SnippetTextFormat,
postfix: opts.ExperimentalPostfixCompletions,
Expand Down
2 changes: 1 addition & 1 deletion gopls/internal/lsp/source/completion/literal.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
// literal generates composite literal, function literal, and make()
// completion items.
func (c *completer) literal(ctx context.Context, literalType types.Type, imp *importInfo) {
if !c.opts.literal {
if !c.opts.snippets {
return
}

Expand Down
1 change: 0 additions & 1 deletion gopls/internal/settings/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ func DefaultOptions(overrides ...func(*Options)) *Options {
},
},
InternalOptions: InternalOptions{
LiteralCompletions: true,
TempModfile: true,
CompleteUnimported: true,
CompletionDocumentation: true,
Expand Down
8 changes: 0 additions & 8 deletions gopls/internal/settings/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -481,14 +481,6 @@ type Hooks struct {
// TODO(rfindley): even though these settings are not intended for
// modification, some of them should be surfaced in our documentation.
type InternalOptions struct {
// LiteralCompletions controls whether literal candidates such as
// "&someStruct{}" are offered. Tests disable this flag to simplify
// their expected values.
//
// TODO(rfindley): this is almost unnecessary now. Remove it along with the
// old marker tests.
LiteralCompletions bool

// VerboseWorkDoneProgress controls whether the LSP server should send
// progress reports for all work done outside the scope of an RPC.
// Used by the regression tests.
Expand Down

0 comments on commit 6b2c993

Please sign in to comment.