pyrefly icon indicating copy to clipboard operation
pyrefly copied to clipboard

Pylance Doesn't work when Pyrefly is installed

Open ujjwalk906 opened this issue 9 months ago • 3 comments

Describe the Bug

in Vs code, after installing the Pyrefly extension. Auto-complete suggestions such as variable names are not showing. Observation -

  1. After disabling the pyrefly extension and restarting the auto complete starts working again.
  2. 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

ujjwalk906 avatar May 17 '25 19:05 ujjwalk906

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.

yangdanny97 avatar May 18 '25 02:05 yangdanny97

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.

ujjwalk906 avatar May 19 '25 13:05 ujjwalk906

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)

kinto0 avatar May 19 '25 18:05 kinto0

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 -

  1. Handling non-canceled request .... -> is triggered after every keystroke.

ujjwalk906 avatar May 20 '25 06:05 ujjwalk906

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

kinto0 avatar May 20 '25 16:05 kinto0

This issue is present in Jupyter but now nothing works, no autocompletion at all in jupyter.

NoelJacob avatar May 27 '25 22:05 NoelJacob

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

kinto0 avatar May 27 '25 23:05 kinto0