Skip to content

TypeScript Syntax Highlighting Definition for Kate (KSyntaxHighlighting Framework)

License

Notifications You must be signed in to change notification settings

nibags/typescript-ksyntaxhighlighting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TypeScript Syntax Highlighting Definition for Kate

Author: Nibaldo González ([email protected])

Last Change: April 2020

Requirements: KDE Frameworks 5.53.0 or higher

Last versions: Included in KDE Frameworks 5.70.0+.

This file is part of the KDE's KSyntaxHighlighting Framework.

Description:

Add syntax highlighting to KDE text editors (as Kate, KWrite, KDevelop or any application that uses the KSyntaxHighlighting or KTextEditor Framework) for TypeScript, TypeScript React (TSX) & JavaScript React (JSX).

These files are an extension of the JavaScript highlighter (javascript.xml, Version 14).

NOTE:

  • The TypeScript and TypeScript React highlighters require KDE Frameworks 5.53.0 to work.
  • typescript-react.xml depends on typescript.xml, typescript.xml and javascript-react.xml depend on the JavaScript highlighter.

About XML Files of Syntax Highlighting Definition:

The syntax highlighting definition files, of the KSyntaxHighlighting Framework, consist of XML files that are compiled in the KDE Frameworks libraries.

However, these XML files can also be stored in:

For local user $HOME/.local/share/org.kde.syntax-highlighting/syntax/
For all users /usr/share/org.kde.syntax-highlighting/syntax/
For Kate's Flatpak package $HOME/.var/app/org.kde.kate/data/org.kde.syntax-highlighting/syntax/
For Kate's Snap package $HOME/snap/kate/current/.local/share/org.kde.syntax-highlighting/syntax/
On Windows %USERPROFILE%\AppData\Local\org.kde.syntax-highlighting\syntax\

For more details of KSyntaxHighlighting Framework, visit:

Installation:

If you do not have the latest version of KDE Frameworks, you can manually install the latest XML files.

IMPORTANT: Also install the latest version of javascript.xml; a copy of this file is included in this repository. The file typescript-react.xml requires the latest version of typescript.xml.

Copy the *.xml files to the directory of the XML syntax definition files, mentioned in the previous section.

Ex.: For local user:

mkdir -p $HOME/.local/share/org.kde.syntax-highlighting/syntax/
cp ./{typescript,typescript-react,javascript-react,javascript}.xml $HOME/.local/share/org.kde.syntax-highlighting/syntax/

For all users:

sudo mkdir -p /usr/share/org.kde.syntax-highlighting/syntax/
sudo cp ./{typescript,typescript-react,javascript-react,javascript}.xml /usr/share/org.kde.syntax-highlighting/syntax/

List of Versions

typescript.xml
Version
Date KDE Frameworks Relevant Changes
10 Apr. 13, 2020 5.70.0 Add the "awaited" type operator.
9 Feb. 23, 2020 5.68.0
  • Add private-named instance fields.
  • Support type-only imports and exports.
  • Improve conditional expressions.
8 Dec. 12, 2019 5.66.0 Add "bigint" primitive type.
7 Nov. 20, 2019 5.65.0 Move keywords of built-in object to "javascript.xml".
6 Oct. 01, 2019 5.64.0
  • Add "asserts" keyword in type predicates.
  • Highlight types after the "as" keyword.
5 Aug. 30, 2019 5.62.0 Fix incorrect highlighting of the "?" operator, in the previous update.
4 Jul. 16, 2019 5.61.0 Fixed highlighting of keywords before ":" in conditional expressions.
3 Feb. 18, 2019 5.56.0 Add support to bigint, add the "is" keyword and multiple fixes and improvements.
2 Dec. 29, 2018 5.54.0 Fix float-points and improve types detection.
1 Nov. 18, 2018 5.53.0
javascript-react.xml
Version
typescript-react.xml
Version
Date KDE Frameworks Relevant Changes
- 9 Feb. 23, 2020 5.68.0 Adapt to the TypeScript highlighter.
8 8 Nov. 21, 2019 5.65.0 Tag detection is more stricter.
7 7 Nov. 19, 2019 5.65.0 Rename definitions to "TypeScript React (TSX)" and "JavaScript React (JSX)".
6 6 Oct. 01, 2019 5.64.0 TSX: Highlight "<T extends" as a type assertion, not as a Tag.
- 5 Aug. 30, 2019 5.62.0 Adapt to the TypeScript highlighter.
- 4 Jul. 16, 2019 5.61.0 Adapt to the TypeScript highlighter.
5 3 Feb. 20, 2019 5.56.0
  • Don't highlight tags within declarations of types, variables, classes and interfaces.
  • Fixes tags after substitutions in templates.
4 2 Dec. 30, 2018 5.54.0
  • Allow type assertion in the tag name.
  • Allow tags after the keywords "await" & "yield".
  • Allow empty tags and non-ASCII tag name & attributes.
3 1 Nov. 18, 2018 5.53.0