Niklas Raab
Niklas Raab

Reputation: 1736

Visual Studio Code Intellisense select with typing dot

The intellisense of Visual Studio Code at the moment has following behaviour:

  1. You type something.
  2. Intellisense pops out.
  3. The first entry in intellisense is selected.
  4. By pressing enter, the suggestion is typed into the editor.
  5. Intellisense is closed

In Visual Studio the following behaviour is default:

  1. You type something.
  2. Intellisense pops out.
  3. The first entry in intellisense is selected.
  4. By pressing '.' (Point or Dot), the suggestion is typed into the editor.
  5. Intellisense is closed

Is there any setting who can change to the Visual Studio behaviour?

Upvotes: 3

Views: 2763

Answers (1)

dwelle
dwelle

Reputation: 7286

The confirm-with-. behavior is the default since 1.28. It can be disabled via editor.acceptSuggestionOnCommitCharacter in your settings.json:

"editor.acceptSuggestionOnCommitCharacter": false

The confirm-on-enter behavior can be toggled via editor.acceptSuggestionOnEnter:

"editor.acceptSuggestionOnEnter": "on"

Be sure that you haven't disable Enter hotkey for this, which takes precedence. I.e., open your keybindings.json (Ctrl + Shift + PPreferences: Open Keyboard Shortcuts File), and check that there isn't this:

{
    "key": "enter",
    "command": "-acceptSelectedSuggestionOnEnter",
    "when": "acceptSuggestionOnEnter && suggestWidgetVisible && suggestionMakesTextEdit && textInputFocus"
}

Alternatively, you can add a hotkey for it yourself as an extra measure, if nothing above works (notice the missing - before the command, which differentiates it from the above):

{
    "key": "enter",
    "command": "acceptSelectedSuggestionOnEnter",
    "when": "acceptSuggestionOnEnter && suggestWidgetVisible && suggestionMakesTextEdit && textInputFocus"
}

Upvotes: 7

Related Questions