OpenLiberty / liberty-tools-vscode

Visual Studio Code extension for Liberty Tools
https://marketplace.visualstudio.com/items?itemName=Open-Liberty.liberty-dev-vscode-ext
Eclipse Public License 2.0
18 stars 35 forks source link

Applying quick fix causes formatting issues in code. #390

Open gilbysunil14 opened 1 week ago

gilbysunil14 commented 1 week ago

When using the "Quick Fix" feature to resolve errors, the automatic fix often results in unintended changes to the code formatting. Specifically, the fix alters the line break, leading to misaligned code and reduced readability.

For replicating follow the steps:

  1. Create a java file and paste the below code
    
    @ApplicationScoped @RequestScoped
    public class ScopeDeclaration {

}


2. There will be a diagnostics over `ScopeDeclaration`
3. Apply the quick fix `Remove @RequestScoped`

Screenshot for the same is given below

Before applying the quick fix:
![image](https://github.com/user-attachments/assets/158d0e93-58f2-4268-8834-68cb4c447eb9)

After applying the quick fix:
<img width="1728" alt="image" src="https://github.com/user-attachments/assets/4e503bb3-7afb-48ca-b15d-2a2caf3a955f">