redhat-developer / redhat-developer/vscode-java

Format document doesn't work when document is not saved

Open
#3,716 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
2.3k
Forks
546
Avg merge
20h 1m
Merged PRs (30d)
11

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file or test is named in the report. Start by reproducing the formatting failure in a new, unsaved Java document on the stated VS Code setup, then trace the format-document entry point; done means the same Java code formats successfully before it is saved.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, vscode
Domain
developer-experience
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.