microsoft / microsoft/TypeScript

tsserver: saveto command should also save inferred ("virtual") tsconfig

Aperta
#39,071 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

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

Descrizione

Search Terms

tsserver saveto tsconfig

Suggestion

I want to store the content of the "virtual" tsconfig.json that is used by the ts server.

The Saveto comand stores source files. One might aswell allow to store the tsconfig.

Use Cases

I work on a code analysis component. Before I started to implement it, I created a vscode project to adjust settings and declaration files. Once everything worked as expected, I implemented the component that communicates with the tsserver. My implementation does not use a "physical" tsconfig. It relies on the tsconfig the server infers, based on commandline parameters and CompilerOptionsForInferredProjects.

My component updates ts and d.ts files in this virtual project based on user input. This is where problems might appear which are hard to debug within my limited "client".

For debugging and suport purposes I want to take a "snapshot" of the files the tsserver uses, and use vscode for further analysis.

Examples

The request sent to the server would look something like this:

{"arguments":{"tmpfile":"C:\\TEMP\\tsconfig.json","file":"tsconfig.json"},"command":"saveto","seq":0,"type":"request"}

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

Inizia con il comando Saveto in src/server/protocol.ts e analizza CompilerOptionsForInferredProjects, entrambi menzionati nell’issue. Traccia il modo in cui vengono rappresentati i progetti inferiti e il loro tsconfig virtuale prima di determinare come una richiesta saveto potrebbe acquisire uno snapshot di uno di essi. Il lavoro è completato quando il comando può memorizzare il tsconfig inferito per la richiesta descritta senza modificare il comportamento esistente di source-file.

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

Valutazione

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

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.