Add syntax highlighting for TypeScript & TypeScript React
ClosedPublic

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

Details

Summary

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: https://github.com/Microsoft/TypeScript-TmLanguage

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

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

JavaScript:

  • 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

Repository
R216 Syntax Highlighting
Branch
add-typescript
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 5307
Build 5325: arc lint + arc unit
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

https://github.com/Microsoft/TypeScript/wiki/What'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.
Cool!

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.