问题描述
我想自己添加对新语言的支持。所以我在以下文件夹中添加了一个包含 Visual Studio (VS) TextMate 语法的新文件:%userprofile%.vs\Extensions,然后 VS 就可以支持一种官方未支持的新语言。
下面是上面提到的新语言的TextMate语法:
{
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json","name": "LS-Dyna","scopeName": "source.lsdyna","fileTypes": [
"k"
],"patterns": [
{"include": "#comments"},{"include": "#dyna_numeric"},{"include": "#keywords_type"},{"include": "#separate"},{"include": "#posterior_keywords_and_options"},{"include": "#parameter_type"},{"include": "#suboptions_with_bracket"},{"include": "#names"},{"include": "#phrase"}
],"repository": {
"comments": {
"patterns": [
{
"comment": "Comment line","begin": "^[$]","end": "(?=\\n|\\r)","name": "comment.line.c.lsdyna"
}
]
},"dyna_numeric": {
"patterns": [
{
"comment": "General Dyna Numbers","name": "constant.numeric.float.decimal.lsdyna","match": "(?:([\\+\\-]*(\\d+\\.*\\d*)([eE][\\-\\+]?\\d+)*))(?=[^A-QS-Za-qs-z_])"
}
]
},"separate": {
"patterns": [
{
"comment": "LS-DYNA separate","name": "keyword.operator.other","begin": "_|\\,","end": "(?=\\w|\\s)"
}
]
},"keywords_type": {
"patterns": [
{
"comment": "LS-DYNA keywords type","name": "keyword.other.lsdyna","begin": "^[*]","end": "(?=\\,|\\n|\\r|[ ])"
}
]
},"posterior_keywords_and_options": {
"patterns": [
{
"comment": "posterior keywords and options","name": "entity.name.function.lsdyna","begin": "(?<=_)\\w","end": "(?=\\n|\\r|[ ])"
}
]
},"parameter_type": {
"patterns": [
{
"comment": "LS-DYNA parameter type","name": "variable.parameter.lsdyna","begin": "[&]","suboptions_with_bracket": {
"patterns": [
{
"comment": "suboptions with bracket","name": "variable.other.function.lsdyna","match": "(?<=\\{)\\w*(?=\\})"
}
]
},"names":{
"patterns": [
{
"comment": "name","name": "string.interpolated.lsdyna","match": "^([\\S]+)$"
}
]
},"phrase":{
"patterns": [
{
"comment": "Phrase in quotes","name": "string.quoted.double.lsdyna","match": "(\"([^\"]|\"\")*\")"
}
]
}
}
}
这样做之后,虽然VS可以识别新语言,但是代码折叠(大纲)区域并不是我想要的。可以看出,默认的代码折叠区域并没有覆盖整个数字区域(如红色方块标记所示)。
https://i.imgur.com/8o6OzR8.png
那么有没有什么办法可以更改自定义语言的VS默认代码折叠区域?
谢谢。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)