I would like to create my syntax for VS code, expanding the TypeScript one.
This is my tmlanguage.json
created with yo code
helper:
{
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
"name": "mylang",
"patterns": [{
"include": "source.ts"
},
{
"include": "#keywords"
},
{
"include": "#strings"
},
{
"include": "#htmlTags"
}
],
"repository": {
"keywords": {
"patterns": [{
"name": "keyword.control.htmlscript",
"match": "\\b(if|while|for|return)\\b"
}]
},
"htmlTags": {
"patterns": [{
"name": "variable.language",
"match": "(div|text)"
}]
},
"strings": {
"name": "string.quoted.double.mylang",
"begin": "\"",
"end": "\"",
"patterns": [{
"name": "constant.character.escape.mylang",
"match": "\\\\."
}]
}
},
"scopeName": "source.mylang"
}
This, without "include": "source.ts"
work well, I added this include to show TypeScript syntax. After adding it, it only recognizes TypeScript code and not mine.
Why? Anybody did something similar?