redhat-developer / redhat-developer/vscode-java

Format document doesn't work when document is not saved

未关闭
#3,716 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
TypeScript
星标
2.3k
派生
546
平均合并
20 小时 1 分钟
30 天内合并 PR
11

描述

Formatting the document does not work when the document is not saved to disk.

Environment
  • Operating System: Windows 11
  • JDK version: 11
  • Visual Studio Code version: 1.91.1
  • Java extension version: v1.32.0
Steps To Reproduce
  1. File >> New Text File
  2. Put some Java code in the new document that would be changed by formatting. If the language mode is not automatically detected as Java, set it manually.
  3. Right-click anywhere in the document and click Format document.
Current Result

Nothing happens.

Expected Result

The code gets formatted.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

报告中没有指定文件或测试。首先,在所述的 VS Code 设置下的新建未保存 Java 文档中复现格式化失败,然后跟踪 format-document 入口点;当同一段 Java 代码在保存前能够成功格式化时,即可视为完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
java, vscode
领域
developer-experience
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。