mirror of
https://github.com/tiennm99/serena.git
synced 2026-10-16 00:15:18 +00:00
Fixed diagnostics files uri handling, added low-level tests
This commit is contained in:
1 parent
d198d67a9f
commit
bd7e64e85a
91 files changed
+958
-72
No files matched your search
@@ -5,6 +5,12 @@ from solidlsp.ls_types import SymbolKind, UnifiedSymbolInformation
|
||||
PYTHON_BACKEND_LANGUAGES = [Language.PYTHON, Language.PYTHON_TY]
|
||||
|
||||
|
||||
def is_diagnostics_test_file(relative_path: str) -> bool:
|
||||
normalized_path = relative_path.replace("\\", "/")
|
||||
filename = normalized_path.rsplit("/", 1)[-1].lower()
|
||||
return filename.startswith(("diagnosticssample.", "diagnostics_sample."))
|
||||
|
||||
|
||||
def has_malformed_name(
|
||||
symbol: UnifiedSymbolInformation,
|
||||
whitespace_allowed: bool = False,
|
||||
@@ -36,6 +42,9 @@ def request_all_symbols(language_server: SolidLanguageServer) -> list[UnifiedSym
|
||||
result: list[UnifiedSymbolInformation] = []
|
||||
|
||||
def visit(symbol: UnifiedSymbolInformation) -> None:
|
||||
relative_path = symbol.get("location", {}).get("relativePath", "")
|
||||
if relative_path and is_diagnostics_test_file(relative_path):
|
||||
return
|
||||
result.append(symbol)
|
||||
for child in symbol.get("children", []):
|
||||
visit(child)
|
||||
|
||||
Reference in new issue
Block a user