From 406b75c195dad3d6091cd16130682b1b590d5b25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Ch=C5=82odnicki?= Date: Mon, 22 Feb 2021 21:59:22 +0100 Subject: [PATCH] Use node_bin variable to use runtime from the lsp_utils settings --- LSP-typescript.sublime-settings | 2 +- plugin.py | 12 +++--------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/LSP-typescript.sublime-settings b/LSP-typescript.sublime-settings index 8d37e01..2b5a291 100644 --- a/LSP-typescript.sublime-settings +++ b/LSP-typescript.sublime-settings @@ -1,5 +1,5 @@ { - "command": ["node", "${server_path}", "--stdio"], + "command": ["${node_bin}", "${server_path}", "--stdio"], "languages": [ { "languageId": "javascriptreact", diff --git a/plugin.py b/plugin.py index 2952049..0e5a27b 100644 --- a/plugin.py +++ b/plugin.py @@ -1,5 +1,3 @@ -import os -import sublime from LSP.plugin import ClientConfig from LSP.plugin import uri_to_filename from LSP.plugin import WorkspaceFolder @@ -8,6 +6,8 @@ from LSP.plugin.core.views import point_to_offset from lsp_utils import NpmClientHandler from lsp_utils import request_handler +import os +import sublime def plugin_loaded(): @@ -21,13 +21,7 @@ def plugin_unloaded(): class LspTypescriptPlugin(NpmClientHandler): package_name = __package__ server_directory = 'typescript-language-server' - server_binary_path = os.path.join( - server_directory, 'node_modules', 'typescript-language-server', 'lib', 'cli.js' - ) - - @classmethod - def install_in_cache(cls) -> bool: - return False + server_binary_path = os.path.join(server_directory, 'node_modules', 'typescript-language-server', 'lib', 'cli.js') @classmethod def is_allowed_to_start(