- Notifications
You must be signed in to change notification settings - Fork13.2k
Codebase Compiler Emitter
The emitter is a tree based syntax emitter. It works by going through the TypeScript AST for a program andemitting source code as it is pipelined.
The emitter itself is "dumb" in the sense that it doesn't contain logic outside of printing whatever AST it isgiven. So, it's possible that a bug in emission is actually that the AST isn't set up the way that you'd like it.
Creating a single file which represents many is done by creating aSyntaxKind.Bundle. Printing happens infunction writeBundle(. There areprepends which I don't understand, and then each sourcefile is isprinted.
The printer is a part of the emitter, you create one withcreatePrinter, then start callingprintwith an AST node on it. This adds the node via apipeline:
constenumPipelinePhase{Notification,Substitution,Comments,SourceMaps,Emit,}
With the word to start emitting through the AST in [pipelineEmitWithHint][4]. There is a hint option which canbe used to force the emit type.
The process of changing your AST into the expected JS or TS happens the emitter compiler transformers. There is afull step
Emitting a declaration file is a multi-step process. It goes through the above emitter of its AST, but thenalsogoes through a
News
Debugging TypeScript
- Performance
- Performance-Tracing
- Debugging-Language-Service-in-VS-Code
- Getting-logs-from-TS-Server-in-VS-Code
- JavaScript-Language-Service-in-Visual-Studio
- Providing-Visual-Studio-Repro-Steps
Contributing to TypeScript
- Contributing to TypeScript
- TypeScript Design Goals
- Coding Guidelines
- Useful Links for TypeScript Issue Management
- Writing Good Design Proposals
- Compiler Repo Notes
- Deployment
Building Tools for TypeScript
- Architectural Overview
- Using the Compiler API
- Using the Language Service API
- Standalone Server (tsserver)
- TypeScript MSBuild In Depth
- Debugging Language Service in VS Code
- Writing a Language Service Plugin
- Docker Quickstart
FAQs
The Main Repo