redhat-developer / redhat-developer/vscode-java

Square brackets not recognized in syntax highlighting grammar

Offen
#3,528 1 Kommentar 0 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

@hopehadfield arbeitet bereits daran.

Seit 13.3.2024.

bug highlighting
Vorherrschende Sprache
TypeScript
Sterne
2.3k
Forks
546
Ø Merge
20 Std. 1 Min.
Gemergte PRs (30 T.)
11

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.