Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Code bracket auto completion

This has been annoying me for a while. VSCode doesn't let me type a closing bracked or parenthesis or the like ( ")", "]", "}") when there is already a closing symbol of the same type.

In this WEBM you see me try to set another set of brackets and VSCode skips the closing bracket that I typed. This is extremely annoying. WEBM

How do I disable this behaviour in VSCode? (Or correct it, so VSCode closes the inner bracket for me.)

Edit: I know I can disable auto closing brackets in VSCode with "editor.autoClosingBrackets": false. But I don't want to disable it altogether. I just want to disable the overtyping.

like image 542
kett Avatar asked Apr 09 '18 09:04

kett


People also ask

How do I enable auto completion in VS Code?

You can trigger IntelliSense in any editor window by typing Ctrl+Space or by typing a trigger character (such as the dot character (.) in JavaScript).

How do I change auto complete in Visual Studio?

Or you can also set the IntelliSense completion mode to Tab-only: Tools > Options > Text Editor > Advanced > Default IntelliSense completion mode: > select Tab-only in the dropdown.

Does Visual Studio code have autocomplete?

Think gray text autocompletion that you see when typing emails but for code. This feature is available in Visual Studio 2022.


2 Answers

I face the same issue, It's because of the GIT COPILOT once I uninstall and restart the VS CODE it's working properly now

like image 170
Asharu Ashkar Avatar answered Oct 21 '22 18:10

Asharu Ashkar


TL;DR: As of June 2019, it's not possible to disable only the overtyping part of the autocloseBrackets function. You can only disable auto bracket closing altogether.

Some people suggest using the TabOut Extension for Visual Studio Code to tab out of quotes, brackets, etc.


Ok, so what I found out over at the VSC Github is this:

[...] This can be turned off via editor.autoClosingBrackets. The feature consists of multiple parts:

  • one is that when ( is typed, the result is (|).

  • the other part that is hit here, is that when ) is typed and ) follows the cursor, ) will be overtyped.

The feature is implemented language agnostic and looks only locally at the next character. It does not count brackets to determine if the code is "bracket unbalanced".

(Source: https://github.com/Microsoft/vscode/issues/35799)

At the moment, it's not possible to fix this, without losing the auto bracket closing feature. The above thread has since been closed. New one is here: https://github.com/Microsoft/vscode/issues/37315 , but no patch has come out yet.

like image 38
kett Avatar answered Oct 21 '22 18:10

kett