Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Backticks in JavaScript file not auto closing in VSCode

When I am editing a JavaScript file inside VSCode and try using the backticks (`) it won't auto close. I want to have the same auto-closing feature that I have with the quotation marks, where if I type " I get:

"|"

(| = my cursor)

I have tried disabling all my extensions and that didn't solve it. If I try it inside Atom it works just fine.I'm using a Belgian keyboard layout on Mac.

A now-deleted answer referred to this fixed bug, but unfortunately for me, typing a space after the backtick (as described in the fix) just leaves me with a backtick and a space.

like image 370
Thiebe Avatar asked Sep 12 '25 15:09

Thiebe


1 Answers

I haven't tried to find a way around this, but at least on my system (set to German) the behavior described seems to come from the fact that by default the backtick (`) is a dead key, meaning it will not produce a character until the next key is hit. Funnily enough, the backtick that you see on screen is thus actually created because VSCode tries to auto-complete the backtick (with another backtick), but the initial character is swallowed (because there is no such thing as an accented accent, which is what that key is generally used for).

If I type a space after the backtick, it gets auto-completed though. Running VSCode 1.36.0 on MacOS.

I hope my explanation is clear enough.

like image 166
Smoerrebroed Avatar answered Sep 14 '25 03:09

Smoerrebroed