From c5fe377693d811b1472b11180f96d56aac2e93d0 Mon Sep 17 00:00:00 2001 From: Michael Panchenko Date: Thu, 17 Jul 2025 17:04:04 +0200 Subject: [PATCH] Readme: mention Serena's usefulness in coding assistants --- README.md | 2 +- .../typescript_language_server.py | 23 +++++++++++-------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 83aa6cc3..53bda0a9 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@

* :rocket: Serena is a powerful **coding agent toolkit** capable of turning an LLM into a fully-featured agent that works **directly on your codebase**. -* :wrench: Serena provides essential **semantic code retrieval and editing tools** that are akin to an IDE's capabilities, extracting code entities at the symbol level and exploiting relational structure. +* :wrench: Serena provides essential **semantic code retrieval and editing tools** that are akin to an IDE's capabilities, extracting code entities at the symbol level and exploiting relational structure. When combined with an existing coding agent, these tools greatly enhance (token) efficiency. * :free: Serena is **free & open-source**, enhancing the capabilities of LLMs you already have access to free of charge. ### Demonstration diff --git a/src/solidlsp/language_servers/typescript_language_server.py b/src/solidlsp/language_servers/typescript_language_server.py index 04ce473c..f994f95f 100644 --- a/src/solidlsp/language_servers/typescript_language_server.py +++ b/src/solidlsp/language_servers/typescript_language_server.py @@ -99,8 +99,12 @@ class TypeScriptLanguageServer(SolidLanguageServer): ), ] ) - tsserver_ls_dir = os.path.join(cls.ls_resources_dir(), "ts-lsp") - tsserver_executable_path = os.path.join(tsserver_ls_dir, "typescript-language-server") + + # Verify both node and npm are installed + is_node_installed = shutil.which("node") is not None + assert is_node_installed, "node is not installed or isn't in PATH. Please install NodeJS and try again." + is_npm_installed = shutil.which("npm") is not None + assert is_npm_installed, "npm is not installed or isn't in PATH. Please install npm and try again." # Verify both node and npm are installed is_node_installed = shutil.which("node") is not None @@ -109,15 +113,16 @@ class TypeScriptLanguageServer(SolidLanguageServer): assert is_npm_installed, "npm is not installed or isn't in PATH. Please install npm and try again." # Install typescript and typescript-language-server if not already installed - if not os.path.exists(tsserver_ls_dir): - os.makedirs(tsserver_ls_dir, exist_ok=True) + tsserver_ls_dir = os.path.join(cls.ls_resources_dir(), "ts-lsp") + tsserver_executable_path = os.path.join(tsserver_ls_dir, "node_modules", ".bin", "typescript-language-server") + if not os.path.exists(tsserver_executable_path): + logger.log(f"Typescript Language Server executable not found at {tsserver_executable_path}. Installing...", logging.INFO) deps.install(logger, tsserver_ls_dir) - tsserver_executable_path = os.path.join(tsserver_ls_dir, "node_modules", ".bin", "typescript-language-server") - - assert os.path.exists( - tsserver_executable_path - ), "typescript-language-server executable not found. Please install typescript-language-server and try again." + if not os.path.exists(tsserver_executable_path): + raise FileNotFoundError( + f"typescript-language-server executable not found at {tsserver_executable_path}, something went wrong with the installation." + ) return f"{tsserver_executable_path} --stdio" @staticmethod