diff --git a/CHANGELOG.md b/CHANGELOG.md index 83a46a53..2bbebfcc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ Status of the `main` branch. Changes prior to the next official version change w symbolic operations (such as `find_referencing_symbols`) to report stale information. An explicit file system polling mechanism is now used to detect changes prior to the affected tool executions. + - Fix: Order of ignore patterns passed to language servers was not respected #1729 - Improve uv-based language server launch command compatibility: Use the more widely supported `uv tool run` instead of `uv x` #1721 - Java (JDT-LS): add `runtimes` to `ls_specific_settings.java`, a list of extra JRE/JDK entries diff --git a/src/solidlsp/ls.py b/src/solidlsp/ls.py index 820d241d..6fd94c5e 100644 --- a/src/solidlsp/ls.py +++ b/src/solidlsp/ls.py @@ -547,17 +547,8 @@ class SolidLanguageServer(ABC): """ self.server.on_any_notification(self._observe_server_notification) - # Set up the pathspec matcher for the ignored paths - # for all absolute paths in ignored_paths, convert them to relative paths - processed_patterns = [] - for pattern in set(config.ignored_paths): - # Normalize separators (pathspec expects forward slashes) - pattern = pattern.replace(os.path.sep, "/") - processed_patterns.append(pattern) - log.debug(f"Processing {len(processed_patterns)} ignored paths from the config") - - # Create a pathspec matcher from the processed patterns - self._ignore_spec = pathspec.PathSpec.from_lines(pathspec.patterns.GitWildMatchPattern, processed_patterns) + # create a pathspec matcher from the given patterns + self._ignore_spec = pathspec.PathSpec.from_lines(pathspec.patterns.GitWildMatchPattern, config.ignored_paths) self._has_waited_for_cross_file_references = False diff --git a/src/solidlsp/ls_config.py b/src/solidlsp/ls_config.py index f5b6edea..2ba90791 100644 --- a/src/solidlsp/ls_config.py +++ b/src/solidlsp/ls_config.py @@ -910,7 +910,10 @@ class LanguageServerConfig: trace_lsp_communication: bool = False start_independent_lsp_process: bool = True ignored_paths: list[str] = field(default_factory=list) - """Paths, dirs or glob-like patterns. The matching will follow the same logic as for .gitignore entries""" + """ + list of ordered ignore patterns (same syntax as .gitignore; only forward slashes) to be used by the language server + for filtering out files and folders from indexing and analysis. + """ encoding: str = "utf-8" """File encoding to use when reading source files"""