microsoft / microsoft/TypeScript

Support a file blacklist in tsserver configuration options

Aperta
#36,391 5 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Domain: LS: TSServer In Discussion Suggestion
Lingua principale
Go
Stelle
111k
Fork
14.3k
Merge medio
2g 4h
PR unite (30g)
132

Descrizione

My scenario is this: suppose I'm working in my editor, and I open a file which, by chance, crashes the language service. Repeatedly. (usually because of it's size or shape). Today, after the service crashes 5 times in short order, the service is disabled by the editor (which if it crashes on load, is what will occur). What I propose is this; if the service crashes after a file open request is issued, and we would shut down the service, instead we automatically add the file to a workspace-local tsserver blacklist config (probably in .vscode/settings.json) and reload the language service with the new option. The language service will then refuse to actually load the blacklisted file contents, instead reporting them as empty files/empty modules/empty json documents and potentially issue a warning-type error message in the diagnostics that certain files are blacklisted, which may affect the compilation.

cc @mjbvz do you think this'd be a good idea for a slightly more progressive degradation of experience when the language service has trouble with a file?

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

Inizia tracciando la gestione delle file-open requests da parte di tsserver e le opzioni di configurazione utilizzate dal language service. Esamina come un file .vscode/settings.json locale al workspace potrebbe rappresentare una blacklist e come avvengono i reload dopo arresti anomali ripetuti. Il lavoro è completato quando un file inserito nella blacklist viene trattato in sicurezza come vuoto, i diagnostici possono avvisare dell'effetto e il servizio rimane disponibile invece di essere disabilitato.

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

Valutazione

Stack tecnologico
typescript
Ambito
tooling
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.