我正在尝试为Visual Studio代码创建一个简单的语言扩展。我使用“ yo代码”来生成语言支持扩展。添加我的语言名称,ID,扩展名等后,即使在扩展调试主机中运行tm范围检查器时,我仍然收到此消息“没有为<源。弧提供语法” ,即使vscode识别了语言。
不知道我现在可以尝试什么,因为该示例应该立即起作用
archsim.tmLanguage.json:
{
"name": "ArchsimC",
"scopeName": "source.arc",
"patterns": [
{
"include": "#keywords"
},
{
"include": "#strings"
}
],
"repository": {
"keywords": {
"patterns": [
{
"name": "keyword.control.archsimc",
"match": "\\b(if|while|for|return)\\b"
},
]
},
"strings": {
"name": "string.quoted.double.archsimc",
"begin": "\"",
"end": "\"",
"patterns": [
{
"name": "constant.character.escape.archsimc",
"match": "\\\\."
}
]
}
}
}
package.json:
{
"name": "languagetest",
"displayName": "LanguageTest",
"description": "language server test",
"version": "0.0.1",
"engines": {
"vscode": "^1.29.0"
},
"categories": [
"Programming Languages"
],
"contributes": {
"languages": [
{
"id": "archsimc",
"aliases": [
"ArchsimC",
"archsimc"
],
"extensions": [
".arc"
],
"configuration": "./language-configuration.json"
}
],
"grammars": [
{
"language": "archsimc",
"scopeName": "source.arc",
"path": "./syntaxes/archsimc.tmLanguage.json"
}
]
}
}
test.arc
if(something)
{
return;
}
根据我在vscode文档中看到的内容,通过在“ if”上运行inspect TM范围来指向tmLanguage文件。
有什么想法在这里,如果我做错了什么?