-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/lsp/source: make matchers selectable in WorkspaceSymbols
This change allows to use fuzzy or case-sensitive matchers in addition to case-insensitive when searching for symbols. Matcher is specified by UserOptions.Matcher just like Completion. Updates golang/go#33844 Change-Id: I4000fb7984c75f0f41c38d740dbe164398032312 Reviewed-on: https://go-review.googlesource.com/c/tools/+/218737 Reviewed-by: Rebecca Stambler <[email protected]> Run-TryBot: Rebecca Stambler <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
- Loading branch information
1 parent
695c81b
commit 885dec1
Showing
15 changed files
with
307 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
internal/lsp/testdata/lsp/primarymod/workspacesymbol/a/a.go.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
-- symbols -- | ||
WorkspaceSymbolVariableA Variable 3:5-3:29 | ||
WorkspaceSymbolConstantA Constant 5:7-5:31 | ||
workspacesymbolinvariable Constant 8:2-8:27 | ||
|
6 changes: 6 additions & 0 deletions
6
internal/lsp/testdata/lsp/primarymod/workspacesymbol/casesensitive/casesensitive.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package casesensitive | ||
|
||
/*@ | ||
workspacesymbolcasesensitive("baz", baz) | ||
workspacesymbolcasesensitive("Baz", Baz) | ||
*/ |
23 changes: 23 additions & 0 deletions
23
internal/lsp/testdata/lsp/primarymod/workspacesymbol/fuzzy/fuzzy.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package fuzzy | ||
|
||
/*@ | ||
workspacesymbolfuzzy("wsym", | ||
WorkspaceSymbolVariableA, | ||
WorkspaceSymbolConstantA, | ||
workspacesymbolinvariable, | ||
WorkspaceSymbolVariableB, | ||
WorkspaceSymbolStructB, | ||
) | ||
workspacesymbolfuzzy("symbola", | ||
WorkspaceSymbolVariableA, | ||
WorkspaceSymbolConstantA, | ||
workspacesymbolinvariable, | ||
WorkspaceSymbolVariableB, | ||
) | ||
workspacesymbolfuzzy("symbolb", | ||
WorkspaceSymbolVariableA, | ||
workspacesymbolinvariable, | ||
WorkspaceSymbolVariableB, | ||
WorkspaceSymbolStructB, | ||
) | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.