pylance-release icon indicating copy to clipboard operation
pylance-release copied to clipboard

[Bug] Duplicated suggestions, typehints, docs etc.

Open alkatar21 opened this issue 3 years ago • 4 comments

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 avatar Jul 11 '22 11:07 alkatar21

are you using "open folder" ?

bschnurr avatar Jul 28 '22 22:07 bschnurr

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

joel-kelly avatar Jul 28 '22 23:07 joel-kelly

work around for the double hint. in settings.json

"python.pylanceLspNotebooksEnabled": true

bschnurr avatar Aug 02 '22 18:08 bschnurr

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.

Nufflee avatar Aug 03 '22 19:08 Nufflee

https://github.com/microsoft/pylance-release/issues/3017 should be fixed now

bschnurr avatar Aug 11 '22 18:08 bschnurr

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!

bshoshany avatar Aug 27 '22 03:08 bshoshany

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 avatar Sep 08 '22 05:09 debonte

Problem still exists. See https://github.com/microsoft/pylance-release/issues/3042 Manual setting of python.pylanceLspNotebooksEnabled: true solved it for me.

cyclux avatar Nov 05 '22 01:11 cyclux

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.

jackHedaya avatar Nov 11 '22 18:11 jackHedaya

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.

rchiodo avatar Nov 11 '22 19:11 rchiodo

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

jackHedaya avatar Nov 11 '22 19:11 jackHedaya

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

rchiodo avatar Nov 11 '22 19:11 rchiodo

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

rchiodo avatar Nov 11 '22 19:11 rchiodo

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

jackHedaya avatar Nov 11 '22 19:11 jackHedaya

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

rchiodo avatar Nov 11 '22 20:11 rchiodo

Great! Thank you for the quick responses!

jackHedaya avatar Nov 11 '22 20:11 jackHedaya

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

henrique-raiol avatar Dec 02 '22 22:12 henrique-raiol

@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 avatar Dec 02 '22 23:12 debonte

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

henrique-raiol avatar Dec 03 '22 11:12 henrique-raiol