Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intellisense completions have duplicates when python.pylanceLspNotebooksEnabled is true #11038

Closed
rchiodo opened this issue Aug 3, 2022 · 12 comments
Labels
bug Issue identified by VS Code Team member as probable bug notebook-intellisense Intellisense & other language features in notebook cells for any language

Comments

@rchiodo
Copy link
Contributor

rchiodo commented Aug 3, 2022

Repro steps:

  1. Set "python.pylanceLspNotebooksEnabled" to true
  2. Create a notebook
  3. Create some cells that create a dataframe
  4. Run the cell that creates the dataframe
  5. Create a new cell to get members.
  6. Type df.ag

Result:

image

Without python.pylanceLspNotebooksEnabled:

image

The root cause of this problem is the Jupyter extension is no longer creating the pylance server so we have no current way to query pylance for its list of completions to eliminate duplicates.

/cc @debonte

@rchiodo rchiodo added the bug Issue identified by VS Code Team member as probable bug label Aug 3, 2022
@github-actions github-actions bot added the triage-needed Issue needs to be triaged label Aug 3, 2022
@rchiodo rchiodo added notebook-intellisense Intellisense & other language features in notebook cells for any language triage-needed Issue needs to be triaged and removed triage-needed Issue needs to be triaged labels Aug 3, 2022
@DonJayamanne DonJayamanne removed the triage-needed Issue needs to be triaged label Aug 4, 2022
@torext
Copy link

torext commented Aug 5, 2022

For me instead the duplicates appear in normal .py files once I open and run a Jupyter notebook, and with the folllowing settings:

"python.pylanceLspNotebooksEnabled": false, "jupyter.pylanceHandlesNotebooks": true,

Setting python.pylanceLspNotebooksEnabled to true instead isn't an option currently due to the issue microsoft/pylance-release#3126, but putting both to false,

"python.pylanceLspNotebooksEnabled": false, "jupyter.pylanceHandlesNotebooks": false,

gets rid of duplicates in both .py and .ipynb files for me and makes things acceptable.

@hookxs
Copy link

hookxs commented Aug 5, 2022

This is probably the same issue as #10846

@torext
Copy link

torext commented Sep 16, 2022

Just an update to confirm that I still see this issue in VSCode v1.71.2 + Pylance v.2022.9.21, see microsoft/pylance-release#3017 (comment)

@m-metz
Copy link

m-metz commented Nov 8, 2022

I am seeing duplicate intellisense as well for:

ms-python.vscode-pylance 2022.11.10

ms-toolsai.jupyter v2022.9.1202862440

VSCode
Version: 1.73.0 (user setup)
Commit: 8fa188b2b301d36553cbc9ce1b0a146ccb93351f
Date: 2022-11-01T15:34:06.111Z
Electron: 19.0.17
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Windows_NT x64 10.0.22621
Sandboxed: No

According to microsoft/pylance-release#3017 (comment), the python.pylanceLspNotebooksEnabled setting is going away, and as of the 1.73.0 2022-11-01T15:34:06.111Z version, it seems to be gone.

This is essentially forcing "python.pylanceLspNotebooksEnabled": true however I was still able to make "jupyter.pylanceHandlesNotebooks": false

With these settings, my .py files don't duplicate intellisense, but my .ipynb files do duplicate intellisense.

@torext
Copy link

torext commented Nov 8, 2022

@m-metz According to #11938 (comment) this seems fixed in the pre-release version of the Jupyter extension. Switching to that one indeed fixed it for me.

@ZupoLlask
Copy link

@m-metz According to #11938 (comment) this seems fixed in the pre-release version of the Jupyter extension. Switching to that one indeed fixed it for me.

It seems that also fixed the same issue for me!

@DonJayamanne DonJayamanne self-assigned this Nov 27, 2022
@dlefcoe
Copy link

dlefcoe commented Nov 28, 2022

I am seeing duplicate intellisense as well for:

ms-python.vscode-pylance 2022.11.10

ms-toolsai.jupyter v2022.9.1202862440

VSCode
Version: 1.73.0 (user setup)
Commit: 8fa188b2b301d36553cbc9ce1b0a146ccb93351f
Date: 2022-11-01T15:34:06.111Z
Electron: 19.0.17
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Windows_NT x64 10.0.22621
Sandboxed: No

According to microsoft/pylance-release#3017 (comment), the python.pylanceLspNotebooksEnabled setting is going away, and as of the 1.73.0 2022-11-01T15:34:06.111Z version, it seems to be gone.

This is essentially forcing "python.pylanceLspNotebooksEnabled": true however I was still able to make "jupyter.pylanceHandlesNotebooks": false

With these settings, my .py files don't duplicate intellisense, but my .ipynb files do duplicate intellisense.

where does one make this change ?

@DonJayamanne
Copy link
Contributor

@dlefcoe
Please could you install VS Codde 1.74 and the latest Jupyter, PyLance and Python extension and confirm this still exists.
From what I know this should now be fixed.

@dlefcoe
Copy link

dlefcoe commented Dec 8, 2022

@DonJayamanne
This appears to be fixed.

VS Codde 1.74 and the latest Jupyter, PyLance and Python extension works !

@dlefcoe
Copy link

dlefcoe commented Dec 9, 2022

@dlefcoe Please could you install VS Codde 1.74 and the latest Jupyter, PyLance and Python extension and confirm this still exists. From what I know this should now be fixed.

this appears to work on windows 10, but not windows 11 (same updates done).

@hookxs
Copy link

hookxs commented Dec 10, 2022

this appears to work on windows 10, but not windows 11 (same updates done).

The issue disappeared for me after the latest pylance or jupyter update on Win11, it works fine now

@dlefcoe
Copy link

dlefcoe commented Dec 10, 2022

this appears to work on windows 10, but not windows 11 (same updates done).

The issue disappeared for me after the latest pylance or jupyter update on Win11, it works fine now

Yes, it does:

  • With windows 10 i just needed to check for updates in vscode and restart.
  • With windows 11 i needed to restart the operating system to invoke the vscode update.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug notebook-intellisense Intellisense & other language features in notebook cells for any language
Projects
None yet
Development

No branches or pull requests

8 participants