redhat-developer / redhat-developer/vscode-java

Square brackets not recognized in syntax highlighting grammar

Đang mở
#3,528 1 bình luận 0 reaction 1 người được giao Xem trên GitHub

@hopehadfield đang làm issue này rồi.

Từ ngày 13/3/2024.

bug highlighting
Ngôn ngữ chính
TypeScript
Star
2.3k
Fork
546
Merge trung bình
20 giờ 1 phút
Pull request đã merge (30 ngày)
11

Mô tả

In some cases, square brackets are not recognized as square brackets by the syntax highlighting grammar.

Environment
  • Operating System: N/A
  • JDK version: N/A
  • Visual Studio Code version: 1.87 and 1.88 insiders
  • Java extension version: Latest commit from main
Steps To Reproduce
  1. Create a plain text file with the following content:
public class App {
  public static void main( String[] args ) {
    //                          ↓
    int val1 = new int[]{ 1, 2 }[0];
    //                           ↓
    System.out.println("val1=" + val1);

    int[] arr = new int[]{ 1, 2 };
    //         ↓        ↓
    int val2 = arr[0] + arr[1];
  }
}
  1. Select the Language Mode to Java (java).

  2. You can see that there are several places where the syntax highlighting is incorrect for the down arrows(↓). You can verify this by opening the Command Center and entering the following command: >Developer: Inspect Editor Tokens and Scopes
    (See images below.)

Current Result

1

Expected Result

image

Additional Informations

Originally from @tzengshinfu in https://github.com/microsoft/vscode/issues/206975

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.