Skip to content

Commit

Permalink
final ST3 fix (hopefully)
Browse files Browse the repository at this point in the history
  • Loading branch information
rchl committed Dec 2, 2023
1 parent c9598a8 commit 85f3fa8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 33 deletions.
2 changes: 1 addition & 1 deletion messages.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"2.6.2": "INSTALL.txt",
"2.6.3": "INSTALL.txt",
"install": "INSTALL.txt"
}
33 changes: 1 addition & 32 deletions plugin.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
from LSP.plugin import ClientConfig
from LSP.plugin import WorkspaceFolder
from LSP.plugin.core.typing import Any, Callable, List, Optional, Mapping
from LSP.plugin.core.protocol import Location
from LSP.plugin.locationpicker import LocationPicker
from LSP.plugin.core.typing import List, Optional
from lsp_utils import NpmClientHandler
import os
import sublime
Expand Down Expand Up @@ -55,32 +53,3 @@ def find_typescript_lib_path(cls, workspace_folder: str) -> Optional[str]:
return os.path.dirname(candidate)
server_directory_path = cls._server_directory_path()
return os.path.join(server_directory_path, 'node_modules', 'typescript', 'lib')

def on_pre_server_command(self, command: Mapping[str, Any], done_callback: Callable[[], None]) -> bool:
command_name = command['command']
if command_name == 'editor.action.showReferences':
_, __, references = command['arguments']
self._handle_show_references(references)
done_callback()
return True
return False

def _handle_show_references(self, references: List[Location]) -> None:
session = self.weaksession()
if not session:
return
view = sublime.active_window().active_view()
if not view:
return
if len(references) == 1:
args = {
'location': references[0],
'session_name': session.config.name,
}
window = view.window()
if window:
window.run_command('lsp_open_location', args)
elif references:
LocationPicker(view, session, references, side_by_side=False)
else:
sublime.status_message('No references found')

0 comments on commit 85f3fa8

Please sign in to comment.