Nvim-lspconfig: Hints don't show in pyright

Created on 20 Dec 2020  路  2Comments  路  Source: neovim/nvim-lspconfig

  • nvim --version: NVIM v0.5.0-dev+950-g5ce328df4

  • nvim-lsp version(commit hash): 1e4a963ba4d00d559247b5fca827142958d4dbdf

  • :checkhealth result
health#lspconfig#check
========================================================================
## Checking language server protocol configuration
  - INFO: rust_analyzer: configuration checked.
  - INFO: pyright: configuration checked.
  - INFO: tsserver: configuration checked.

health#nvim#check
========================================================================
## Configuration
  - OK: no issues found

## Performance
  - OK: Build type: Release

## Remote Plugins
  - OK: Up to date

## terminal
  - INFO: key_backspace (kbs) terminfo entry: key_backspace=\177
  - INFO: key_dc (kdch1) terminfo entry: key_dc=\E[3~
  - INFO: $COLORTERM='truecolor'

health#provider#check
========================================================================
## Clipboard (optional)
  - OK: Clipboard tool found: xclip

## Python 2 provider (optional)
  - WARNING: No Python executable found that can `import neovim`. Using the first available executable for diagnostics.
  - ERROR: Python provider error:
    - ADVICE:
      - provider/pythonx: Could not load Python 2:
          python2 not found in search path or not executable.
          python2.7 not found in search path or not executable.
          python2.6 not found in search path or not executable.
          /usr/bin/python is Python 3.9 and cannot provide Python 2.
  - INFO: Executable: Not found

## Python 3 provider (optional)
  - INFO: `g:python3_host_prog` is not set.  Searching for python3 in the environment.
  - INFO: Executable: /usr/bin/python3
  - INFO: Python version: 3.9.1
  - INFO: pynvim version: 0.4.2
  - OK: Latest pynvim is installed.

## Python virtualenv
  - OK: no $VIRTUAL_ENV

## Ruby provider (optional)
  - WARNING: `ruby` and `gem` must be in $PATH.
    - ADVICE:
      - Install Ruby and verify that `ruby` and `gem` commands work.

## Node.js provider (optional)
  - INFO: Node.js: v15.4.0
  - WARNING: Missing "neovim" npm (or yarn) package.
    - ADVICE:
      - Run in shell: npm install -g neovim
      - Run in shell (if you use yarn): yarn global add neovim

## Perl provider (optional)
  - ERROR: perl provider error:
    - ADVICE:
      - "Neovim::Ext" cpan module is not installed

  • What language server(If the problem is related to a specific language server): pyright
  • Operating system/version: Arch Linux x86_64 5.9.13
  • Terminal name/version: alacritty 0.6.0 (04cbf767)
  • $TERM: alacritty

How to reproduce the problem from neovim startup

import a library in a python file and never use it (e.g. import collections)

Actual behaviour

No "hint" diagnostics shown

Expected behaviour

Should have a "hint" diagnostic saying library is not accessed like shown in https://github.com/neovim/nvim-lspconfig/issues/441#issuecomment-748535461. I tried same behavior using the tsserver and it works. I know that the tsserver is using a "hint" diagnostic because it displays the LspDiagnosticSignHint: "H".

bug

Most helpful comment

It is caused by core and I opened a PR that should fix it: https://github.com/neovim/neovim/pull/13578

All 2 comments

I've confirmed this. I'm not sure what we could be doing, and I'm still leaning towards this being an issue with hints in core rather than how we're initializing pyright (which is really all this repo does). You can compare the options we are sending to the options that lsp-pyright (emacs lsp-mode) is sending.

https://github.com/neovim/nvim-lspconfig/blob/master/lua/lspconfig/pyright.lua

https://github.com/emacs-lsp/lsp-pyright/blob/master/lsp-pyright.el

Maybe this should be overriden to information instead of none? Can you check what the return type is for tsserver?

I don't see anything suspect. Would welcome a PR that fixes this.

It is caused by core and I opened a PR that should fix it: https://github.com/neovim/neovim/pull/13578

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dlukes picture dlukes  路  4Comments

nhooyr picture nhooyr  路  3Comments

mcepl picture mcepl  路  8Comments

justinmk picture justinmk  路  8Comments

mjlbach picture mjlbach  路  8Comments