【问题标题】:Disable hover hint for python keyword in VSCode在 VSCode 中禁用 python 关键字的悬停提示
【发布时间】:2022-01-09 22:18:39
【问题描述】:

我想禁用 python 关键字的悬停提示(例如导入),但保留 linter 消息。我怎样才能做到这一点?

更新:settings.json

{
  "python.pythonPath": "venv/bin/python",
  "python.formatting.provider": "black",
  "python.linting.enabled": true,
  "python.linting.pylintEnabled": false,
  "python.jediEnabled": false,
  "python.linting.flake8Enabled": true,
  "python.languageServer": "Jedi",
}

【问题讨论】:

  • 对不起,有点奇怪,我无法得到import的提示。您是否在 settings.json 中配置了某些内容以及您选择了哪个 python 解释器?
  • @Steven-MSFT 默认出现。我现在有版本 1.61.2(从 gi​​thub assets 下载)。以前我有最新的 1.63(pylint 消息不会出现在 1.63 中)。

标签: python visual-studio-code


【解决方案1】:

Jedi语言服务器提供,你可以用Pylance代替它:

"python.languageServer": "Pylance",

【讨论】:

  • 它可以工作,但现在 vscode 要求在每次启动时都安装pylance,但我想这是一个单独的问题
【解决方案2】:

Mac OS 的快速解决方案: 前往

Settings 的 VS 代码 --> type 'Hover" in search settings box --> 取消选中 Editor > Hover: Enabled 的复选框 如果有任何语法错误,这也是保留 linter 消息。

已有解决方案,请参考以下网址

Disable tooltip hint in Visual Studio Code

请看截图:

【讨论】:

  • 它将禁用所有工具提示消息。我想保留来自 linter 的消息
猜你喜欢
  • 1970-01-01
  • 2019-05-18
  • 2021-12-10
  • 2017-05-08
  • 2020-12-03
  • 2020-08-07
  • 2018-12-08
  • 2011-02-25
  • 2015-11-23
相关资源
最近更新 更多