Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/visual-studio-code/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/oop/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Visual studio code VSCode语言扩展_Visual Studio Code_Vscode Extensions_Tmlanguage - Fatal编程技术网

Visual studio code VSCode语言扩展

Visual studio code VSCode语言扩展,visual-studio-code,vscode-extensions,tmlanguage,Visual Studio Code,Vscode Extensions,Tmlanguage,我正在构建自定义语言扩展,并且在language-configuration.json中遇到lineComment问题。奇怪的是,我的语言使用“@@”作为行注释,我无法让它工作 我试过@、\@,等等 什么技巧? < P>这非常类似于传统C++注释。以下是我在语法存储库中使用的内容: { "name": "comment.line.double-slash", "match": "\/\/.*" } 我想你已经试过了: { "name"

我正在构建自定义语言扩展,并且在language-configuration.json中遇到lineComment问题。奇怪的是,我的语言使用“@@”作为行注释,我无法让它工作

我试过@、\@,等等


什么技巧?

< P>这非常类似于传统C++注释。以下是我在语法存储库中使用的内容:

    {
      "name": "comment.line.double-slash",
      "match": "\/\/.*"
    }
我想你已经试过了:

    {
      "name": "comment.line.double-at",
      "match": "\@\@.*"
    }

??我不确定是否需要避开@符号,因为它在JS正则表达式中没有特殊意义。

我已经尝试过了。不知道为什么这两种方法中的一种不起作用。那么也许你有一个相互冲突的规则,所以这一个永远不会匹配?请尝试禁用所有其他规则,并在您的语言规范中使用此注释规则。这样应该可以正常工作。这是我的language-configuration.json:
{“comments”:{//symbol用于单行注释。如果您的语言不支持行注释“lineComment”:“@@”},请删除此条目,//用作方括号的符号“方括号”:[“{”、“}”]、[“[”、“]”]、[“(“,”)”]、“自动闭合对”:[“{”、“}”]、[“[”、“]、[”(“,”)”]、“环绕对”:[[“{”、“}”]、[“[”、“]、[“(”、”)]、[“(”、”])}}}}}
,我在回答中给出的不是语言配置,而是主题文件(通常使用.tmTheme,但您也可以使用json文件)。啊,谢谢您,先生。在Yeoman为我构建的结构中,我没有.thTheme文件,因此我正在研究如何构建一个,以及如何将其放入扩展名的文件结构中。