Prettier-vscode: Running slow on `save Participants`

Created on 18 Feb 2020  路  9Comments  路  Source: prettier/prettier-vscode

Summary

VsCode Prettier extension is slowing down onSave.

Github Repository to Reproduce Issue

https://github.com/prettier/prettier-vscode

Steps To Reproduce:

  1. Open vscode
  2. Add the formatOnSave option
  3. Install latest extension from prettier. Activate it.
  4. Open a js file.
  5. Save.

Expected result

Saving should have been instant.

Actual result

Saving can take up to a minute.

Additional information

Screenshot 2020-02-18 at 12 11 47

VS Code Version: 1.42.1

Prettier Extension Version: 3.20.0

OS and version: macOS Mojave 10.14.6

Prettier Log Output


["INFO" - 12:16:31 PM] Extension Name: "prettier-vscode".
["INFO" - 12:16:31 PM] Extension Version: "3.20.0".
["INFO" - 12:16:31 PM] Loaded module '[email protected]' from '/Users/cardomar/Web/uxf-sple-tf/node_modules/prettier/index.js'
["INFO" - 12:16:31 PM] Enabling prettier for languages
[
  "css",
  "graphql",
  "html",
  "javascript",
  "javascriptreact",
  "json",
  "json5",
  "jsonc",
  "less",
  "markdown",
  "mdx",
  "mongo",
  "postcss",
  "scss",
  "typescript",
  "typescriptreact",
  "vue",
  "yaml"
]
["INFO" - 12:16:31 PM] Enabling prettier for range supported languages
[
  "graphql",
  "javascript",
  "javascriptreact",
  "json",
  "typescript",
  "typescriptreact"
]
["INFO" - 12:16:34 PM] Formatting /Users/cardomar/Web/uxf-sple-tf/src/sple/resources/run-export-webview.js
["INFO" - 12:16:34 PM] Using ignore file (if present) at /Users/cardomar/Web/uxf-sple-tf/.prettierignore
["INFO" - 12:16:34 PM] Loaded module '[email protected]' from '/Users/cardomar/Web/uxf-sple-tf/node_modules/prettier/index.js'
["INFO" - 12:16:34 PM] File Info:
{
  "ignored": false,
  "inferredParser": "babel"
}
["INFO" - 12:16:34 PM] Detected local configuration (i.e. .prettierrc or .editorconfig), VS Code configuration will not be used
["INFO" - 12:16:34 PM] Prettier Options:
{
  "filepath": "/Users/cardomar/Web/uxf-sple-tf/src/sple/resources/run-export-webview.js",
  "parser": "babel",
  "useTabs": false,
  "tabWidth": 2,
  "printWidth": 120,
  "endOfLine": "lf",
  "semi": false,
  "singleQuote": true
}
["INFO" - 12:16:34 PM] Loaded module 'prettier-eslint@unknown' from '/Users/cardomar/Web/uxf-sple-tf/node_modules/prettier-eslint/dist/index.js'
["INFO" - 12:16:34 PM] Formatting using 'prettier-eslint'
["INFO" - 12:16:39 PM] Formatting completed in 769.107933ms.
locked need more info

Most helpful comment

I think this should be reopened.

I'm also seeing very long save times recently (probably from when VSCode moved away from the timeout option as referenced by @brombomb). Disabling the prettier extension is the only thing that solves the issue right now.

["INFO" - 9:50:32 PM] Detected local configuration (i.e. .prettierrc or .editorconfig), VS Code configuration will not be used
["INFO" - 9:50:32 PM] Prettier Options:
{
  "filepath": "/Users/....js",
  "parser": "babel",
  "trailingComma": "es5",
  "tabWidth": 2,
  "semi": true,
  "printWidth": 80,
  "singleQuote": false
}
["INFO" - 9:50:32 PM] Loaded module 'prettier-eslint@unknown' from '/Users...'
["INFO" - 9:50:32 PM] Formatting using 'prettier-eslint'
["INFO" - 9:50:43 PM] Formatting completed in 677.137701ms.

Although the logs say that formatting only takes 677ms, the actual time from when I hit cmd+s to Formatting completed.. is 11 seconds.

All 9 comments

I鈥檓 not sure I understand. The formatting took 769ms. Additionally, VSCode times out formatting after 1500ms be default so it shouldn鈥檛 be possible for formatting to take a minute. I鈥檒l need additional information to reproduce this.

@ntotten Not anymore. https://code.visualstudio.com/updates/v1_42#_handling-slow-save-operations

This issue has been automatically closed because there has been no response to our request for more information from the original author. Currently, there is not enough information provided for us to take action. Please reply and reopen this issue if you need additional assistance.

I think this should be reopened.

I'm also seeing very long save times recently (probably from when VSCode moved away from the timeout option as referenced by @brombomb). Disabling the prettier extension is the only thing that solves the issue right now.

["INFO" - 9:50:32 PM] Detected local configuration (i.e. .prettierrc or .editorconfig), VS Code configuration will not be used
["INFO" - 9:50:32 PM] Prettier Options:
{
  "filepath": "/Users/....js",
  "parser": "babel",
  "trailingComma": "es5",
  "tabWidth": 2,
  "semi": true,
  "printWidth": 80,
  "singleQuote": false
}
["INFO" - 9:50:32 PM] Loaded module 'prettier-eslint@unknown' from '/Users...'
["INFO" - 9:50:32 PM] Formatting using 'prettier-eslint'
["INFO" - 9:50:43 PM] Formatting completed in 677.137701ms.

Although the logs say that formatting only takes 677ms, the actual time from when I hit cmd+s to Formatting completed.. is 11 seconds.

Having this issue as well

Having the same issue, saving a css file.

same issue...

got same issue

Same issue right now

Was this page helpful?
0 / 5 - 0 ratings

Related issues

FlorianWendelborn picture FlorianWendelborn  路  3Comments

GantMan picture GantMan  路  3Comments

PetrykowskiM picture PetrykowskiM  路  3Comments

ZiiMakc picture ZiiMakc  路  4Comments

mshehadeh picture mshehadeh  路  4Comments