-
Notifications
You must be signed in to change notification settings - Fork 311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide an example of the watcher API #169
Conversation
Using-the-Compiler-API.md
Outdated
|
||
TypeScript 2.7 introduces a new API for creating "watcher" programs that provide set of APIs that are smart enough to cache errors and emit on modules from previous compilations if they or their dependencies haven't been updated in a cascading manner. | ||
|
||
This API is used internally in the compiler to implement its `--watch` mode, but can also be leveraged by other tools. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should also add a note about the builder API.
* This is mainly for messages like "Starting compilation" or "Compilation completed". | ||
*/ | ||
function reportWatchStatusChanged(diagnostic: ts.Diagnostic) { | ||
console.info(ts.formatDiagnostic(diagnostic, formatHost)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically you dont want to write this as diagnostic right? (eg. formatted as TS xxxx: Message
You would just want to write Text through ts.flattenDiagnosticMessageText(diagnostic.messageText, newLine)
I'm going to merge this in, but please feel free to send any corrections upstream or give me a heads up on inaccuracies. |
@mhegazy @sheetalkamat can you review this?