prettier-vscode: Format on save slow

Summary

I’m not sure if this is due to ESLint, VSCode, Prettier, or some other extension. Even a small file of 100 lines of code is taking more than a second to format.

Github Repository to Reproduce Issue

Link to a Github repo that can be used to reproduce the issue.

Steps To Reproduce:

  1. Have 100+ lines of code

VS Code Version:

Version: 1.76.2 (system setup) Commit: ee2b180d582a7f601fa6ecfdad8d9fd269ab1884 Date: 2023-03-14T17:55:54.936Z Electron: 19.1.11 Chromium: 102.0.5005.196 Node.js: 16.14.2 V8: 10.2.154.26-electron.0 OS: Windows_NT x64 10.0.19044 Sandboxed: No

Prettier Extension Version: 9.12.0

OS and version: Windows 10 Home OS Build 19044.2846

Prettier Log Output

["INFO" - 10:15:21 AM] Extension Name: esbenp.prettier-vscode.
["INFO" - 10:15:21 AM] Extension Version: 9.12.0.
["INFO" - 10:15:27 AM] Formatting file:<REMOVED PATH>/IncidentCreate.vue
["INFO" - 10:15:27 AM] Using config file at '<REMOVED PATH>\package.json'
["INFO" - 10:15:27 AM] Using ignore file (if present) at <REMOVED PATH>\.prettierignore
["INFO" - 10:15:27 AM] File Info:
{
  "ignored": false,
  "inferredParser": "vue"
}
["INFO" - 10:15:27 AM] Detected local configuration (i.e. .prettierrc or .editorconfig), VS Code configuration will not be used
["INFO" - 10:15:27 AM] Prettier Options:
{
  "filepath": "<REMOVED PATH>\\\IncidentCreate.vue",
  "parser": "vue",
  "endOfLine": "lf",
  "arrowParens": "always",
  "bracketSameLine": true,
  "bracketSpacing": true,
  "embeddedLanguageFormatting": "auto",
  "htmlWhitespaceSensitivity": "css",
  "insertPragma": false,
  "jsxSingleQuote": false,
  "printWidth": 80,
  "proseWrap": "preserve",
  "quoteProps": "as-needed",
  "requirePragma": false,
  "semi": true,
  "singleQuote": true,
  "tabWidth": 2,
  "trailingComma": "es5",
  "useTabs": false,
  "vueIndentScriptAndStyle": false
}
["INFO" - 10:15:36 AM] Formatting completed in 8678ms.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 10
  • Comments: 19 (2 by maintainers)

Most upvoted comments

I’m having the same problem on windows 11 running WSL with ubuntu. Prettier is causing everything to slow down, including ctrl + space options not showing up

Same for me, on Windows 10 and Ubuntu And it’s not only on save, it seems to slow down my workflow making vscode loading before saving a file… It started yesterday. Im’ trying to disable prettier but it seems to be this extension that’s causing the issue.

Same for me, taking too long time to save files and sometimes vscode even crashes.

MacBook Pro 14, M1 Pro Version: 1.77.3 (Universal) Commit: 704ed70d4fd1c6bd6342c436f1ede30d1cff4710 Date: 2023-04-12T09:19:37.325Z Electron: 19.1.11 Chromium: 102.0.5005.196 Node.js: 16.14.2 V8: 10.2.154.26-electron.0 OS: Darwin arm64 22.4.0 Sandboxed: No

30+ seconds for me

Saving works fine and is instant when I disable prettier

vue-tools-slow

Me too (6-8 seconds)

8secs for me 😦

This just started today for me, too. Haven’t had an issue with this in the past, but I’m seeing ~2s activation time on every save.