redhat-developer / redhat-developer/vscode-java
@SuperBuilder with Custom TestBuilder Causes Syntax Highlighting Issue in VSCode for Java
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- TypeScript
- Star
- 2.3k
- Fork
- 547
- Merge trung bình
- 20 giờ 1 phút
- Pull request đã merge (30 ngày)
- 11
Mô tả
When using Lombok’s @SuperBuilder in a Test class and defining a custom TestBuilder to add more methods, VSCode’s syntax highlighting fails. The class colors are incorrectly rendered, and it appears the IDE no longer correctly interprets the structure of the class. This only occurs after adding the custom builder; without it, highlighting works as expected.
Environment
- Operating System: macOS 15.0.1
- JDK version: OpenJDK 64-Bit Server VM Temurin-21.0.4+7 (build 21.0.4+7-LTS, mixed mode, sharing)
- Visual Studio Code version: 1.94.2
- Java extension version: v1.36.2024101808
Steps To Reproduce
1. Create a class Test annotated with Lombok’s @SuperBuilder.
2. Manually define a TestBuilder to add additional methods beyond the automatically generated builder.
3. Open the project in VSCode and observe the syntax highlighting for the Test class.
import com.google.common.collect.Lists;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import java.util.List;
@SuperBuilder
@NoArgsConstructor
@Data
public abstract class Test {
private List<String> exampleList;
public abstract class TestBuilder<C extends Test, B extends Test.TestBuilder<C, B>> {
public TestBuilder() {
exampleList = Lists.newArrayList();
}
public void addExample(String example) {
exampleList.add(example);
}
}
}
Current Result
VSCode’s syntax highlighting becomes incorrect when a custom TestBuilder is defined. The class colors are rendered improperly, and it seems the IDE fails to properly handle the class structure.
Expected Result
VSCode should continue to correctly render syntax highlighting, even when a custom TestBuilder is used with Lombok’s @SuperBuilder.
Additional Informations
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Tái hiện vấn đề bằng cách sử dụng lớp Java và TestBuilder tùy chỉnh được nêu trong issue, với Lombok’s @SuperBuilder, sau đó so sánh việc tô sáng khi có và không có builder tùy chỉnh. Truy vết điểm vào của tiện ích mở rộng Java của VSCode đối với việc tô sáng cú pháp hoặc phân tích Java; được xem là hoàn tất khi cấu trúc lớp và màu của các lớp vẫn được hiển thị chính xác trong cả hai trường hợp.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- java, vscode
- Lĩnh vực
- developer-experience, tooling
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100