英文:
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
以下是要翻译的内容:
这些是推断出的类型提示。
如果你想要停用它们,可以这样做:
- 转到你的 coc-settings.json
- 添加
"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:
- Go to your coc-settings.json
- Add
"inlayHint.enable": false
Check :h coc-inlayHint
and :h coc-config-inlayHint
for more
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论