Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Square brackets in alert messages are not rendered correctly

Aperta
#1,104 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
52/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
typescript
Ambito
devtools, security

Direzione di ricerca

Riproduci la query in un progetto JavaScript, quindi usa il punto di ingresso “View Alerts (SARIF)” nella vista della cronologia delle query per esaminare come viene visualizzato il messaggio di avviso. Il lavoro è completato quando l’avviso mostra “[] test” invece delle parentesi quadre con escape, rimanendo comunque valido secondo la specifica SARIF.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug VSCode

Describe the bug
Square brackets in alert messages [ and ] are rendered as \[ and \] respectively.

Version
CodeQL extension version: 1.5.10
CodeQL CLI version: 2.7.5
Platform: darwin x64

To reproduce
Run the following query on a JavaScript (for instance) project:

/**
 * @kind alert
 */
import javascript
select any(File f), "[] test"

Right click the query in the query history view and select "View Alerts (SARIF)". Observe that the square brackets are correctly escaped as \\[ and \\] per the SARIF spec:

Literal square brackets ("[" and "]") in the link text of a plain text message SHALL be escaped with a backslash (""). Since JSON itself treats the backslash as an escape character, the backslash SHALL be doubled.

Observe that the square brackets are not correctly escaped in the alert message:

image

Expected behavior
The alert message should be "[] test"

Lingua principale
TypeScript
Stelle
539
Fork
240
Merge medio
2g 18h
PR unite (30g)
37

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.

Altre issue di github/vscode-codeql

Tutte le issue di github/vscode-codeql

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.