vscode-jupyter icon indicating copy to clipboard operation
vscode-jupyter copied to clipboard

Intellisense completions have duplicates when `python.pylanceLspNotebooksEnabled` is true

Open rchiodo opened this issue 3 years ago • 3 comments

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 avatar Aug 03 '22 17:08 rchiodo

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 https://github.com/microsoft/pylance-release/issues/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.

torext avatar Aug 05 '22 08:08 torext

This is probably the same issue as #10846

hookxs avatar Aug 05 '22 13:08 hookxs

Just an update to confirm that I still see this issue in VSCode v1.71.2 + Pylance v.2022.9.21, see https://github.com/microsoft/pylance-release/issues/3017#issuecomment-1248097940

torext avatar Sep 16 '22 07:09 torext

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 https://github.com/microsoft/pylance-release/issues/3017#issuecomment-1254365264, 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.

m-metz avatar Nov 08 '22 03:11 m-metz

@m-metz According to https://github.com/microsoft/vscode-jupyter/issues/11938#issuecomment-1306103766 this seems fixed in the pre-release version of the Jupyter extension. Switching to that one indeed fixed it for me.

torext avatar Nov 08 '22 10:11 torext

@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!

ZupoLlask avatar Nov 22 '22 22:11 ZupoLlask

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 ?

dlefcoe avatar Nov 28 '22 23:11 dlefcoe

@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.

DonJayamanne avatar Dec 08 '22 10:12 DonJayamanne

@DonJayamanne This appears to be fixed.

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

dlefcoe avatar Dec 08 '22 10:12 dlefcoe

@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).

dlefcoe avatar Dec 09 '22 18:12 dlefcoe

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

hookxs avatar Dec 10 '22 12:12 hookxs

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.

dlefcoe avatar Dec 10 '22 17:12 dlefcoe