redhat-developer / redhat-developer/vscode-java

Bug: Formatter causing some lines get erased

Open
#2,107 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I love to use VSC Java plugin but I had so much pain working with java now.
The reason I like vscode now only for the ui but this plugin is very customisable like a way to line up curly bracket.
Now the "Format Document" is glitchy, it somehow erased some part of the code when I indent it.
I'm not sure if it's related to any tokens because when this happens, if I didn't remember wrongly, it caused the semantic highlight changed too. But then the semantic tokens bug were patched but this issue persist (still there).

Environment
Operating System: Windows 10
JDK version: 14
Visual Studio Code version: 1.60.0 before update also the same
Java extension version: -
Steps To Reproduce
Just edit the code and with comments, on performing indentation, it will cause glitches
This happens when I start typing code for long time.
semantic token

I don't know if this info help, since this plugin doesn't have built-in option to line up braces plus the default switch-case indentation is weird, so I use this profile:
configuration.zip

Could it be this profile is causing conflict? I'd be glad to provide more information if needed.

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

Start by reproducing Format Document on Windows 10 with JDK 14, Java comments, and the supplied configuration.zip, especially after extended typing. Compare the result with semantic highlighting and check whether source lines are erased; done means formatting preserves all code and leaves highlighting intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, vscode
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.