Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to disable coc-pyright type annotations in vim?

I use Vim 9.0.105 and python3.9.5 and I'm on WSL2 with Ubuntu20.04

Like I say in the Title, I have an issue with coc-pyright which when I write variables coc-pyright automatically "write" the type annotation. Here is a little example

The problem is that the annotations are not really written, they are just displayed, so there is a gap between the cursor and what I write when I want to modify or something.

Is there a way to disable the completions of annotations ? Because I haven't find any.

Thank you for your help and sorry for my bad English. If I haven't explained something well, don't hesitate to tell me.

like image 732
Cbr Avatar asked Oct 23 '25 17:10

Cbr


2 Answers

Note that for the newer versions of coc-pyright you have to disable three separate hint options:

{
  "pyright.inlayHints.functionReturnTypes": false,
  "pyright.inlayHints.variableTypes": false,
  "pyright.inlayHints.parameterTypes": false
}

Source: coc-pyright (As for Aug 2024).

like image 120
Adam Arutyunov Avatar answered Oct 26 '25 09:10

Adam Arutyunov


Open :CocConfig, set pyright.inlayHints.enable: false

like image 34
Igbanam Avatar answered Oct 26 '25 11:10

Igbanam