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

[Bug] Duplicated suggestions, typehints, docs etc. #3027

Closed
alkatar21 opened this issue Jul 11, 2022 · 19 comments
Closed

[Bug] Duplicated suggestions, typehints, docs etc. #3027

alkatar21 opened this issue Jul 11, 2022 · 19 comments
Assignees
Labels
needs investigation Could be an issue - needs investigation

Comments

@alkatar21
Copy link

alkatar21 commented Jul 11, 2022

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

  1. Open a Python project with a python file and a notebook.
  2. Open both.
  3. Switch from Python file to the Notebook and back.
  4. After some seconds the typhints, autocomplete suggestions, etc. are duplicated.
    Animation

Expected behavior

Normal suggestions, typehints, docs etc.

Actual behavior

grafik
grafik

@alkatar21 alkatar21 changed the title Duplicated output after some time [Bug] Duplicated output after some time Jul 11, 2022
@alkatar21 alkatar21 changed the title [Bug] Duplicated output after some time [Bug] Duplicated suggestions, typehints, docs etc. Jul 11, 2022
@judej judej added the needs investigation Could be an issue - needs investigation label Jul 11, 2022
@github-actions github-actions bot removed the triage label Jul 11, 2022
@bschnurr bschnurr self-assigned this Jul 11, 2022
@bschnurr
Copy link
Member

are you using "open folder" ?

@joel-kelly
Copy link

Yes, it still occurs for me with a folder open:
bug still present with folder open

@bschnurr
Copy link
Member

bschnurr commented Aug 2, 2022

work around for the double hint. in settings.json

"python.pylanceLspNotebooksEnabled": true

@Nufflee
Copy link

Nufflee commented Aug 3, 2022

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.

@bschnurr
Copy link
Member

#3017 should be fixed now

@bshoshany
Copy link

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!

@debonte
Copy link
Contributor

debonte commented Sep 8, 2022

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.

@debonte debonte closed this as not planned Won't fix, can't repro, duplicate, stale Sep 8, 2022
@cyclux
Copy link

cyclux commented Nov 5, 2022

Problem still exists. See #3042 Manual setting of python.pylanceLspNotebooksEnabled: true solved it for me.

@jackHedaya
Copy link

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.

@rchiodo
Copy link
Contributor

rchiodo commented Nov 11, 2022

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

Then that means your jupyter extension is old.

@jackHedaya
Copy link

jackHedaya commented Nov 11, 2022 via email

@rchiodo
Copy link
Contributor

rchiodo commented Nov 11, 2022

You may have replied through e-mail. The image wasn't posted to github.

@rchiodo
Copy link
Contributor

rchiodo commented Nov 11, 2022

The real thing to check is your version of the Jupyter extension though. Make sure it's the latest.

@jackHedaya
Copy link

jackHedaya commented Nov 11, 2022 via email

@rchiodo
Copy link
Contributor

rchiodo commented Nov 11, 2022

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

@jackHedaya
Copy link

Great! Thank you for the quick responses!

@henrique-raiol
Copy link

I updated to version v2022.11.40 and the problem still exists :(
I only solved it by adding "python.pylanceLspNotebooksEnabled": true

@debonte
Copy link
Contributor

debonte commented Dec 2, 2022

@4phrs do you have the latest prerelease version of the Jupyter extension installed?

See #3027 (comment) above.

@henrique-raiol
Copy link

@debonte thanks for answering. I switched to pre-release version of Jupyter (v2022.11.1003301027), but the Python kernel is gone.
jupyter_prere

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

pylance_corrigido

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs investigation Could be an issue - needs investigation
Projects
None yet
Development

No branches or pull requests