prettier / prettier-vscode

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

Reformatting does not work on .mdx files #3551

Open Signum opened 1 month ago

Signum commented 1 month ago

Summary

Prettier manages to reformat all kinds of files. ".mdx" files however are not formatted.

Github Repository to Reproduce Issue

https://github.com/Signum/prettier-mdx-debug

Steps To Reproduce:

  1. Have the "prettier" extension installed in vscode
  2. Open the index.mdx file in vscode
  3. Press Ctrl+Shift+P
  4. Choose "Format Document"

Expected result

The frontmatter/YAML part should be rewrapped to 120 columns:

hero:
  tagline:
    ISPmail is a free but extensive do-it-yourself guide to help you build a fully-functional mail server from 100%
    open-source components. It is based on Debian GNU/Linux. Light enough for your friends and family. Or powerful
    enough for professional use.

Actual result

The file is not reformatted.

hero:
  tagline:
    ISPmail is a free but extensive do-it-yourself guide to help you build a fully-functional mail server from 100% open-source components. It is based on Debian GNU/Linux. Light enough for your friends and family. Or powerful enough for professional use.

Additional information

VS Code Version: 1.94.2

Prettier Extension Version: v11.0.0

OS and version: Linux Mint 21.3

Hint: When installing prettier with "pnpm install prettier" and running "npx prettier index.mdx" the file gets reformatted properly.

Prettier Log Output

["DEBUG" - 00:00:17] Using bundled version of prettier.
Signum commented 1 month ago

My list of installed extensions (in case the "mdx" extension could interfere for example):