From 7367abd6c6f764b45802613ca9c46e921b4394e6 Mon Sep 17 00:00:00 2001 From: Gabriel Dinner-David <82682503+gabydd@users.noreply.github.com> Date: Fri, 11 Nov 2022 00:42:56 -0500 Subject: [PATCH] Update typescript grammar and queries (#4703) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(grammars): update treesitter grammar and queries * add override keyword * Update runtime/queries/typescript/highlights.scm Co-authored-by: Blaž Hrastnik --- languages.toml | 4 ++-- runtime/queries/typescript/highlights.scm | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/languages.toml b/languages.toml index 8b87cd1d3..00eff068e 100644 --- a/languages.toml +++ b/languages.toml @@ -399,7 +399,7 @@ indent = { tab-width = 2, unit = " " } [[grammar]] name = "typescript" -source = { git = "https://github.com/tree-sitter/tree-sitter-typescript", rev = "3e897ea5925f037cfae2e551f8e6b12eec2a201a", subpath = "typescript" } +source = { git = "https://github.com/tree-sitter/tree-sitter-typescript", rev = "6aac031ad88dd6317f02ac0bb27d099a553a7d8c", subpath = "typescript" } [[language]] name = "tsx" @@ -413,7 +413,7 @@ indent = { tab-width = 2, unit = " " } [[grammar]] name = "tsx" -source = { git = "https://github.com/tree-sitter/tree-sitter-typescript", rev = "3e897ea5925f037cfae2e551f8e6b12eec2a201a", subpath = "tsx" } +source = { git = "https://github.com/tree-sitter/tree-sitter-typescript", rev = "6aac031ad88dd6317f02ac0bb27d099a553a7d8c", subpath = "tsx" } [[language]] name = "css" diff --git a/runtime/queries/typescript/highlights.scm b/runtime/queries/typescript/highlights.scm index 7c15cf3d4..fc8d110d1 100644 --- a/runtime/queries/typescript/highlights.scm +++ b/runtime/queries/typescript/highlights.scm @@ -34,6 +34,7 @@ "implements" "keyof" "namespace" + "override" ] @keyword [ @@ -62,3 +63,15 @@ ((identifier) @type (#match? @type "^[A-Z]")) + +; Literals + +[ + (template_literal_type) +] @string + +; Tokens + +(template_type + "${" @punctuation.special + "}" @punctuation.special) @embedded