From 28c2866bf4970e5cee9f9dd9e1f07fc3e59d8f4a Mon Sep 17 00:00:00 2001 From: Dominik Jain Date: Wed, 29 Apr 2026 16:31:21 +0200 Subject: [PATCH] SolidLanguageServer: Improve docstrings [skip ci] --- src/solidlsp/ls.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/solidlsp/ls.py b/src/solidlsp/ls.py index 6ae69a39..5f3d7d43 100644 --- a/src/solidlsp/ls.py +++ b/src/solidlsp/ls.py @@ -487,10 +487,14 @@ class SolidLanguageServer(ABC): :param config: the global SolidLSP configuration. :param repository_root_path: the root path of the repository. - :param process_launch_info: (DEPRECATED - implement _create_dependency_provider instead) + :param process_launch_info: (DEPRECATED: pass None and implement _create_dependency_provider instead) 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 language_id: The language identifier which will be passed to the language server in the `textDocument/didOpen` + notification by default. + If the language server uses multiple language identifiers, it must override the method `get_language_id_for_file` + to provide the appropriate identifier for each type of file. :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 @@ -729,10 +733,12 @@ class SolidLanguageServer(ABC): pass def _get_language_id_for_file(self, relative_file_path: str) -> str: - """Return the language ID for a file. + """ + Determines the language identifier to pass to the language server for the given file, + particularly `textDocument/didOpen` requests. - Override in subclasses to return file-specific language IDs. - Default implementation returns self.language_id. + Override this method in subclasses to return file-specific language identifiers. + The default implementation returns the main identifier passed at construction (self.language_id). """ return self.language_id