diff --git a/CHANGELOG.md b/CHANGELOG.md index 13c481e9..9e03f1f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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: diff --git a/src/solidlsp/ls.py b/src/solidlsp/ls.py index 5b679ce9..6ae69a39 100644 --- a/src/solidlsp/ls.py +++ b/src/solidlsp/ls.py @@ -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: