You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I stumbled upon some TS compiler API functionality that's relevant here:
constclassifier=ts.createClassifier();constclassifications=classifier.getEncodedLexicalClassifications('const a = 123;',ts.EndOfLineState.None);for(leti=0;i<classifications.spans.length;i+=3){const[start,length,classification]=classifications.spans.slice(i,i+3);console.log(start,length,ts.ClassificationType[classification]);}
Desired Behavior
ts-node currently supports output highlighting, but not input:

Additional context
The next REPL of nodejs - node-prototype-repl - already supports syntax highlighting for js. It uses emphasize. If we change the following line:
https://github.com/nodejs/repl/blob/db95cfb1a177b056b8bc257dfd62c7b0e50134df/src/highlight.js#L44 to:
emphasize.highlight('ts', s, sheet).value;
We can get typescript syntax highlighting for node REPL:
For additional details see #1144.
The text was updated successfully, but these errors were encountered: