microsoft / microsoft/TypeScript

Provide a code action to replace a string with a template string

Aperta
#34,864 0 commenti 3 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Experience Enhancement Suggestion
Lingua principale
Go
Stelle
111k
Fork
14.3k
Merge medio
2g 4h
PR unite (30g)
132

Descrizione

Suggestion

Provide a code action on a string to replace the string with a template string.

Use Cases

Often you start with a normal string and notice that it should better be a template string. See the example below. When the cursor is inside the string, there should be code action provided 'Replace with template string'

image

The code action replace the string with a template string
image

Checklist

My suggestion meets these guidelines:

  • 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, etc.)
  • This feature would agree with the rest of TypeScript's Design Goals.

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.

Direzione di ricerca

Nell’issue non sono indicati né un file di implementazione né un test. Inizia individuando gli entry point e i test esistenti delle code action di TypeScript, quindi usa l’esempio fornito di stringa normale come caso di input. Il lavoro è completato quando un cursore all’interno di una stringa normale offre “Replace with template string” e applica la conversione senza modificare il comportamento a runtime.

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

Valutazione

Stack tecnologico
javascript, typescript
Ambito
tooling
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.