Ariel Gabizon
Ariel Gabizon

Reputation: 3281

How do I disable pop-up suggestion for function arguments in VS code with C++ extension

I found most of the suggestions/intellisense coming from the C++ extension in VS code useful. But the specfic pop-up for function arguments can be distracting in some cases.

How do I turn it off (without disabling other suggestions/intellisense features)?

enter image description here

Upvotes: 9

Views: 10463

Answers (1)

codewario
codewario

Reputation: 21418

This is part of IntelliSense. You have a few options to rid yourself of the popup if you don't want it:

Dismiss the popup

Press escape when you want to get rid of the popup. Beneficial if you want some things to autocomplete/make suggestions, but other pieces of code you want left alone.


Disable completely

The steps differ between the Visual Studio IDE and Visual Studio Code, and I wanted to provide instructions for both here.

Visual Studio (devenv.exe)

  1. Go to Tools > Options.
  2. Select Text Editor in the left pane.
  3. Select the language you are using (in your case this is C++ but you can turn this off for other languages too).
  4. For C# and Basic, pick IntelliSense. For C/C++, choose Advanced and scroll to the IntelliSense section.
  5. For C# and Basic, check the Show completion list after a character is typed to disable it. For C/C++, you will have a few options, such as Disable Auto Updating, Disable Squiggles, and Disable #include “Auto Complete. Set any of these to “True” to turn them off.

Visual Studio Code (code.exe)

You can disable autocomplete in VS Code as well, but the instructions differ from the Visual Studio IDE mentioned above. Here are the settings you can set for IntelliSense in your VS Code settings.json, which includes settings for enabling/disabling certain portions of 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,
}

If you want to outright disable code completion altogether, just set everything under editor.quickSuggestions to false.

To disable only the function argument suggestion, set "editor.parameterHints.enabled": false in your settings.json.

Upvotes: 11

Related Questions