`python.analysis` setting changes (e.g. `completeFunctionParens`) are not picked up until reload
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 86/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- rust, typescript, vscode
- Domain
- developer-experience, tooling
Research direction
Start in lsp/src/extension.ts around the configuration-change handler at lines 383-389, then read pyrefly/lib/lsp/non_wasm/server.rs around did_change_configuration. Verify how python.analysis changes are detected and ensure the next completion request uses the updated setting without a reload; confirm both enabling and disabling completeFunctionParens behave as expected.
Written by the indexing model from the issue text.
Description
Describe the Bug
When a user changes a python.analysis.* setting such as python.analysis.completeFunctionParens, Pyrefly keeps using the value it read at startup. The new value only takes effect after a window reload or server restart.
Reproduction
- Set
"python.analysis.completeFunctionParens": trueand reload so Pyrefly picks it up. - In a Python file, trigger completion on a function name. The item inserts
name($0)as expected. - Change the setting to
falsewithout reloading. - Trigger completion again. The item still inserts
name($0). - Reload the window, or change any
python.pyrefly.*setting. Completions now insertnamewith no parentheses.
The same happens in the other direction (enabling the setting), and step 5 shows the server picks up the new value as soon as it re-reads its settings for any reason.
Expected behavior
Pyrefly applies the new value on the next completion request, without a reload.
Root cause
The server side is ready for this. did_change_configuration (pyrefly/lib/lsp/non_wasm/server.rs, around line 4738) re-pulls settings for all workspaces when the client supports workspace/configuration, and otherwise applies the pushed python settings.
The notification just never arrives for python.analysis changes:
- The VS Code extension only sends
workspace/didChangeConfigurationwhenpython.pyreflychanges or when the active interpreter changes (lsp/src/extension.ts, lines 383-389 onmain, commitef6de648b). - The language client has no
synchronizeconfiguration section, and the server does not dynamically register forworkspace/didChangeConfigurationeither.
Possible fixes:
- In
lsp/src/extension.ts, also send the notification whenevent.affectsConfiguration('python.analysis'), or'python'more broadly. This is a one-line change. - Alternatively, have the server dynamically register for
workspace/didChangeConfigurationon thepythonsection when the client advertisesdynamicRegistrationsupport. This would also fix other LSP clients that do not push configuration changes.
Would you all be up for me contributing a PR implementing the first one-line option?
Sandbox Link
No response
(Only applicable for extension issues) IDE Information
No response
- Dominant language
- Rust
- Stars
- 7.1k
- Forks
- 564
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from facebook/pyrefly
-
`pyrefly report .` panics if stream not read completelyPossibly taken @asukaminato0721 claimed this today. Opencrash
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
facebook/pyrefly#5362 · 1 assignee ·
Maintainers usually reply within 2 days
-
[tensor-shapes] torch.half dtype alias is missing from torch stubsPossibly taken @mangeshraut712 claimed this today. Opengood first issue pytorch tensor-shapes
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
facebook/pyrefly#5361 · 3 comments ·
Maintainers usually reply within 2 days
-
[tensor-shapes] torch.lerp rejects tensor weights and omits their broadcast shapePossibly taken @mangeshraut712 claimed this today. Openpytorch tensor-shapes
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 2 days
-
[tensor-shapes] torch.empty overloads omit requires_gradPossibly taken @Cha-Imaa claimed this today. Openpytorch tensor-shapes
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
facebook/pyrefly#5359 · 2 comments · 1 assignee ·
Maintainers usually reply within 2 days
-
bug(stubgen): `typing` / `_typeshed` imports are emitted above `from __future__ import annotations`Possibly taken @mangeshraut712 claimed this today. Opengood first issue stubgen
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
facebook/pyrefly#5321 · 1 comment ·
Maintainers usually reply within 2 days
All issues in facebook/pyrefly
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
Maintainers usually reply within 1 day
-
C-bug needs-triage O-UEFI T-libs
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
bug priority: P3 ready-for-agent
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
shep-pm/shep-kelpie#1332 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
ramensoftware/windhawk#1156 · 2 comments ·
-
area/cli complexity:trivial good first issue Stellar Wave test
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Externalize-Labs/externalize#23 ·
Maintainers usually reply within 1 day