SolidLSP language-server adapters
Overview
The concrete SolidLSP adapter catalog lives under src/solidlsp/language_servers/. Each file defines one built-in SolidLanguageServer subclass (or a small family around one adapter) that knows how to prepare its runtime dependency, construct the LSP launch command, customize initialize parameters, and handle server-specific startup notifications. Built-ins are selected through LanguageServerId.get_ls_class() in src/…/ls_config.py, which lazily imports adapters such as pyright_server.py, typescript_language_server.py, eclipse_jdtls.py, kotlin_language_server.py, vue_language_server.py, svelte_language_server.py, angular_language_server.py, and the many single-language adapters in the same directory.
Most adapters follow the same pattern: the SolidLanguageServer subclass calls super().__init__(..., language_id, solidlsp_settings) and overrides _create_dependency_provider() to return a provider. Providers come from src/…/dependency_provider.py: LanguageServerDependencyProviderSinglePath resolves one executable/JAR/script path and then turns it into a launch command, while LanguageServerDependencyProviderUvx runs pinned PyPI packages through uvx/uv tool run. The shared helpers in src/…/common.py add RuntimeDependency and RuntimeDependencyCollection for adapters that install npm packages, run setup commands, or download platform-specific archives into the adapter resource directory. common.py also centralizes build_npm_install_command(), verified archive extraction, platform filtering, and Unreal Engine ignored-directory helpers.
Major adapter families are:
- Python/PyPI via uvx: pyright_server.py, ty_server.py, pyrefly_server.py, and basedpyright_server.py create
LanguageServerDependencyProviderUvxinstances with pinned package versions and extra stdio arguments. This keeps Python language servers versioned without maintaining per-platform archives. - Node/npm language servers: typescript_language_server.py, yaml_language_server.py, json_language_server.py, vscode_html_language_server.py, some_sass_language_server.py, solidity_language_server.py, graphql_language_server.py, ansible_language_server.py, and related web adapters use
RuntimeDependencyCollectionplusbuild_npm_install_command()to install pinned packages under the language server's resources directory. typescript_language_server.py pins bothtypescriptandtypescript-language-server, maps .tsx/.jsx to React language IDs, disables Automatic Type Acquisition, and pinstsserverto Serena's managed TypeScript install for untrusted projects. - System-executable adapters: adapters such as deno_language_server.py, wolfram_language_server.py, sourcekit_lsp.py, qml_language_server.py, gleam_language_server.py, and parts of zls.py/solargraph.py primarily discover executables with
shutil.which()or userls_pathsettings and fail with install guidance when the toolchain is missing. - Downloaded binary/JAR adapters: eclipse_jdtls.py, kotlin_language_server.py, erlang_language_server.py, emmylua_ls.py, nextflow_language_server.py, and vbnet_language_server.py create
DownloadedDependencyobjects whose URLs are verified against src/…/downloaded_dependency_hashes.json. Other adapters such as terraform_ls.py, taplo_server.py, texlab_language_server.py, systemverilog_server.py, and hlsl_language_server.py also download platform-specific binaries using the shared runtime dependency or file utility path. - Companion/multiprocess adapters: vue_language_server.py starts Volar plus a companion
VueTypeScriptServerconfigured with@vue/typescript-plugin; svelte_language_server.py startssvelte-language-serverplus a companion TypeScript server configured withtypescript-svelte-plugin; angular_language_server.py runsngserver, a companion TypeScript server with@angular/language-service, andVsCodeHtmlLanguageServerfor HTML document symbols. These adapters also route requests between processes rather than relying on the defaultSolidLanguageServerrequest path. - Large custom servers: eclipse_jdtls.py, scala_language_server.py, kotlin_language_server.py, gopls.py, rust_analyzer.py, and csharp_language_server.py add deeper startup synchronization, cache-versioning, symbol normalization, build-tool configuration, or workspace filtering because their upstream servers need more than a launch command.
Runtime state is written below each adapter's SolidLSP resources directory. The exact layout is adapter-specific: typescript_language_server.py installs into ts-lsp or a versioned ts-lsp-<typescript>-<typescript-language-server> directory; kotlin_language_server.py downloads into kotlin_language_server or a versioned directory and redirects IntelliJ idea.system.path into the project cache; eclipse_jdtls.py installs vscode-java VSIX and Gradle resources or uses an upstream JDTLS install when jdtls_path and lombok_path are set. User overrides are intentionally centralized: LanguageServerDependencyProviderBaseCommand supports ls_base_cmd, ls_path, ls_args, and ls_extra_args, while individual adapters add language-specific version/settings keys in their _custom_settings.
Initialization customization is adapter-specific and usually lives in _create_base_initialize_params() plus _start_server(). Examples include Pyright progress and log-message handlers in pyright_server.py, TypeScript progress and version handling in typescript_language_server.py, Deno workspace/configuration and Deno-specific notifications in deno_language_server.py, Kotlin workspace storage and progress handling in kotlin_language_server.py, and Java/JDTLS build-tool/runtime options in eclipse_jdtls.py. Directory filtering is similarly per adapter via is_ignored_dirname(): TypeScript ignores node_modules, dist, and build; Deno ignores node_modules, vendor, dist, and build; Vue/Svelte/Angular add framework build output such as .nuxt, .output, or companion-specific handling.
Dependency hashes are stored in src/…/downloaded_dependency_hashes.json. DownloadedDependencyHashDatabase loads that resource file, returns known SHA256 values during DownloadedDependency.download_to(), and in CI raises if a verified dependency URL is missing a hash. scripts/update_downloaded_dependency_hashes.py updates hashes for the adapters that opt into this database today: Eclipse JDTLS, EmmyLua, Erlang, Nextflow, Kotlin, and VB.NET. scripts/print_language_list.py prints the sorted values of LanguageServerId, so adding a built-in language to src/…/ls_config.py is reflected in generated project template language lists.
To add a new built-in language server, add a concrete adapter under src/solidlsp/language_servers/, choose an appropriate dependency provider model, define launch command and initialization behavior, and then wire the language into src/…/ls_config.py by adding a LanguageServerId value, source filename matcher, and get_ls_class() import branch. If the adapter downloads verified artifacts through DownloadedDependency, add/update its DependencyProvider.update_dep_hashes() and include it in scripts/update_downloaded_dependency_hashes.py; if it is exposed in templates, regenerate the language list with scripts/print_language_list.py.
Coupling
- If a verified download URL or default version changes in eclipse_jdtls.py, kotlin_language_server.py, erlang_language_server.py, emmylua_ls.py, nextflow_language_server.py, or vbnet_language_server.py, also run scripts/update_downloaded_dependency_hashes.py and commit the resulting src/…/downloaded_dependency_hashes.json;
DownloadedDependency.download_to()raises in CI when a verified URL has no SHA256 entry. - If a new built-in adapter file is added under
src/solidlsp/language_servers/, also update src/…/ls_config.py with theLanguageServerId, filename matcher, andget_ls_class()branch. The adapter directory alone is not discovered automatically for built-ins; automatic registration is only for external entry points throughLanguageServerRegistry. - If the TypeScript dependency model changes in typescript_language_server.py, verify vue_language_server.py, svelte_language_server.py, and angular_language_server.py; their companion TypeScript server subclasses reuse TypeScript initialization and dependency-provider behavior but inject framework plugins and pre-resolved
typescript-language-serverpaths. - If
LanguageServerDependencyProviderBaseCommandsemantics in src/…/dependency_provider.py change, check adapters that assumels_pathmeans a single executable or core path, especially typescript_language_server.py, kotlin_language_server.py, deno_language_server.py, and npm-backed adapters usingLanguageServerDependencyProviderSinglePath. - If src/…/common.py changes download/extract or npm command behavior, verify npm-backed adapters and archive-backed adapters together:
RuntimeDependencyCollection.install()is shared by Node package installs and by some direct binary downloads, andbuild_npm_install_command()controls package pinning and optional registry overrides.
Risks
- typescript_language_server.py, vue_language_server.py, svelte_language_server.py, and angular_language_server.py are tightly coupled around TypeScript plugin loading and language IDs. If .tsx/.jsx/framework file language IDs or plugin locations drift, definitions and symbols can be silently truncated or filtered out rather than failing loudly.
- eclipse_jdtls.py pins internal VSIX paths (
VsixResourcePaths) as well as artifact hashes. IfDEFAULT_VSCODE_JAVA_VERSIONis bumped without updating the JRE, Lombok, and Equinox launcher filenames, the VSIX can download successfully but JDTLS later fails with missing internal files. - kotlin_language_server.py has explicit comments warning that newer JetBrains Kotlin LSP versions expire quickly, so
DEFAULT_KOTLIN_LSP_VERSIONis intentionally held at the initial version. Changing it risks producing an adapter that installs correctly but becomes unusable after the upstream build expires. DownloadedDependencyHashDatabasein src/…/dependency_provider.py treats unknown verified hashes as warnings outside CI but hard failures in CI. A local manual test of a changedDownloadedDependencymay appear to work while CI fails unless src/…/downloaded_dependency_hashes.json is updated.