Improve highlighting of TypeScript (and React) and add more tests for PHP
ClosedPublic

Authored by nibags on Feb 23 2019, 11:15 AM.

Details

Summary

Add more examples in the PHP test units, with the highlighting within code of
CSS, JavaScript, JavaScript React, TypeScript and MustacheJS (according to D18951).

The TypeScript highlighting is also updated.

Changes:

TypeScript:

  • Fixes keywords delimiters (remove: +-).
  • Add support to bigint (example: 123n).
  • Add "is" keyword (for type guards).
  • Don't highlight some keywords when they are objects.
  • Small improvements in the highlighting of types.
  • Don't highlight regular expressions after "]" and ")".

TypeScript React:

  • Don't highlight tags within declarations of types, variables, classes and interfaces.
  • Fix tags at the beginning of substitutions in templates.
  • Adapt to modifications of "typescript.xml".
  • Reorder part of the code.

JavaScript React:

  • Don't highlight tags within declarations of variables, classes and interfaces.
  • Fix tags at the beginning of substitutions in templates.
  • Reorder part of the code.

JavaScript:

  • Move highlighting of region markers to the "FindComments" context.
  • Fix: highlight comments after "<".

Also, examples have been added in the test files.

Diff Detail

Repository
R216 Syntax Highlighting
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
nibags created this revision.Feb 23 2019, 11:15 AM
Restricted Application added projects: Kate, Frameworks. · View Herald TranscriptFeb 23 2019, 11:15 AM
Restricted Application added subscribers: kde-frameworks-devel, kwrite-devel. · View Herald Transcript
nibags requested review of this revision.Feb 23 2019, 11:15 AM
dhaumann accepted this revision.Feb 23 2019, 1:59 PM
This revision is now accepted and ready to land.Feb 23 2019, 1:59 PM
This revision was automatically updated to reflect the committed changes.