1

Using NeoVim, I created a Python file for a new project, and noticed that now when I declare a new variable, and go back to normal mode, a text appears looking like this:

a = 1 : Literal[1]
b = 'hello' : Literal['hello']
c = ['a', 'random', 'list'] : list[str]

I am not sure it comes from that, but I use coc-nvim for autocompletion.

Where does this text come from?

snakecharmerb
  • 47,570
  • 11
  • 100
  • 153
Droidux
  • 146
  • 2
  • 12

1 Answers1

3

Those are inferred type hints.

If you want to deactivate them this is what you can do:

  1. Go to your coc-settings.json
  2. Add "inlayHint.enable": false

Check :h coc-inlayHint and :h coc-config-inlayHint for more

Rico
  • 141
  • 5