Microsoft/vscode

[json] builtin json formatter doesn't support format-on-paste

Open

#228,528 创建于 2024年9月13日

在 GitHub 查看
 (0 评论) (0 反应) (1 负责人)TypeScript (10,221 fork)batch import
feature-requestformattinghelp wantedjson

仓库指标

Star
 (74,848 star)
PR 合并指标
 (平均合并 11小时 43分钟) (30 天内合并 1,000 个 PR)

描述

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.94.0-insider (Universal)
  • OS Version: Darwin x64 23.6.0

Steps to Reproduce:

  1. Enable editor.formatOnPaste and editor.formatOnSave and set editor.defaultFormatter to "vscode.json-language-features" for json files.
  2. Paste a line into a json file that is not indented correctly.

Result: The pasted line is not formatted on paste, but is formatted once the file is saved. If the same steps are tried with another file type such as TypeScript the pasted line is formatted as expected.

https://github.com/user-attachments/assets/3dc9499a-4288-49ce-848c-5300b7d99293

贡献者指南