1
0
mirror of https://github.com/golang/go synced 2024-11-18 15:04:44 -07:00

internal/lsp: re-enable deep completions and fuzzy matching

CL 193726 accidentally turned off deep completions and fuzzy matching by default.
Re-enabling them now.

Change-Id: Ia120766b3a72243efe9c398c0efd6d1a101d0e7f
Reviewed-on: https://go-review.googlesource.com/c/tools/+/194020
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
This commit is contained in:
Rebecca Stambler 2019-09-06 20:17:48 -04:00
parent dc339cc7c5
commit dab579b762
2 changed files with 10 additions and 7 deletions

View File

@ -283,12 +283,6 @@ func (s *Server) processConfig(ctx context.Context, view source.View, options *s
view.SetBuildFlags(flags)
}
// Check if the user wants documentation in completion items.
// This defaults to true.
options.Completion.Documentation = true
setBool(&options.Completion.Documentation, c, "wantCompletionDocumentation")
setBool(&options.UsePlaceholders, c, "usePlaceholders")
// Set the hover kind.
if hoverKind, ok := c["hoverKind"].(string); ok {
switch hoverKind {
@ -321,11 +315,18 @@ func (s *Server) processConfig(ctx context.Context, view source.View, options *s
}
}
// Set completion options. For now, we allow disabling of completion documentation,
// deep completion, and fuzzy matching.
setBool(&options.Completion.Documentation, c, "wantCompletionDocumentation")
setNotBool(&options.Completion.Deep, c, "disableDeepCompletion")
setNotBool(&options.Completion.FuzzyMatching, c, "disableFuzzyMatching")
// Check if want unimported package completions.
// Unimported package completion is still experimental, so not enabled by default.
setBool(&options.Completion.Unimported, c, "wantUnimportedCompletions")
// If the user wants placeholders for autocompletion results.
setBool(&options.UsePlaceholders, c, "usePlaceholders")
return nil
}

View File

@ -21,6 +21,8 @@ var (
},
Completion: CompletionOptions{
Documentation: true,
Deep: true,
FuzzyMatching: true,
},
}
DefaultViewOptions = ViewOptions{}