Skip to content

Fix/exclude file fix - #4956

Open
jny0444 wants to merge 2 commits into
facebook:mainfrom
jny0444:fix/exclude-file-fix
Open

jny0444 wants to merge 2 commits into
facebook:mainfrom
jny0444:fix/exclude-file-fix

Conversation

@jny0444

@jny0444 jny0444 commented Sep 16, 2026

Copy link
Copy Markdown

Summary

pyrefly check already 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-excludes instead of only the hardcoded required excludes (node_modules / __pycache__ / venv). Default includes are unchanged, so files outside project_includes can 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 with LazyBlocking indexing and checks workspace/symbol:

  • an unopened sibling not in project-excludes is indexed
  • an unopened file matching project-excludes is not indexed

Ran:

cargo test test_workspace_indexing_honors_project_excludes
cargo test test_diagnostics_file_in_excludes
cargo test test_client_project_excludes
python3 test.py --no-test --no-tensor-shapes --no-conformance --no-jsonschema

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 in a.py; open b.py in the IDE and confirm the LSP stays up.

@meta-cla

meta-cla Bot commented Sep 16, 2026

Copy link
Copy Markdown

Hi @jny0444!

Thank you for your pull request and welcome to our community.

Action Required

In 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.

Process

In 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 CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@meta-cla

meta-cla Bot commented Sep 16, 2026

Copy link
Copy Markdown

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@Voyagerroc-Lab

Copy link
Copy Markdown

Reviewed with assistance from OpenAI Codex. Applying project excludes to workspace indexing makes the index respect the same configuration as the project, and the added test checks both included and excluded sibling files. The focused checks reported by the author pass.\n\nFormal review submission was unavailable because GitHub denied review access for this repository. This comment is the code review feedback from OpenAI Codex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add config option to mark files as not reachable

3 participants