question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Variable type on hover not showing up with JediLSP

See original GitHub issue

Environment data

  • Version: 1.56.0
  • Date: 2021-05-04T22:06:21.189Z (2 days ago)
  • Electron: 12.0.4
  • Chrome: 89.0.4389.114
  • Node.js: 14.16.0
  • OS: Darwin x64 20.4.0
  • Type of virtual environment used: venv
  • Relevant/affected Python packages and their versions: mypy
  • Relevant/affected Python-related VS Code extensions and their versions: MS-Python, GitLens
  • Value of the python.languageServer setting: jedi (default)

Expected behaviour

Variable type pops up in a small box on hover.

Actual behaviour

Only function definitions pop up on hover, variables do not pop up except with CMD + hover (in which case the full variable definition is shown).

Steps to reproduce:

  1. Install VSCode on MacOS
  2. Install MS-Python and GitLens extensions
  3. Set mypy as the linter (although I disabled it and it’s the same)

I’ve actually been having this problem on VSCode Insiders for a few weeks now. I kept updating it in hope of being resolved, and finally I uninstalled it and installed the fresh mainstream version, but nothing changed.

Never had this problem on Windows (same extensions).

Sometimes switching between the language servers would make it work but then immediately break on jedi. Pylance works fine in this aspect, but I don’t want to use pylance because it gives too many false warnings.

I have a feeling something is wrong with jedi because sometimes it would also give errors on python builtins (logging, datetime and what not).

Logs

I don’t know where the extensions and language servers log output.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9

github_iconTop GitHub Comments

1reaction
dorinclisucommented, May 13, 2021

Because Pylance is not yet smart enough to analyze accross multiple files the way jedi did, I had to override the following

I take this back, it wasn’t a problem of pylance because it simply had no way to determine where the modules are called from. So I got rid of any false warnings by setting Python › Analysis: Extra Paths properly (usually you want that to be the root package).

Actually I’m already loving Pylance as its type assistance is better, the only downside is that it colorizes everything in green on the Monokai theme… But I’m already taking this issue offtopic 😃

1reaction
kimadelinecommented, May 13, 2021

Thank you for sharing that you managed to find a a workaround using Pylance for now 🙂 Even though it is the default language server, you can override this by selecting the language server of your choice. The Jedi language server option will be replaced by JediLSP in the future, so we still need to investigate this issue, and see whether it is caused upstream, or if it’s a problem in the extension.

Read more comments on GitHub >

github_iconTop Results From Across the Web

LSP - Show variable-type on hover : r/neovim - Reddit
LSP - Show variable-type on hover. Is this possible somehow? I couldn't find anything about the topic. That's one of the features I...
Read more >
Hover over variables no longer show the debug value.
I have a problem since 24/11/2021 where in visual studio 2022 and in visual studio 2019 during a debug session the variables are...
Read more >
jedi-language-server - PyPI
A language server for Jedi!
Read more >
How to display variable type when hovering in Visual Studio
When hovering over a variable when the program is not running, a pop-up appears showing the variable type and name.
Read more >
https://raw.githubusercontent.com/emacs-lsp/lsp-mo...
:group 'lsp-mode :type '(choice (const :tag "No limit. ... This option can also be used as a file- or directory-local variable to disable...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found