mirror of
https://github.com/tiennm99/serena.git
synced 2026-10-14 00:16:57 +00:00
Fix symbol name resolution in selected LS (#1247)
Adds tests for name resolution for each language and fixes the name resolution where tests have failed. Also: Extends python tests to cover ty Extends skipping conditions for several LS (but only when not in CI) Better test output in CI Removed a wrong python test (started failing for ty and should have failed for pyright too)
This commit is contained in:
1 parent
7377a84337
commit
d30cdf8474
59 files changed
+1015
-97
No files matched your search
@@ -19,6 +19,8 @@ import pytest
|
||||
|
||||
from solidlsp.ls import SolidLanguageServer
|
||||
from solidlsp.ls_config import Language
|
||||
from solidlsp.ls_types import SymbolKind
|
||||
from test.solidlsp.conftest import format_symbol_for_assert, has_malformed_name, request_all_symbols
|
||||
|
||||
|
||||
@pytest.mark.haskell
|
||||
@@ -217,3 +219,24 @@ class TestHaskellLanguageServer:
|
||||
assert any("Main.hs" in path or "Calculator.hs" in path for path in calc_ref_paths), (
|
||||
f"Expected Calculator to be referenced in Main.hs or Calculator.hs, got: {calc_ref_paths}"
|
||||
)
|
||||
|
||||
@pytest.mark.parametrize("language_server", [Language.HASKELL], indirect=True)
|
||||
def test_bare_symbol_names(self, language_server) -> None:
|
||||
all_symbols = request_all_symbols(language_server)
|
||||
malformed_symbols = []
|
||||
for s in all_symbols:
|
||||
if s["kind"] == SymbolKind.Module:
|
||||
continue
|
||||
if has_malformed_name(s):
|
||||
malformed_symbols.append(s)
|
||||
if malformed_symbols:
|
||||
diagnostics = [
|
||||
{
|
||||
"formatted": format_symbol_for_assert(sym),
|
||||
"name": sym["name"],
|
||||
"kind": SymbolKind(sym["kind"]).name,
|
||||
"detail": sym.get("detail"),
|
||||
}
|
||||
for sym in malformed_symbols
|
||||
]
|
||||
pytest.fail(f"Found malformed symbols: {diagnostics}", pytrace=False)
|
||||
Reference in new issue
Block a user