redhat-developer / redhat-developer/vscode-java

Square brackets not recognized in syntax highlighting grammar

Aperta
#3,528 1 commento 0 reazioni 1 assegnatario Vedi su GitHub

@hopehadfield ci sta già lavorando.

Dal 13/3/2024.

bug highlighting
Lingua principale
TypeScript
Stelle
2.3k
Fork
546
Merge medio
20h 1m
PR unite (30g)
11

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.