From 936cb82d45a7482d5ac205cdd1da69c9573ab2f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?U=C4=9Fur=20Aslan?= <20225811+uguraslan@users.noreply.github.com> Date: Fri, 13 Oct 2023 15:28:23 +0200 Subject: [PATCH] Basic TypeScript support for commenting & syntax hightlighting (#9) * enabled template syntax highlighting for also TypeScript files --- CHANGELOG.md | 4 ++++ package.json | 24 +++++++++++++++++++++--- syntaxes/embedded-html.json | 4 ++-- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 420e6f2..2da7f8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1 +1,5 @@ # Change Log + +## v0.4.0 + +- enabled template syntax highlighting for also TypeScript \ No newline at end of file diff --git a/package.json b/package.json index 480704b..c222743 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "publisher": "lightningjs", "displayName": "Lightning Blits", "description": "Template syntax highlighting and code completion for the Lightning Blits framework", - "version": "0.3.1", + "version": "0.4.0", "repository": { "type": "git", "url": "https://github.com/lightning-js/blits-vscode-extension.git" @@ -25,7 +25,8 @@ ], "icon": "./icon.png", "activationEvents": [ - "onLanguage:javascript" + "onLanguage:javascript", + "onLanguage:typescript" ], "main": "./src/extension.js", "scripts": { @@ -45,6 +46,13 @@ ], "scopeName": "inline.custom-blits-html", "path": "./syntaxes/embedded-html.json" + }, + { + "injectTo": [ + "source.ts" + ], + "scopeName": "inline.custom-blits-html", + "path": "./syntaxes/embedded-html.json" } ], "languages": [ @@ -57,6 +65,16 @@ "JavaScript", "javascript" ] + }, + { + "id": "typescript", + "extensions": [ + ".ts" + ], + "aliases": [ + "TypeScript", + "typescript" + ] } ], "keybindings": [ @@ -64,7 +82,7 @@ "key": "ctrl+/", "mac": "cmd+/", "command": "blits-vscode.commentCommand", - "when": "editorTextFocus && editorLangId == 'javascript'" + "when": "editorTextFocus && (editorLangId == 'javascript' || editorLangId == 'typescript')" } ] }, diff --git a/syntaxes/embedded-html.json b/syntaxes/embedded-html.json index e1345eb..73fabb5 100644 --- a/syntaxes/embedded-html.json +++ b/syntaxes/embedded-html.json @@ -1,6 +1,6 @@ { - "fileTypes": ["js"], - "injectionSelector": "L:source.js -comment -string", + "fileTypes": ["js", "ts"], + "injectionSelector": "L:source.js -comment -string, L:source.ts -comment -string", "patterns": [ { "begin": "template\\s*:\\s*(\\/\\*.*?\\*\\/)?\\s*[`']",