0

I love the hover for information feature in vscode, and want to keep it enabled. I like what it shows, and I also need it enabled for gitlens.

The problem is that gitlens shows, in addition to the code changes, several dozen paragraphs of information about how python works, depending on how the line that I'm hovering over ends.


For example, if I hover over a piece of code that ends with a colon : character:

if __name__ == '__main__':

I will get the following set of useless text (cropped for readability):

Slicings
********
A slicing selects a range of items in a sequence object (e.g., a string, tuple or list). Slicings may be used as expressions or as targets in assignment or "del" statements. The syntax for a slicing:
...
...

This is preposterous. I'm not interested in slicing, nor does this code pertain to slicing at all.

Here are some screenshots of what I'm dealing with:

top of popup

If you scroll, it just keeps going:

full info popup


How can I fix this, and not show dumb information on how ,, : and { work?

Addison
  • 7,322
  • 2
  • 39
  • 55
  • Probably try changing the language server as suggested by [this thread](https://stackoverflow.com/questions/70645995/disable-hover-hint-for-python-keyword-in-vscode). – metatoaster Sep 19 '22 at 04:25

1 Answers1

1

You can try to install and use Pylance as the language server:

enter image description here

And adding the following code to your settings.json:

"python.languageServer": "Pylance",

Pylance is officially provided by Microsoft, which is more formal and more suitable for vscode. If you want to continue using gitlens, you can refer to this issue and use these codes:

"gitlens.blame.line.enabled": false, // turns of the end of line or hover blame annotations
MingJie-MSFT
  • 5,569
  • 1
  • 2
  • 13