Fix/exclude file fix - #4956
Fix/exclude file fix#4956jny0444 wants to merge 3 commits into
Conversation
|
Hi @jny0444! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
|
Thanks @jny0444! The crash in #4403 turns out to be a separate bug (#3670) that we're fixing directly, so this PR is really about whether workspace indexing should skip project-excludes. That changes find-references and rename for excluded files, so I'd like @connernilsen and @kinto0 to weigh in before going further. |
|
This pull request has been imported. If you are a Meta employee, you can view this in D121631043. (Because this pull request was imported automatically, there will not be any future comments.) |
Summary
pyrefly checkalready skipped files in project-excludes, but LSP workspace indexing did not. Opening one project file still indexed excluded siblings, which could parse large generated files or crash the language server.Workspace indexing now uses the resolved config's
project-excludesinstead of only the hardcoded required excludes (node_modules/__pycache__/venv). Default includes are unchanged, so files outsideproject_includescan still be indexed. Opening an excluded file still gets language services.Fixes #4403
AI assistance: used for the regression test and for locating the indexing path; I reviewed and landed the populate_all_workspaces_files change.
Test Plan
Added
test_workspace_indexing_honors_project_excludes, which opens an included file withLazyBlockingindexing and checksworkspace/symbol:project-excludesis indexedproject-excludesis not indexedRan:
No generated files to commit. Existing exclude tests still pass, so diagnostics for opened excluded files stay suppressed.
Optional manual check:
project-excludes = ['**/a.py']with a crasher ina.py; openb.pyin the IDE and confirm the LSP stays up.