Skip to content

Commit

Permalink
Add kind filter for Goto Symbol command (#2330)
Browse files Browse the repository at this point in the history
  • Loading branch information
jwortmann authored Oct 4, 2023
1 parent 83ed935 commit 2e06833
Show file tree
Hide file tree
Showing 5 changed files with 228 additions and 161 deletions.
21 changes: 0 additions & 21 deletions plugin/core/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,27 +193,6 @@
sublime.KIND_VARIABLE: "entity.name.constant | constant.other | support.constant | variable.other | variable.parameter | variable.other.member | variable.other.readwrite.member" # noqa: E501
} # type: Dict[SublimeKind, str]

# Recommended colors to use by themes for each symbol kind, based on the kind_container specialization class described
# at https://www.sublimetext.com/docs/themes.html#quick-panel
SUBLIME_KIND_ID_COLOR_SCOPES = {
sublime.KIND_ID_KEYWORD: "region.pinkish",
sublime.KIND_ID_TYPE: "region.purplish",
sublime.KIND_ID_FUNCTION: "region.redish",
sublime.KIND_ID_NAMESPACE: "region.bluish",
sublime.KIND_ID_NAVIGATION: "region.yellowish",
sublime.KIND_ID_MARKUP: "region.orangish",
sublime.KIND_ID_VARIABLE: "region.cyanish",
sublime.KIND_ID_SNIPPET: "region.greenish",
sublime.KIND_ID_COLOR_REDISH: "region.redish",
sublime.KIND_ID_COLOR_ORANGISH: "region.orangish",
sublime.KIND_ID_COLOR_YELLOWISH: "region.yellowish",
sublime.KIND_ID_COLOR_GREENISH: "region.greenish",
sublime.KIND_ID_COLOR_CYANISH: "region.cyanish",
sublime.KIND_ID_COLOR_BLUISH: "region.bluish",
sublime.KIND_ID_COLOR_PURPLISH: "region.purplish",
sublime.KIND_ID_COLOR_PINKISH: "region.pinkish"
} # type: Dict[int, str]

DOCUMENT_HIGHLIGHT_KINDS = {
DocumentHighlightKind.Text: "text",
DocumentHighlightKind.Read: "read",
Expand Down
2 changes: 1 addition & 1 deletion plugin/goto_diagnostic.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def next_input(self, args: dict) -> Optional[sublime_plugin.CommandInputHandler]
if diagnostic is None:
self._preview = None
return DiagnosticInputHandler(self.window, self.view, uri)
return sublime_plugin.BackInputHandler() # type: ignore
return sublime_plugin.BackInputHandler()

def confirm(self, value: Optional[DocumentUri]) -> None:
self.uri = value
Expand Down
Loading

0 comments on commit 2e06833

Please sign in to comment.