chore(lsprotocol): migrate to 2025.0.0 and cleanup artifacts
The changes align the project with the 2025.0.0 lsprotocol release, removing the old backport and updating type hints in the protocol hooks to use Sequence where appropriate. The dist-info and packaging metadata for older lsprotocol versions are replaced with the new 2025.0.0 artifacts. - Remove exceptiongroup backport used on Python <3.11 - Use Sequence instead of List in LS protocol hooks - Replace old dist-info with 2025.0.0 metadata
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
"""Shared pytest setup for the language server."""
|
||||
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
THIS_DIR = Path(__file__).parent
|
||||
SRC_DIR = THIS_DIR.parent.parent / "src"
|
||||
if str(SRC_DIR) not in sys.path:
|
||||
sys.path.insert(0, str(SRC_DIR))
|
||||
|
||||
import lsprotocol.types as lsp # type: ignore # noqa: E402
|
||||
from lsp_server import LSP_SERVER # type: ignore # noqa: E402
|
||||
from pygls.workspace import Workspace # noqa: E402
|
||||
|
||||
|
||||
@pytest.fixture(scope="session", autouse=True)
|
||||
def initialize_test_workspace() -> None:
|
||||
"""Provide the workspace that pygls 2 creates during LSP initialization."""
|
||||
LSP_SERVER.protocol._workspace = Workspace( # pylint: disable=protected-access
|
||||
root_uri=None,
|
||||
sync_kind=lsp.TextDocumentSyncKind.Incremental,
|
||||
workspace_folders=[],
|
||||
position_encoding=lsp.PositionEncodingKind.Utf16,
|
||||
)
|
||||
@@ -53,10 +53,11 @@ def test_document_symbols_namespace_proc_set_hierarchy(tmp_path: Path):
|
||||
assert "top_var" in top_names
|
||||
assert "top_proc" in top_names
|
||||
|
||||
# Check that proc add has no children (we're not extracting params as children here)
|
||||
# Procedure parameters are not emitted as children, but local variables are.
|
||||
add = next(c for c in ns.children if c.name == "add")
|
||||
assert add.kind == lsp.SymbolKind.Function
|
||||
assert add.children == []
|
||||
assert add.children is not None
|
||||
assert {child.name for child in add.children} == {"sum"}
|
||||
|
||||
|
||||
def test_buffer_edit_events_are_symbols_with_type_and_name(tmp_path: Path):
|
||||
|
||||
Reference in New Issue
Block a user