Associate companion files with `ProjectService` without Content Mappers
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 35/100
- Issue-Typ
- Feature
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- angular, go, typescript
- Bereich
- developer-experience, tooling
Rechercherichtung
Start by tracing ProjectService handling for getDefaultProjectForFile, extraFileExtensions, and Content Mappers. Compare how include globs and companion files are associated with projects, then define how a lightweight registration could avoid content transformation and virtual .ts AST generation. Done means an external HTML template can discover its project on cold start without the fake open workaround.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
🔍 Search Terms
extraFileExtensions
ScriptKind.Unknown
getDefaultProjectForFile
companion files
cold start project
openProjects
✅ 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
Something like content mappers for registering extra extensions as included in the project but without the requirement of actually doing content mapping
📃 Motivating Example
We're currently prototyping the new Angular Language Service against TS-Go (tsgo --lsp with the API session pipe). In our setup, our extension manages a separate language server to handle Angular-specific template features, and uses TS-Go as the backend semantic and type-checking engine.
Because we manage our own compiler instance per tsconfig.json, we need to know which project owns a file when it's opened. We're running into a cold-start discovery problem when a user opens an external template first (e.g. app.component.html): getDefaultProjectForFile returns nothing because TS doesn't recognize .html as belonging to any configured project. Since Angular hasn't compiled yet, we don't know the TS ↔ HTML association either, so we don't know which tsconfig to load.
To work around this today, we do a "fake open dance" where we guess a sibling app.component.ts file, send a synthetic didOpen to TS-Go just to spin up the project and discover the tsconfig path, and then boot our compiler.
Content Mappers don't really fit here because they require transforming foreign files into virtual .ts ASTs and generating .ts output. For Angular, HTML files are external companion templates—our template type-checking code is generated out-of-band in separate .ngtypecheck.ts files. Forcing a Content Mapper onto .html files just introduces unwanted .ts AST generation and emit overhead.
Previously, extraFileExtensions with ScriptKind.Unknown kept projects active when matched by include globs. Since non-TS extensions in include globs are more standard now with content mappers, we're fine requiring .html in include. A lightweight extension registration (or a no-transform companion mode that lets include globs associate .html with ProjectService without generating virtual .ts ASTs) would eliminate the cold-start issue and the fake open workaround.
💻 Use Cases
-
What do you want to use this for?
Angular language service -
What shortcomings exist with current approaches?
Mentioned above -
What workarounds are you using in the meantime?
attempting to open a ts file with the same name
- Vorherrschende Sprache
- Go
- Sterne
- 112k
- Forks
- 15.4k
- Ø Merge
- 2 T. 21 Std.
- Gemergte PRs (30 T.)
- 126
Entwicklungsumgebung
Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus microsoft/TypeScript
-
Native API: formatDiagnosticsWithColorAndContext drops related information without a file locationOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
microsoft/TypeScript#65087 ·
Maintainer antworten meist innerhalb von 1 Tag
-
API: `tsc.exe` opens a visible console window on Windows when the parent process has no consoleOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
microsoft/TypeScript#65083 ·
Maintainer antworten meist innerhalb von 1 Tag
-
TS7 LSP: documentHighlight returns nothing when the file path contains '@'Evtl. wieder frei Ein Pull Request dazu wurde ohne Merge geschlossen. OffenBug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
microsoft/TypeScript#64758 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Language server (tsc --lsp) exits with code 1 after `shutdown` and `exit`Evtl. vergeben @rajnish-verma-22172 hat das vor 12 Tagen übernommen. OffenBug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
microsoft/TypeScript#64742 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Class names `eval` and `arguments` are not reported as invalid strict mode bindingsEvtl. vergeben @dmety hat das vor 25 Tagen übernommen. OffenBug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
microsoft/TypeScript#64661 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in microsoft/TypeScript
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
router-for-me/CLIProxyAPI#7209 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
Azure/azure-storage-azcopy#3674 ·
Maintainer antworten meist innerhalb von 1 Tag
-
date_time, url_encode, html_escape, to_unix_time, contains_all and contains_any panic when called without argumentsEvtl. vergeben @antcybersec hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
projectdiscovery/dsl#372 ·
Maintainer antworten meist innerhalb von 1 Tag
-
blocked-needs-validation
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
projectcapsule/capsule#2265 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Remove "Model catalog refresh unavailable" warning from OpenRouter agent runsEvtl. vergeben @superplanehq-integration hat das heute übernommen. Offensuperplane
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
superplanehq/superplane#9164 ·
Maintainer antworten meist innerhalb von 1 Tag