gpt4 book ai didi

c++ - 如何在带有 C++ 扩展的 VS 代码中禁用函数参数的弹出建议

转载 作者:行者123 更新时间:2023-12-04 00:57:33 25 4
gpt4 key购买 nike

我发现来自 VS 代码中的 C++ 扩展的大部分建议/智能感知都很有用。
但是在某些情况下,函数参数的特定弹出窗口可能会分散注意力。

如何关闭它(不禁用其他建议/智能感知功能)?

enter image description here

最佳答案

这是 IntelliSense 的一部分.您有 a few options如果您不想要它,请摆脱弹出窗口:
关闭弹出窗口
当您想摆脱弹出窗口时,请按 Esc 键。如果您希望某些内容自动完成/提出建议,但希望保留其他代码片段,则很有用。

完全禁用
Visual Studio IDE 和 Visual Studio Code 的步骤不同,我想在此处提供两者的说明。
Visual Studio (devenv.exe)

  • 转至 Tools > Options .
  • 选择 Text Editor在左 Pane 中。
  • 选择您正在使用的语言(在您的情况下,这是 C++,但您也可以为其他语言关闭此功能)。
  • 对于 C# 和 Basic,选择 IntelliSense .对于 C/C++,选择 Advanced并滚动到 IntelliSense部分。
  • 对于 C# 和 Basic,检查 Show completion list after a character is typed禁用它。对于 C/C++,您将有几个选项,例如 Disable Auto Updating , Disable Squiggles , 和 Disable #include “Auto Complete .将其中任何一个设置为“True”以关闭它们。

  • Visual Studio 代码 (code.exe)
    您可以 disable autocomplete in VS Code同样,但说明与上面提到的 Visual Studio IDE 不同。以下是您可以在 VS Code 中为 IntelliSense 设置的设置 settings.json ,其中包括用于启用/禁用 IntelliSense 某些部分的设置:
    {
    // Controls if quick suggestions should show up while typing
    "editor.quickSuggestions": {
    "other": true,
    "comments": false,
    "strings": false
    },

    // Controls whether suggestions should be accepted on commit characters. For example, in JavaScript, the semi-colon (`;`) can be a commit character that accepts a suggestion and types that character.
    "editor.acceptSuggestionOnCommitCharacter": true,

    // Controls if suggestions should be accepted on 'Enter' - in addition to 'Tab'. Helps to avoid ambiguity between inserting new lines or accepting suggestions. The value 'smart' means only accept a suggestion with Enter when it makes a textual change
    "editor.acceptSuggestionOnEnter": "on",

    // Controls the delay in ms after which quick suggestions will show up.
    "editor.quickSuggestionsDelay": 10,

    // Controls if suggestions should automatically show up when typing trigger characters
    "editor.suggestOnTriggerCharacters": true,

    // Controls if pressing tab inserts the best suggestion and if tab cycles through other suggestions
    "editor.tabCompletion": "on",

    // Controls whether sorting favours words that appear close to the cursor
    "editor.suggest.localityBonus": true,

    // Controls how suggestions are pre-selected when showing the suggest list
    "editor.suggestSelection": "recentlyUsed",

    // Enable word based suggestions
    "editor.wordBasedSuggestions": true,

    // Enable parameter hints
    "editor.parameterHints.enabled": true,
    }
    如果您想完全禁用代码完成功能,只需在 editor.quickSuggestions 下设置所有内容即可。至 false .
    要仅禁用函数参数建议,请设置 "editor.parameterHints.enabled": false在您的 settings.json .

    关于c++ - 如何在带有 C++ 扩展的 VS 代码中禁用函数参数的弹出建议,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61249878/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com