NeoVim ugly text next to variable assignment

huangapple go评论76阅读模式
英文:

NeoVim ugly text next to variable assignment

问题

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

这段文字可能来自 coc-nvim 提供的自动补全功能。

英文:

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?

答案1

得分: 3

以下是要翻译的内容:

这些是推断出的类型提示。

如果你想要停用它们,可以这样做:

  1. 转到你的 coc-settings.json
  2. 添加 "inlayHint.enable": false

查看:h coc-inlayHint:h coc-config-inlayHint以获取更多信息。

英文:

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

huangapple
  • 本文由 发表于 2023年5月29日 18:23:18
  • 转载请务必保留本文链接:https://go.coder-hub.com/76356513.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定