Skip to content

[FEAT] pyrefly lsp config path customization#2481

Open
yeetypete wants to merge 6 commits intofacebook:mainfrom
yeetypete:feat/lsp-config-path-customization
Open

[FEAT] pyrefly lsp config path customization#2481
yeetypete wants to merge 6 commits intofacebook:mainfrom
yeetypete:feat/lsp-config-path-customization

Conversation

@yeetypete
Copy link

@yeetypete yeetypete commented Feb 21, 2026

Summary

Adds support for customizing the config path used by the pyrefly lsp. This is particularly useful in large projects where your search-path configuration includes paths that are outside the directory tree where the pyrefly lsp searches for its configuration. In that case currently if you open a file in your editor the lsp will fall back to showing you the file without using any of your custom pyrefly settings.

Test Plan

Tested all possible configuration options for setting the config path used by the pyrefly lsp:

  1. PYREFLY_CONFIG env var.
  2. pyrefly lsp --config <config path>.
  3. pyrefly.configPath vscode setting.
  4. Setting pyrefly.lspArgs in the vscode settings to include --config.

No custom build of the pyrefly vscode extension is needed to test this change.

TODO

  • Should pyrefly check and pyrefly lsp use the same config loading interface for explicit config loading?
  • How should fatal errors be handled in the lsp? Can we just exit with fatal error if an invalid config path is provided via the cli or env var?

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.

1 participant