microsoft / microsoft/TypeScript
tsserver: saveto command should also save inferred ("virtual") tsconfig
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Go
- Sterne
- 111k
- Forks
- 14.3k
- Ø Merge
- 2 T. 4 Std.
- Gemergte PRs (30 T.)
- 132
Beschreibung
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.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit dem Saveto-Befehl in src/server/protocol.ts und überprüfe CompilerOptionsForInferredProjects; beide werden im Issue genannt. Verfolge, wie inferierte Projekte und ihre virtuelle tsconfig dargestellt werden, bevor du bestimmst, wie eine saveto-Anfrage eines davon als Snapshot erfassen könnte. Als erledigt gilt die Aufgabe, wenn der Befehl die inferierte tsconfig für die beschriebene Anfrage speichern kann, ohne das bestehende Verhalten von source-file zu ändern.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- typescript
- Bereich
- devtools
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 30/100