Auto formatting for opening brackets in vscode stopped working TS/JS

33 views Asked by At

When declaring a function or if statement in javascript or typescript file vscode stopped "opening" up the brackets on enter. So when the marker is between the brackets and i hit enter on the following exampels it just adds a new line.

// pipe symbol is the marker
const myFunction = () => {|}

// expected result
const myFunction = () => {
  |
}

// result I get
const myFunction = () => {
|}

// same thing eg. if statements
if (...) {|}

// expected result
if (...) {
  |
}

// result I get
if (...) {
|}
  • I have prettier as default formatter
  • Formatting work "on save" or "shift+alt+f" (Windows) so Prettier works.
  • I have setting for autoIndent = "full"
  • I have vscode synced to another computer that now have the same issue.
  • I have uninstalled and reinstalled Prettier

The issue is maybe a week old, I cannot recall changing any settings or installing any new extensions. But some how I must have messed it up :/

Any idéas out there?

Some updates

Help: About

Version: 1.81.1 (user setup)
Commit: 6c3e3dba23e8fadc360aed75ce363ba185c49794
Date: 2023-08-09T22:22:42.175Z
Electron: 22.3.18
ElectronBuildId: 22689846
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Windows_NT x64 10.0.19045

TypeScript: Select TypeScript Version... Use vscode´s version 5.1.6

  • I have tried to disable prettier
  • It is the same issue in both js and ts files
  • Same issue if I reload vscode with all extensions disabled
0

There are 0 answers