redhat-developer / redhat-developer/vscode-java

@SuperBuilder with Custom TestBuilder Causes Syntax Highlighting Issue in VSCode for Java

オープン
#3,824 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

bug highlighting Lombok
主要言語
TypeScript
スター
2.3k
フォーク
546
平均マージ
20時間 1分
マージ済み PR(30日)
11

説明

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

Snipaste_2024-10-21_10-05-21
Snipaste_2024-10-21_10-03-26
Snipaste_2024-10-21_10-03-17

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

Issue に示されている Java クラスとカスタム TestBuilder を Lombok’s @SuperBuilder とともに使用して問題を再現し、その後、カスタム builder ありの場合となしの場合でハイライトを比較します。VSCode Java 拡張機能の構文ハイライトまたは Java パースのエントリーポイントを追跡します。両方の場合でクラス構造とクラスの色が正しく描画され続ければ完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java, vscode
領域
developer-experience, tooling
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。