prettier / prettier-vscode

Visual Studio Code extension for Prettier
https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode
MIT License
5.03k stars 447 forks source link

Prettier doesn't appear in the list of formatters #3375

Open Arsik0153 opened 2 weeks ago

Arsik0153 commented 2 weeks ago

Summary

I am trying to format js/ts/jsx/tsx file but Prettier doesn't appear in the list of formatters in VSCode.

Steps To Reproduce:

  1. Open any .js/.ts/.tsx/.jsx file in vscode
  2. Click Ctrl + Shift + P and write "Format document"

Expected result

Prettier extension should appear on the list

Actual result

There's only "vscode.typescript-language-features" item on the list

Additional information

image

I also tried to set "editor.defaultFormatter": "esbenp.prettier-vscode" in settings.json, but this didn't help. With that, in notifications tab i get error message: Extension 'Prettier - Code formatter' is configured as formatter but it cannot format 'TypeScript JSX'-files

This behavior started when I reinstalled my Windows 10. Before reinstallation, it worked perfectly. I already tried clean installation of VSCode 2 times (includes removing Code folder in %appdata% and all extensions) but it still doesn't seem to be working.

I enabled logging of Prettier but I am stillunable to provide logs, because only thing I see from Prettier tab is: image

VS Code Version: Version: 1.88.1 (user setup) Commit: e170252f762678dec6ca2cc69aba1570769a5d39 Date: 2024-04-10T17:41:02.734Z Electron: 28.2.8 ElectronBuildId: 27744544 Chromium: 120.0.6099.291 Node.js: 18.18.2 V8: 12.0.267.19-electron.0 OS: Windows_NT x64 10.0.19045

Prettier Extension Version: 10.4.0

OS and version: Windows 10 x64 22H2. Build 19045.4291 Project located in WSL2 folder