pylance-release
pylance-release copied to clipboard
[Bug] Duplicated suggestions, typehints, docs etc.
I'm not entirely sure if it's pylance or VSCode itself, but I suspect it's pylance and hence the issue here.
Environment data
- Language Server version: 2022.7.20
- OS and version: linux x64
- Python version (and distribution if applicable, e.g. Anaconda): 3.8.10
- python.analysis.indexing: null
- python.analysis.typeCheckingMode: strict
Code Snippet
import logging
logger = logging.getLogger(__name__)
But in general any code can be used to reproduce the error.
Repro Steps
- Open a Python project with a python file and a notebook.
- Open both.
- Switch from Python file to the Notebook and back.
- After some seconds the typhints, autocomplete suggestions, etc. are duplicated.

Expected behavior
Normal suggestions, typehints, docs etc.
Actual behavior

are you using "open folder" ?
Yes, it still occurs for me with a folder open:

work around for the double hint. in settings.json
"python.pylanceLspNotebooksEnabled": true
work around for the double hint. in settings.json
"python.pylanceLspNotebooksEnabled": true
Setting it to true does indeed fix this issue, but it reactivates #3017 as the workaround for that requires the LSP to be set to false. I guess there's no good workaround for either of them right now.
https://github.com/microsoft/pylance-release/issues/3017 should be fixed now
Hi, I came here to report the same issue. If both a Python file and a notebook are open at the same time, everything is duplicated. This happens with the pre-release version of Pylance as well.
Setting python.pylanceLspNotebooksEnabled to true does seem to fix this, but I don't feel comfortable using a setting labeled as "experimental" for my important projects. Hoping for a real fix soon. Thanks!
As of Python extension version 2022.14.0, python.pylanceLspNotebooksEnabled is now true by default and no longer considered experimental. Since this issue only repros when using our old notebooks implementation (when python.pylanceLspNotebooksEnabled is false) and we will be removing that old implementation, we have decided not to fix this issue.
If you are setting python.pylanceLspNotebooksEnabled to false, we would like to understand why and fix those issues instead.
Problem still exists. See https://github.com/microsoft/pylance-release/issues/3042 Manual setting of python.pylanceLspNotebooksEnabled: true solved it for me.
Same story as @cyclux. VSCode indicates that the setting doesn't exist when I was editing my settings.json but it still resolved the duplicate suggestions.
This should be a problem with the jupyter extension. You can tell if that's the case by looking in the output window. If there are tabs like so:

Then that means your jupyter extension is old.
This is my current output:
[image: Screenshot 2022-11-11 at 2.03.03 PM.png]
On Fri, Nov 11, 2022 at 2:02 PM Rich Chiodo @.***> wrote:
This should be a problem with the jupyter extension. You can tell if that's the case by looking in the output window. If there are tabs like so:
[image: image] https://user-images.githubusercontent.com/19672699/201412006-a6f0fe01-e0e4-470b-8601-45b47ffa569e.png
Then that means your jupyter extension is old.
— Reply to this email directly, view it on GitHub https://github.com/microsoft/pylance-release/issues/3027#issuecomment-1312076909, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEZ47USJZ3CM5KNYQHR3XYTWH2J23ANCNFSM53HICD2Q . You are receiving this because you commented.Message ID: @.***>
-- Best Jack
You may have replied through e-mail. The image wasn't posted to github.
The real thing to check is your version of the Jupyter extension though. Make sure it's the latest.
Running Jupyter v2022.9.1202862440
On Fri, Nov 11, 2022 at 2:34 PM Rich Chiodo @.***> wrote:
The real thing to check is your version of the Jupyter extension though. Make sure it's the latest.
— Reply to this email directly, view it on GitHub https://github.com/microsoft/pylance-release/issues/3027#issuecomment-1312113249, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEZ47UWLWZUVWNPCZDZVUY3WH2NUBANCNFSM53HICD2Q . You are receiving this because you commented.Message ID: @.***>
-- Best Jack
The bug is fixed in the latest prerelease version:
Name: Jupyter Id: ms-toolsai.jupyter Description: Jupyter notebook support, interactive programming and computing that supports Intellisense, debugging and more. Version: 2022.10.1103011060 Publisher: Microsoft VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter
Great! Thank you for the quick responses!
I updated to version v2022.11.40 and the problem still exists :( I only solved it by adding "python.pylanceLspNotebooksEnabled": true
@4phrs do you have the latest prerelease version of the Jupyter extension installed?
See https://github.com/microsoft/pylance-release/issues/3027#issuecomment-1312148181 above.
@debonte thanks for answering. I switched to pre-release version of Jupyter (v2022.11.1003301027), but the Python kernel is gone.

But in this version, the Pylance duplicate suggestion issue is fixed :)

So, in this case, I chose to go back to Jupyter version v2022.9.1303220346 because the python kernel works again

The problem is in the Jupyter extension. I think I'll wait for the next stable version of Jupyter to be released to update.