From ee2809b9c1de66bb97afedea47bae02d2fd60355 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 30 Dec 2022 11:01:35 +0000 Subject: [PATCH] Bump typescript-language-server from 2.2.0 to 3.0.1 --- LSP-typescript.sublime-commands | 7 --- commands.py | 45 ++------------------ protocol.py | 29 ------------- typescript-language-server/package-lock.json | 30 ++++++------- typescript-language-server/package.json | 2 +- 5 files changed, 19 insertions(+), 94 deletions(-) delete mode 100644 protocol.py diff --git a/LSP-typescript.sublime-commands b/LSP-typescript.sublime-commands index cbb46f1..6b7c5c3 100644 --- a/LSP-typescript.sublime-commands +++ b/LSP-typescript.sublime-commands @@ -15,13 +15,6 @@ "command_args": ["${file}"] } }, - { - "caption": "LSP-typescript: Find Callers", - "command": "lsp_typescript_calls", - "args": { - "direction": "incoming" - }, - }, { "caption": "LSP-typescript: Goto Source Definition", "command": "lsp_typescript_goto_source_definition", diff --git a/commands.py b/commands.py index 01f2ab5..984ada5 100644 --- a/commands.py +++ b/commands.py @@ -1,14 +1,7 @@ -from .protocol import Call, CallsDirection, CallsRequestParams, CallsResponse -from LSP.plugin import Request -from LSP.plugin import Session from LSP.plugin.core.protocol import Location, LocationLink -from LSP.plugin.core.registry import LspTextCommand -from LSP.plugin.core.typing import List, Optional, Union -from LSP.plugin.core.views import text_document_position_params +from LSP.plugin.core.typing import List, Union from LSP.plugin.execute_command import LspExecuteCommand from LSP.plugin.locationpicker import LocationPicker -import functools -import sublime SESSION_NAME = __package__ @@ -22,7 +15,8 @@ class LspTypescriptGotoSourceDefinitionCommand(LspTypescriptExecuteCommand): def handle_success_async(self, result: Union[List[Location], List[LocationLink]], command_name: str) -> None: if not result: window = self.view.window() - window and window.status_message('No source definitions found') + if window: + window.status_message('No source definitions found') return session = self.session_by_name() if not session: @@ -35,36 +29,3 @@ def handle_success_async(self, result: Union[List[Location], List[LocationLink]] self.view.run_command('lsp_open_location', args) else: LocationPicker(self.view, session, result, side_by_side=False) - - -class LspTypescriptCallsCommand(LspTextCommand): - session_name = SESSION_NAME - - def is_enabled(self) -> bool: - selection = self.view.sel() - return len(selection) > 0 and super().is_enabled() - - def run(self, edit: sublime.Edit, direction: CallsDirection) -> None: - session = self.session_by_name(self.session_name) - if session is None: - return - position_params = text_document_position_params(self.view, self.view.sel()[0].b) - params = { - 'textDocument': position_params['textDocument'], - 'position': position_params['position'], - 'direction': direction - } # type: CallsRequestParams - session.send_request(Request("textDocument/calls", params), functools.partial(self.on_result_async, session)) - - def on_result_async(self, session: Session, result: Optional[CallsResponse]) -> None: - if not result: - return - - def to_location_link(call: Call) -> LocationLink: - return { - 'targetUri': call['location']['uri'], - 'targetSelectionRange': call['location']['range'], - } - - locations = list(map(to_location_link, result['calls'])) - LocationPicker(self.view, session, locations, side_by_side=False) diff --git a/protocol.py b/protocol.py deleted file mode 100644 index ecea1f3..0000000 --- a/protocol.py +++ /dev/null @@ -1,29 +0,0 @@ -from LSP.plugin.core.protocol import Location, Position, Range, TextDocumentIdentifier -from LSP.plugin.core.typing import List, Literal, Optional, TypedDict, Union - - -CallsDirection = Union[Literal['incoming'], Literal['outgoing']] - -CallsRequestParams = TypedDict('CallsRequestParams', { - 'textDocument': TextDocumentIdentifier, - 'position': Position, - 'direction': CallsDirection -}, total=True) - -DefinitionSymbol = TypedDict('DefinitionSymbol', { - 'name': str, - 'detail': Optional[str], - 'kind': int, - 'location': Location, - 'selectionRange': Range, -}, total=True) - -Call = TypedDict('Call', { - 'location': Location, - 'symbol': DefinitionSymbol, -}, total=True) - -CallsResponse = TypedDict('CallsResponse', { - 'symbol': Optional[DefinitionSymbol], - 'calls': List[Call], -}, total=True) diff --git a/typescript-language-server/package-lock.json b/typescript-language-server/package-lock.json index 1391e7c..c4cf0be 100644 --- a/typescript-language-server/package-lock.json +++ b/typescript-language-server/package-lock.json @@ -7,7 +7,7 @@ "name": "lsp-typescript", "dependencies": { "typescript": "4.9.4", - "typescript-language-server": "2.2.0" + "typescript-language-server": "3.0.1" } }, "node_modules/commander": { @@ -257,9 +257,9 @@ } }, "node_modules/typescript-language-server": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/typescript-language-server/-/typescript-language-server-2.2.0.tgz", - "integrity": "sha512-VHMBXzXZiyypn6rUtIC+1U8owmJu9bjVIceORVDZlJd+kFLZ45mk4OFIFKHN8TZN6VrcPyc1Eol4WHb7CqHWhg==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/typescript-language-server/-/typescript-language-server-3.0.1.tgz", + "integrity": "sha512-FjdULHn9C8yJjNF66GEpSeBhwyFySSuTxlw5ZACWUIg7jtxbirDB9zZnlqANeekr22AFTVc+vsUx8ZCVlyX1rw==", "dependencies": { "commander": "^9.4.1", "deepmerge": "^4.2.2", @@ -271,7 +271,7 @@ "vscode-languageserver": "^8.0.2", "vscode-languageserver-protocol": "^3.17.2", "vscode-languageserver-textdocument": "1.0.8", - "vscode-uri": "^3.0.6", + "vscode-uri": "^3.0.7", "which": "^3.0.0" }, "bin": { @@ -342,9 +342,9 @@ "integrity": "sha512-zHhCWatviizPIq9B7Vh9uvrH6x3sK8itC84HkamnBWoDFJtzBf7SWlpLCZUit72b3os45h6RWQNC9xHRDF8dRA==" }, "node_modules/vscode-uri": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.0.6.tgz", - "integrity": "sha512-fmL7V1eiDBFRRnu+gfRWTzyPpNIHJTc4mWnFkwBUmO9U3KPgJAmTx7oxi2bl/Rh6HLdU7+4C9wlj0k2E4AdKFQ==" + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.0.7.tgz", + "integrity": "sha512-eOpPHogvorZRobNqJGhapa0JdwaxpjVvyBp0QIUMRMSf8ZAlqOdEquKuRmw9Qwu0qXtJIWqFtMkmvJjUZmMjVA==" }, "node_modules/which": { "version": "3.0.0", @@ -531,9 +531,9 @@ "integrity": "sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==" }, "typescript-language-server": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/typescript-language-server/-/typescript-language-server-2.2.0.tgz", - "integrity": "sha512-VHMBXzXZiyypn6rUtIC+1U8owmJu9bjVIceORVDZlJd+kFLZ45mk4OFIFKHN8TZN6VrcPyc1Eol4WHb7CqHWhg==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/typescript-language-server/-/typescript-language-server-3.0.1.tgz", + "integrity": "sha512-FjdULHn9C8yJjNF66GEpSeBhwyFySSuTxlw5ZACWUIg7jtxbirDB9zZnlqANeekr22AFTVc+vsUx8ZCVlyX1rw==", "requires": { "commander": "^9.4.1", "deepmerge": "^4.2.2", @@ -545,7 +545,7 @@ "vscode-languageserver": "^8.0.2", "vscode-languageserver-protocol": "^3.17.2", "vscode-languageserver-textdocument": "1.0.8", - "vscode-uri": "^3.0.6", + "vscode-uri": "^3.0.7", "which": "^3.0.0" } }, @@ -595,9 +595,9 @@ "integrity": "sha512-zHhCWatviizPIq9B7Vh9uvrH6x3sK8itC84HkamnBWoDFJtzBf7SWlpLCZUit72b3os45h6RWQNC9xHRDF8dRA==" }, "vscode-uri": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.0.6.tgz", - "integrity": "sha512-fmL7V1eiDBFRRnu+gfRWTzyPpNIHJTc4mWnFkwBUmO9U3KPgJAmTx7oxi2bl/Rh6HLdU7+4C9wlj0k2E4AdKFQ==" + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.0.7.tgz", + "integrity": "sha512-eOpPHogvorZRobNqJGhapa0JdwaxpjVvyBp0QIUMRMSf8ZAlqOdEquKuRmw9Qwu0qXtJIWqFtMkmvJjUZmMjVA==" }, "which": { "version": "3.0.0", diff --git a/typescript-language-server/package.json b/typescript-language-server/package.json index 602e961..dc7cb82 100644 --- a/typescript-language-server/package.json +++ b/typescript-language-server/package.json @@ -3,6 +3,6 @@ "private": true, "dependencies": { "typescript": "4.9.4", - "typescript-language-server": "2.2.0" + "typescript-language-server": "3.0.1" } }