我正在编写一个TextMate语法,以扩展使用Visual对Markdown语言进行语法突出显示的功能。预期的结果类似于用Fabio的vscode-突出显示实现的结果,但是我在寻找更简单的东西,而不需要安装或创建扩展。
已经做了大量的研究,但在检查范围时没有得到任何匹配。有什么建议吗?到目前为止,我的文件是:
./package.json
{
"name": "name123",
"description": "desc123",
"publisher": "me",
"version": "0.0.1",
"engines": {
"vscode": "^1.0.0"
},
"contributes": {
"grammars": [{
"language": "markdown",
"scopeName": "text.html.markdown",
"path": "./syntaxes/markdown.tmLanguage.json"
}]
}
}./syntaxes/markdown.tmLanguage.json
{
"scopeName": "text.html.markdown",
"patterns": [
{ "include": "#headings" }],
"repository": {
"headings": {
"patterns": [
{ "include": "#symbol" },
{ "include": "#text" }]},
"symbol": {
"match": "*s2",
"name": "symbol.letter.number.headings.md" },
"text": {
"match": "Description 12345",
"name": "text.description.headings.md" }
}
}发布于 2019-04-13 08:19:55
在markdown文件中,有一个regex错误记录到dev控制台:
ERR target of repeat operator is not specified: Error: target of repeat operator is not specified
at Object.createOnigScanner (c:\Program Files\Microsoft VS Code\resources\app\node_modules.asar\vscode-textmate\release\main.js:58:24)
at Grammar.createOnigScanner (c:\Program Files\Microsoft VS Code\resources\app\node_modules.asar\vscode-textmate\release\main.js:2466:30)
[...]问题是*s2正则表达式。我不知道您到底想要匹配什么,但是必须在*之前重复一些字符。
您的其他作用域与删除的symbol匹配,以避免错误:

https://stackoverflow.com/questions/55661903
复制相似问题