mirror of
https://github.com/tiennm99/serena.git
synced 2026-10-14 02:16:21 +00:00
Include .t files in Perl::LanguageServer fileFilter
Serena's file-to-language router already maps `.t` to the Perl LS (`Language.PERL` in `solidlsp/ls_config.py`), but the Perl::LanguageServer-side `fileFilter` was hardcoded to `[".pm", ".pl"]`. As a result Perl::LanguageServer skipped `.t` files entirely: symbol queries on a `.t` returned empty, and references to `.pm`/`.pl` subs missed any callers defined in `.t` files. Add `.t` to the filter, deduplicate the two `fileFilter` literals into a `_FILE_FILTER` class constant, and note the sync requirement with `Language.PERL.get_source_fn_matcher()` in a comment. Cover the behavior with a new cross-file references test plus a `helper.t` fixture; the test fails on unpatched `main` and passes on this branch.
This commit is contained in:
1 parent
0909ae05f7
commit
860c5841df
3 files changed
+26
-2
No files matched your search
@@ -77,6 +77,14 @@ class TestPerlLanguageServer:
|
||||
assert 17 in main_pl_lines, f"Expected reference at line 18 (0-indexed 17), found: {main_pl_lines}"
|
||||
assert 20 in main_pl_lines, f"Expected reference at line 21 (0-indexed 20), found: {main_pl_lines}"
|
||||
|
||||
@pytest.mark.parametrize("language_server", [Language.PERL], indirect=True)
|
||||
def test_find_references_includes_t_files(self, language_server: SolidLanguageServer) -> None:
|
||||
"""References to a .pm/.pl sub must surface callers in .t test files (fileFilter includes .t)."""
|
||||
reference_locations = language_server.request_references("helper.pl", 4, 5)
|
||||
|
||||
t_refs = [ref for ref in reference_locations if ref["uri"].endswith(".t")]
|
||||
assert t_refs, f"Expected at least one reference in a .t file, got: {[r['uri'] for r in reference_locations]}"
|
||||
|
||||
@pytest.mark.parametrize("language_server", [Language.PERL], indirect=True)
|
||||
def test_bare_symbol_names(self, language_server) -> None:
|
||||
all_symbols = request_all_symbols(language_server)
|
||||
|
||||
Reference in new issue
Block a user