mirror of
https://github.com/tiennm99/serena.git
synced 2026-10-14 20:17:42 +00:00
SolidLSP: Apply InitializeParamsBuilder across all remaining language servers
Convert every remaining SolidLanguageServer subclass from the old _get_initialize_params method to the new _create_base_initialize_params override, so common LSP initialize keys (processId, rootPath, rootUri, clientInfo, workspaceFolders) are provided centrally by the InitializeParamsBuilder rather than by each server. - Drop the per-server processId/rootPath/rootUri/workspaceFolders and all clientInfo entries (including the VS Code spoofs in rust_analyzer and sourcekit); these are now set centrally. - Preserve nested capabilities.workspace.workspaceFolders flags and any server-specific initializationOptions.workspaceFolders (e.g. kotlin, eclipse_jdtls). - omnisharp keeps loading its JSON template but no longer sets the centrally-managed keys. - Update _start_server call sites to self._create_initialize_params() and drop now-unnecessary cast()/type: ignore wrappers. angular, svelte and vue are intentionally left as-is: they already override _create_base_initialize_params for their TypeScript companion server, and their remaining _get_initialize_params drives a separate language server process. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
c904efed5e
commit
1c12156901
62 files changed
+252
-1020
No files matched your search
@@ -1,35 +0,0 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
from types import SimpleNamespace
|
||||
|
||||
import pytest
|
||||
|
||||
from solidlsp.language_servers.omnisharp import OmniSharp
|
||||
|
||||
|
||||
class _NoWaitEvent:
|
||||
def is_set(self) -> bool:
|
||||
return False
|
||||
|
||||
def wait(self, timeout: float | None = None) -> bool:
|
||||
raise AssertionError("OmniSharp startup must not wait for dynamic capability registration")
|
||||
|
||||
|
||||
@pytest.mark.csharp
|
||||
def test_omnisharp_startup_does_not_wait_for_capability_registration(tmp_path: Path) -> None:
|
||||
omnisharp = OmniSharp.__new__(OmniSharp)
|
||||
omnisharp.repository_root_path = str(tmp_path)
|
||||
omnisharp.server = SimpleNamespace(
|
||||
send=SimpleNamespace(initialize=lambda _params: {"capabilities": {}}),
|
||||
notify=SimpleNamespace(initialized=lambda _params: None, workspace_did_change_configuration=lambda _params: None),
|
||||
on_request=lambda *_args: None,
|
||||
on_notification=lambda *_args: None,
|
||||
start=lambda: None,
|
||||
)
|
||||
omnisharp.server_ready = _NoWaitEvent()
|
||||
omnisharp.definition_available = _NoWaitEvent()
|
||||
omnisharp.references_available = _NoWaitEvent()
|
||||
omnisharp.completions_available = _NoWaitEvent()
|
||||
|
||||
omnisharp._start_server()
|
||||
Reference in new issue
Block a user