Skip to content

Commit

Permalink
Basic TypeScript support for commenting & syntax hightlighting (#9)
Browse files Browse the repository at this point in the history
* enabled template syntax highlighting for also TypeScript files
  • Loading branch information
uguraslan authored Oct 13, 2023
1 parent 53cf702 commit 936cb82
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
# Change Log

## v0.4.0

- enabled template syntax highlighting for also TypeScript
24 changes: 21 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -25,7 +25,8 @@
],
"icon": "./icon.png",
"activationEvents": [
"onLanguage:javascript"
"onLanguage:javascript",
"onLanguage:typescript"
],
"main": "./src/extension.js",
"scripts": {
Expand All @@ -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": [
Expand All @@ -57,14 +65,24 @@
"JavaScript",
"javascript"
]
},
{
"id": "typescript",
"extensions": [
".ts"
],
"aliases": [
"TypeScript",
"typescript"
]
}
],
"keybindings": [
{
"key": "ctrl+/",
"mac": "cmd+/",
"command": "blits-vscode.commentCommand",
"when": "editorTextFocus && editorLangId == 'javascript'"
"when": "editorTextFocus && (editorLangId == 'javascript' || editorLangId == 'typescript')"
}
]
},
Expand Down
4 changes: 2 additions & 2 deletions syntaxes/embedded-html.json
Original file line number Diff line number Diff line change
@@ -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*[`']",
Expand Down

0 comments on commit 936cb82

Please sign in to comment.