microsoft / microsoft/TypeScript
Regex unicode property autocomplete
Nessuno ha ancora preso questa issue.
- Lingua principale
- Go
- Stelle
- 111k
- Fork
- 14.4k
- Merge medio
- 1g 19h
- PR unite (30g)
- 117
Descrizione
🔍 Search Terms
regular expressions, unicode character class, unicode property, hints, autocomplete
✅ Viability Checklist
- This wouldn't be a breaking change in existing TypeScript/JavaScript code
- This wouldn't change the runtime behavior of existing JavaScript code
- This could be implemented without emitting different JS based on the types of the expressions
- This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
- This isn't a request to add a new utility type: https://github.com/microsoft/TypeScript/wiki/No-New-Utility-Types
- This feature would agree with the rest of our Design Goals: https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals
⭐ Suggestion
Since TS now validates regular expressions including unicode properties and even provides spelling suggestions, why not autocomplete them?
📃 Motivating Example
In this example TS 5.5 understands that the first regex is incorrect:
const re1 = /\p{Emoj}/u // Error: Unknown Unicode property name or value. Did you mean "Emoji"?
const re2 = /\p{Emoji}/u // Ok
💻 Use Cases
It would be convenient if TS suggested available unicode properties when suggestions are triggered inside \p{}/\P{} sequences.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Non viene indicato alcun file o test. Inizia tracciando i percorsi esistenti di TypeScript per la convalida delle proprietà Unicode nelle espressioni regolari e per i suggerimenti ortografici, quindi trova dove vengono gestite le richieste di completamento all'interno di \p{} e \P{}. Il lavoro è completato quando le proprietà Unicode valide vengono offerte come completamenti senza modificare il JavaScript emesso, con test mirati per entrambe le forme.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- javascript, typescript
- Ambito
- compilers, developer-experience
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 42/100