redhat-developer / redhat-developer/vscode-java
Formatting a java source file results in a weird presentation
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.3k
- Forks
- 546
- Avg merge
- 20h 1m
- Merged PRs (30d)
- 11
Description
After update the extension to version 1.13.0. I get weird code formatting results.
Environment
- Operating System: RockyLinux 8.6
- JDK version: openjdk 17.0.5
- Visual Studio Code version: 1.74.3
- Java extension version: 1.13.0
Steps To Reproduce
- Start of with a file. any file.
- Fiddle around the file ie: putting 2 imports on the same line
- Add some tabs before another import
- run the formatter (right-click and format this document)
Current Result
After Upgrading to 1.13.0

After running the formatter I end up with this

Same formatter output, but with some tabs to show the the indentation isn't aligning properly.

Expected Result
The indentation should always be exact!
Additional Informations
I also have the Spring boot extensions installed.
After updating to version 1.13.0, I get some visual cues that my file contains a Spring Bean.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source files, tests, or entry points are named. Reproduce the formatting case in the stated VS Code, Java extension, JDK, and Rocky Linux environment, then trace the Java formatter integration to identify why imports and indentation are misaligned. Done means formatting produces consistently exact indentation without the reported visual cues.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, vscode
- Domain
- developer-experience, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100