mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-03-06 16:31:12 +08:00
codex-lens: ship default LSP config and fix entrypoint
This commit is contained in:
27
codex-lens/tests/lsp/test_packaging_metadata.py
Normal file
27
codex-lens/tests/lsp/test_packaging_metadata.py
Normal file
@@ -0,0 +1,27 @@
|
||||
"""Packaging metadata tests for codex-lens (LSP/semantic extras)."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def _read_pyproject() -> str:
|
||||
repo_root = Path(__file__).resolve().parents[2]
|
||||
return (repo_root / "pyproject.toml").read_text(encoding="utf-8")
|
||||
|
||||
|
||||
def test_lsp_script_entrypoint_points_to_server_main() -> None:
|
||||
pyproject = _read_pyproject()
|
||||
assert 'codexlens-lsp = "codexlens.lsp.server:main"' in pyproject
|
||||
|
||||
|
||||
def test_semantic_extras_do_not_pin_yanked_fastembed_020() -> None:
|
||||
pyproject = _read_pyproject()
|
||||
assert "fastembed~=0.2.0" not in pyproject
|
||||
assert "fastembed~=0.2.1" in pyproject
|
||||
|
||||
|
||||
def test_click_dependency_is_explicitly_guarded() -> None:
|
||||
pyproject = _read_pyproject()
|
||||
assert "click>=8.0.0,<9" in pyproject
|
||||
|
||||
31
codex-lens/tests/lsp/test_standalone_manager_defaults.py
Normal file
31
codex-lens/tests/lsp/test_standalone_manager_defaults.py
Normal file
@@ -0,0 +1,31 @@
|
||||
"""Tests for StandaloneLspManager default config behavior."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
import logging
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from codexlens.lsp.standalone_manager import StandaloneLspManager
|
||||
|
||||
|
||||
def test_loads_builtin_defaults_when_no_config_found(
|
||||
tmp_path: Path, caplog: pytest.LogCaptureFixture
|
||||
) -> None:
|
||||
manager = StandaloneLspManager(workspace_root=str(tmp_path))
|
||||
|
||||
with caplog.at_level(logging.INFO):
|
||||
asyncio.run(manager.start())
|
||||
|
||||
assert manager._configs # type: ignore[attr-defined]
|
||||
assert manager.get_language_id(str(tmp_path / "example.py")) == "python"
|
||||
|
||||
expected_root = str(tmp_path / "lsp-servers.json")
|
||||
expected_codexlens = str(tmp_path / ".codexlens" / "lsp-servers.json")
|
||||
|
||||
assert "using built-in defaults" in caplog.text.lower()
|
||||
assert expected_root in caplog.text
|
||||
assert expected_codexlens in caplog.text
|
||||
|
||||
Reference in New Issue
Block a user