diff --git a/.gitignore b/.gitignore index 89bbe0b2..78b8833a 100644 --- a/.gitignore +++ b/.gitignore @@ -202,20 +202,12 @@ pylint.html /agent-ui /test/**/.serena -# dynamic LS installations -/src/multilspy/language_servers/*/static -/src/solidlsp/language_servers/*/static -/src/solidlsp/language_servers/static - # clojure-lsp temporary files .calva/ .clj-kondo/ .cpcache/ .lsp/ -# Cache is in .multilspy -**/.multilspy/** - # temporary and backup files *.bak *.tmp diff --git a/src/solidlsp/language_servers/intelephense.py b/src/solidlsp/language_servers/intelephense.py index 487c7fca..64f80e03 100644 --- a/src/solidlsp/language_servers/intelephense.py +++ b/src/solidlsp/language_servers/intelephense.py @@ -53,7 +53,7 @@ class Intelephense(SolidLanguageServer): PlatformId.WIN_x64, PlatformId.WIN_arm64, ] - assert platform_id in valid_platforms, f"Platform {platform_id} is not supported for multilspy PHP at the moment" + assert platform_id in valid_platforms, f"Platform {platform_id} is not supported by {cls.__name__} at the moment" # Verify both node and npm are installed is_node_installed = shutil.which("node") is not None diff --git a/src/solidlsp/ls.py b/src/solidlsp/ls.py index 5ca9912b..f47f60e7 100644 --- a/src/solidlsp/ls.py +++ b/src/solidlsp/ls.py @@ -249,12 +249,11 @@ class SolidLanguageServer(ABC): Do not instantiate this class directly. Use `LanguageServer.create` method instead. - :param config: The Multilspy configuration. - :param repository_root_path: The root path of the repository. - :param process_launch_info: Each language server has a specific command used to start the server. - This parameter is the command to launch the language server process. - The command must pass appropriate flags to the binary, so that it runs in the stdio mode, - as opposed to HTTP, TCP modes supported by some language servers. + :param config: the global SolidLSP configuration. + :param repository_root_path: the root path of the repository. + :param process_launch_info: the command used to start the actual language server. + The command must pass appropriate flags to the binary, so that it runs in the stdio mode, + as opposed to HTTP, TCP modes supported by some language servers. :param cache_version_raw_document_symbols: the version, for caching, of the raw document symbols coming from this specific language server. This should be incremented by subclasses calling this constructor whenever the format of the raw document symbols changes (typically because the language server @@ -343,10 +342,11 @@ class SolidLanguageServer(ABC): self.server.set_request_timeout(timeout) def get_ignore_spec(self) -> pathspec.PathSpec: - """Returns the pathspec matcher for the paths that were configured to be ignored through - the multilspy config. + """ + Returns the pathspec matcher for the paths that were configured to be ignored through + the language server configuration. - This is is a subset of the full language-specific ignore spec that determines + This is a subset of the full language-specific ignore spec that determines which files are relevant for the language server. This matcher is useful for operations outside of the language server, @@ -619,7 +619,7 @@ class SolidLanguageServer(ABC): :param line: The line number of the symbol :param column: The column number of the symbol - :return List[multilspy_types.Location]: A list of locations where the symbol is defined + :return: the list of locations where the symbol is defined """ if not self.server_started: log.error("request_definition called before language server started") @@ -842,7 +842,7 @@ class SolidLanguageServer(ABC): :param line: The line number of the symbol :param column: The column number of the symbol - :return List[multilspy_types.CompletionItem]: A list of completions + :return: A list of completions """ with self.open_file(relative_file_path): open_file_buffer = self.open_file_buffers[pathlib.Path(os.path.join(self.repository_root_path, relative_file_path)).as_uri()] diff --git a/src/solidlsp/ls_config.py b/src/solidlsp/ls_config.py index 7a09588f..160205e1 100644 --- a/src/solidlsp/ls_config.py +++ b/src/solidlsp/ls_config.py @@ -28,7 +28,7 @@ class FilenameMatcher: class Language(str, Enum): """ - Possible languages with Multilspy. + Enumeration of language servers supported by SolidLSP. """ CSHARP = "csharp" @@ -351,9 +351,6 @@ class LanguageServerConfig: @classmethod def from_dict(cls, env: dict) -> Self: - """ - Create a MultilspyConfig instance from a dictionary - """ import inspect return cls(**{k: v for k, v in env.items() if k in inspect.signature(cls).parameters}) diff --git a/src/solidlsp/ls_types.py b/src/solidlsp/ls_types.py index a1baab88..003ede2a 100644 --- a/src/solidlsp/ls_types.py +++ b/src/solidlsp/ls_types.py @@ -1,5 +1,5 @@ """ -Defines wrapper objects around the types returned by LSP to ensure decoupling between LSP versions and multilspy +Defines wrapper objects around the types returned by LSP to ensure decoupling between LSP versions and SolidLSP """ from __future__ import annotations diff --git a/src/solidlsp/ls_utils.py b/src/solidlsp/ls_utils.py index 8c60a13a..b8aa6845 100644 --- a/src/solidlsp/ls_utils.py +++ b/src/solidlsp/ls_utils.py @@ -223,7 +223,7 @@ class FileUtils: """ try: tmp_files = [] - tmp_file_name = str(PurePath(os.path.expanduser("~"), "multilspy_tmp", uuid.uuid4().hex)) + tmp_file_name = str(PurePath(os.path.expanduser("~"), "solidlsp_tmp", uuid.uuid4().hex)) tmp_files.append(tmp_file_name) os.makedirs(os.path.dirname(tmp_file_name), exist_ok=True) FileUtils.download_file(url, tmp_file_name) @@ -269,10 +269,6 @@ class FileUtils: class PlatformId(str, Enum): - """ - multilspy supported platforms - """ - WIN_x86 = "win-x86" WIN_x64 = "win-x64" WIN_arm64 = "win-arm64" @@ -290,10 +286,6 @@ class PlatformId(str, Enum): class DotnetVersion(str, Enum): - """ - multilspy supported dotnet versions - """ - V4 = "4" V6 = "6" V7 = "7" diff --git a/src/solidlsp/lsp_protocol_handler/server.py b/src/solidlsp/lsp_protocol_handler/server.py index 219135b7..d8ab2718 100644 --- a/src/solidlsp/lsp_protocol_handler/server.py +++ b/src/solidlsp/lsp_protocol_handler/server.py @@ -46,17 +46,25 @@ log = logging.getLogger(__name__) @dataclasses.dataclass class ProcessLaunchInfo: """ - This class is used to store the information required to launch a process. + This class is used to store the information required to launch a (language server) process. """ - # The command to launch the process cmd: str | list[str] + """ + the command used to launch the process. + Specification as a list is preferred (as it is more robust and avoids incorrect quoting of arguments); + the string variant is supported for backward compatibility only + """ - # The environment variables to set for the process env: dict[str, str] = dataclasses.field(default_factory=dict) + """ + the environment variables to set for the process + """ - # The working directory for the process cwd: str = os.getcwd() + """ + the working directory for the process + """ class LSPError(Exception):