Add syntax highlighting for TypeScript & TypeScript React

Authored by nibags on Nov 22 2018, 8:54 AM.



TypeScript is a superset of JavaScript, therefore, it use JavaScript highlighting, adding some features and built-in classes and functions. It is based on the official TextMate grammar files:

The TypeScript React highlighting adds support for tags, such as XML.

Also, some modifications are made to the JavaScript & JavaScript React:


  • The shebang is corrected, empty lines are no longer allowed before the shebang.
  • Add missing keywords.
  • Add rule to highlight "default" in switch conditions.
  • Add operator: "=>".
  • The "FindComments" & "FindStrings" contexts are created, which is used by typescript.xml.

JavaScript React:

  • Fix shebang.
  • Fix: add Doxygen comments.
  • Other minor changes.

Depends on D17085

FEATURE: 384716

Diff Detail

R216 Syntax Highlighting
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
nibags created this revision.Nov 22 2018, 8:54 AM
Restricted Application added projects: Kate, Frameworks. · View Herald TranscriptNov 22 2018, 8:54 AM
Restricted Application added subscribers: kde-frameworks-devel, kwrite-devel. · View Herald Transcript
nibags requested review of this revision.Nov 22 2018, 8:54 AM
nibags updated this revision to Diff 46105.Nov 24 2018, 6:25 AM
  • typescript.xml & typescript-react.xml: add some comments and the operator "!" after objects's-new-in-TypeScript#non-null-assertion-operator

cullmann accepted this revision.Nov 24 2018, 4:23 PM

I like that ;=)
And its a very nice show-case for the keyword list inclusion.

This revision is now accepted and ready to land.Nov 24 2018, 4:23 PM
This revision was automatically updated to reflect the committed changes.