Repository navigation
fix: honor explicit library roots despite workspace excludes - #981
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a long-standing issue where explicitly configured library and package directories were not being properly indexed if they happened to be located within a path that was globally excluded from the main workspace. The changes introduce a more robust workspace management system by separating the core client workspace roots from an expanded set of roots used specifically for file matching and watching. This allows the language server to correctly identify and process files within libraries, ensuring they are fully analyzed while still honoring both global and library-specific ignore patterns. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
fdbb5fc to
85f5694
Compare
Explicitly configured libraries and package directories should still be indexed even when they live under paths excluded from the main workspace. Separate the expanded file-matching roots from the client workspace roots so explicit library roots can bypass parent ignoreDir filtering during collection and watched-file matching without being fed back into init_analysis as main workspaces on reload. Keep global ignore globs and library-specific ignore rules applying inside those library roots, and add regression coverage for matching, collection, and reload state.
85f5694 to
b9bf7cc
Compare
There was a problem hiding this comment.
Code Review
This pull request significantly refactors and enhances the file matching and watching logic within the EmmyLua language server, particularly for handling library files and package directories. Key changes include introducing a separate match_workspace_folders list in WorkspaceManager to distinguish between client-provided workspace roots and an expanded list used for internal matching and watching. The WorkspaceFileMatcher was updated to precompute library-specific exclusion rules from the emmyrc configuration and to use a new select_workspace function for more precise application of include/exclude rules based on the most specific workspace a file belongs to. A new build_match_file_workspaces function dynamically constructs this expanded list, incorporating configured libraries and package directories as library workspace roots. Consequently, the file watcher now monitors all these relevant roots, ensuring consistent and accurate indexing. New unit tests were added to validate the complex interactions of workspace, library, and exclusion rules, confirming that library-specific ignores are correctly applied, global directory ignores do not apply to libraries by default, and global glob ignores still affect libraries.
|
This fixes my issue. |
Explicitly configured libraries and package directories should still be
indexed even when they live under paths excluded from the main
workspace.
Separate the expanded file-matching roots from the client workspace
roots so explicit library roots can bypass parent ignoreDir filtering
during collection and watched-file matching without being fed back into
init_analysis as main workspaces on reload.
Keep global ignore globs and library-specific ignore rules applying
inside those library roots, and add regression coverage for matching,
collection, and reload state.