c++ - 如何在具有 C++ 扩展名的 VS 代码中禁用函数参数的弹出建议
解决方案
这是IntelliSense的一部分。如果您不想要它,您有几个选项可以摆脱弹出窗口:
关闭弹出窗口
当您想摆脱弹出窗口时按退出键。如果您希望某些事情自动完成/提出建议,但您希望不理会其他代码片段,这将是有益的。
完全禁用
Visual Studio IDE 和 Visual Studio Code 之间的步骤不同,我想在此处提供两者的说明。
Visual Studio (devenv.exe)
- 去
Tools > Options
。 Text Editor
在左侧窗格中选择。- 选择您正在使用的语言(在您的情况下,这是 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)
您也可以在 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
.
推荐阅读
- php - 检查三维数组PHP中的所有重复值
- php - 无法更改 PHPPowerpoint 幻灯片的宽度和高度
- react-native - 如何在本机反应中调用函数?
- php - 在php中使用break(新行)回显变量
- c++ - 如何使用构造函数中的初始化程序设置具有相同值的二维数组?
- r - 使用 rlm 计算稳健回归的 r 平方是否合适
- snowflake-cloud-data-platform - PIVOT 无法识别用引号括起来的列
- react-native - 如何像 Way of Life App 一样在 React Native 上水平滚动日历。您可以通过链接查看视频
- python - “-e”是什么意思。在aws cdk的requirements.txt中?
- angular - 如何将 MatPaginator 初始化为 @ViewChild 成员变量?