Ari*_*zon 8 c++ intellisense visual-studio-code
我发现来自 VS Code 中 C++ 扩展的大多数建议/智能感知都很有用。但在某些情况下,函数参数的特定弹出窗口可能会分散注意力。
如何将其关闭(不禁用其他建议/智能感知功能)?
Ben*_*est 10
这是IntelliSense的一部分。如果您不想要弹出窗口,可以通过以下几个选项来摆脱它:
\n当您想摆脱弹出窗口时,请按退出键。如果您希望自动完成某些内容/提出建议,但您希望保留其他代码片段,那么这会很有帮助。
\nVisual Studio IDE 和 Visual Studio Code 之间的步骤有所不同,我想在此处提供两者的说明。
\nTools > Options。Text Editor在左侧窗格中选择。IntelliSense. 对于 C/C++,选择Advanced并滚动到该IntelliSense部分。Show completion list after a character is typed以禁用它。对于 C/C++,您将有几个选项,例如Disable Auto Updating、Disable Squiggles和Disable #include \xe2\x80\x9cAuto Complete。将其中任何一个设置为 \xe2\x80\x9cTrue\xe2\x80\x9d 将其关闭。您也可以在 VS Code 中禁用自动完成功能,但说明与上面提到的 Visual Studio IDE 不同。以下是您可以在 VS Code 中为 IntelliSense 设置的设置settings.json,其中包括用于启用/禁用 IntelliSense 某些部分的设置:
{\n // Controls if quick suggestions should show up while typing\n "editor.quickSuggestions": {\n "other": true,\n "comments": false,\n "strings": false\n },\n\n // 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.\n "editor.acceptSuggestionOnCommitCharacter": true,\n\n // 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\n "editor.acceptSuggestionOnEnter": "on",\n\n // Controls the delay in ms after which quick suggestions will show up.\n "editor.quickSuggestionsDelay": 10,\n\n // Controls if suggestions should automatically show up when typing trigger characters\n "editor.suggestOnTriggerCharacters": true,\n\n // Controls if pressing tab inserts the best suggestion and if tab cycles through other suggestions\n "editor.tabCompletion": "on",\n\n // Controls whether sorting favours words that appear close to the cursor\n "editor.suggest.localityBonus": true,\n\n // Controls how suggestions are pre-selected when showing the suggest list\n "editor.suggestSelection": "recentlyUsed",\n\n // Enable word based suggestions\n "editor.wordBasedSuggestions": true,\n\n // Enable parameter hints\n "editor.parameterHints.enabled": true,\n}\nRun Code Online (Sandbox Code Playgroud)\n如果您想完全禁用代码完成,只需将所有内容设置editor.quickSuggestions为false。
要仅禁用函数参数建议,请"editor.parameterHints.enabled": false在您的settings.json.