Pylance Doesn't work when Pyrefly is installed
Describe the Bug
in Vs code, after installing the Pyrefly extension. Auto-complete suggestions such as variable names are not showing. Observation -
- After disabling the pyrefly extension and restarting the auto complete starts working again.
- Disabling pylance and keeping pyrefly still did not give auto complete suggestions.
Note- I can't replicate this issue in the pyrefly sandbox.
Sandbox Link
No response
(Only applicable for extension issues) IDE Information
No response
Hi,
Pylance Doesn't work when Pyrefly is installed
This is expected, Pylance turns itself off when Pyrefly is installed.
Disabling pylance and keeping pyrefly still did not give auto complete suggestions
This is not expected, we do support auto-complete based on the available type information, though there are some known limitations/gaps around imports that we're working to address.
Are you able to share a small example of what you were trying to autocomplete? That would help a lot with debugging.
https://github.com/user-attachments/assets/de15aba9-f811-4a1c-93b4-3820e5b4b88a
As you can see in the video attached, auto suggestions such as keyword suggestions, variable name suggestion etc. was working before installing pyrefly, but after installing, all that stopped.
https://github.com/user-attachments/assets/de15aba9-f811-4a1c-93b4-3820e5b4b88a
As you can see in the video attached, auto suggestions such as keyword suggestions, variable name suggestion etc. was working before installing pyrefly, but after installing, all that stopped.
Interesting, thanks for reporting. It seems like some features of pyrefly are working (inlay type hints) but not others. Would you be able to share the output? (you can click "go to output" in the message that pops up or ⇧+⌘+U > pyrefly to see it)
Here is the output.
Handling non-canceled request textDocument/completion (182) Handling non-canceled request textDocument/inlayHint (183) Handling non-canceled request textDocument/documentSymbol (184) [Error - 11:45:55 AM] Request textDocument/documentSymbol failed. Error: name must not be falsy at Function.validate (file:///snap/code/194/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:115:22553) at new Nf (file:///snap/code/194/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:115:22842) at gt (/home/ujjwal/.vscode/extensions/meta.pyrefly-0.16.0-linux-x64/dist/extension.js:33:72994) at o (/home/ujjwal/.vscode/extensions/meta.pyrefly-0.16.0-linux-x64/dist/extension.js:33:48437) at Object.Ev [as map] (/home/ujjwal/.vscode/extensions/meta.pyrefly-0.16.0-linux-x64/dist/extension.js:33:48523) at Object.Un [as asDocumentSymbols] (/home/ujjwal/.vscode/extensions/meta.pyrefly-0.16.0-linux-x64/dist/extension.js:33:72961) at u (/home/ujjwal/.vscode/extensions/meta.pyrefly-0.16.0-linux-x64/dist/extension.js:37:56079) at runNextTicks (node:internal/process/task_queues:60:5) at processImmediate (node:internal/timers:454:9) at T2.provideDocumentSymbols (file:///snap/code/194/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:145:126055) Handling non-canceled request textDocument/inlayHint (185) Handling non-canceled request textDocument/documentSymbol (186) [Error - 11:45:55 AM] Request textDocument/documentSymbol failed. Error: name must not be falsy at Function.validate (file:///snap/code/194/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:115:22553) at new Nf (file:///snap/code/194/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:115:22842) at gt (/home/ujjwal/.vscode/extensions/meta.pyrefly-0.16.0-linux-x64/dist/extension.js:33:72994) at o (/home/ujjwal/.vscode/extensions/meta.pyrefly-0.16.0-linux-x64/dist/extension.js:33:48437) at Object.Ev [as map] (/home/ujjwal/.vscode/extensions/meta.pyrefly-0.16.0-linux-x64/dist/extension.js:33:48523) at Object.Un [as asDocumentSymbols] (/home/ujjwal/.vscode/extensions/meta.pyrefly-0.16.0-linux-x64/dist/extension.js:33:72961) at u (/home/ujjwal/.vscode/extensions/meta.pyrefly-0.16.0-linux-x64/dist/extension.js:37:56079) at T2.provideDocumentSymbols (file:///snap/code/194/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:145:126055) Handling non-canceled request textDocument/documentSymbol (187) [Error - 11:45:55 AM] Request textDocument/documentSymbol failed. Error: name must not be falsy at Function.validate (file:///snap/code/194/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:115:22553) at new Nf (file:///snap/code/194/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:115:22842) at gt (/home/ujjwal/.vscode/extensions/meta.pyrefly-0.16.0-linux-x64/dist/extension.js:33:72994) at o (/home/ujjwal/.vscode/extensions/meta.pyrefly-0.16.0-linux-x64/dist/extension.js:33:48437) at Object.Ev [as map] (/home/ujjwal/.vscode/extensions/meta.pyrefly-0.16.0-linux-x64/dist/extension.js:33:48523) at Object.Un [as asDocumentSymbols] (/home/ujjwal/.vscode/extensions/meta.pyrefly-0.16.0-linux-x64/dist/extension.js:33:72961) at u (/home/ujjwal/.vscode/extensions/meta.pyrefly-0.16.0-linux-x64/dist/extension.js:37:56079) at T2.provideDocumentSymbols (file:///snap/code/194/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:145:126055) Handling non-canceled request textDocument/inlayHint (188) Handling non-canceled request textDocument/completion (189) Handling non-canceled request textDocument/inlayHint (190)
Observation -
- Handling non-canceled request .... -> is triggered after every keystroke.
thanks for the report! this is fixed in 0.16.1: please make sure your extension is fully updated. If there's issues, feel free to reopen this issue
This issue is present in Jupyter but now nothing works, no autocompletion at all in jupyter.
This issue is present in Jupyter but now nothing works, no autocompletion at all in jupyter.
we don't support jupyter notebooks yet. opened #381