Cbr
Cbr

Reputation: 43

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.

Upvotes: 4

Views: 2576

Answers (2)

Adam Arutyunov
Adam Arutyunov

Reputation: 95

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).

Upvotes: 6

Igbanam
Igbanam

Reputation: 6082

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

Upvotes: 4

Related Questions