Fix in request_overview: explicitly passed file path bypassed ignore check

This commit is contained in:
Michael Panchenko committed 2026-04-17 11:05:59 +02:00
1 parent 7392d65b00
commit 3be62e3c27
2 files changed
+4

No files matched your search

+1
View File
@@ -5,6 +5,7 @@ Status of the `main` branch. Changes prior to the next official version change w
* General:
- Support `serena --version` CLI command for displaying the current version #1347
- Fix: Check for ignored path ignored `.git` folder only at the top level, not in every subdirectory (`Project._is_ignored_relative_path`) #1350
- `GetSymbolsOverviewTool`: ignored paths were not respected in LSP variant (fix in `SolidLanguageServer`)
- Fix: Duplicate comments in re-saved YAML configuration files #1285
* JetBrains:
+3
View File
@@ -1694,6 +1694,7 @@ class SolidLanguageServer(ABC):
def request_overview(self, within_relative_path: str) -> dict[str, list[UnifiedSymbolInformation]]:
"""
An overview of all symbols in the given file or directory.
Raises a ValueError if a path to an ignored file is passed.
:param within_relative_path: the relative path to the file or directory to get the overview of.
:return: A mapping of all relative paths analyzed to lists of top-level symbols in the corresponding file.
@@ -1703,6 +1704,8 @@ class SolidLanguageServer(ABC):
raise FileNotFoundError(f"File or directory not found: {abs_path}")
if abs_path.is_file():
if self.is_ignored_path(within_relative_path):
raise ValueError(f"The explicitly passed file {within_relative_path} is ignored, not returning overview.")
symbols_overview = self.request_document_overview(within_relative_path)
return {within_relative_path: symbols_overview}
else: