visual-studio-code - 用 tmLanguage 匹配 begin 和 pattern without end
问题描述
我正在尝试使用 tmLanguage 定义一种语言,以便在 vscode 中突出显示语法。我有以下规则。
"sexp": {
"name": "entity.sexp",
"patterns": [
{"include": "#list_of_sexp"},
{"include": "#atom"}
]
}
是否有可能有一个与带有“;”前缀的sexp匹配的评论规则?我不确定在“结束”中添加什么。
"comment": {
"name": "comment.sexp",
"begin": ";",
"end": ??,
"patterns": [{ "include": "#sexp" }]
}
解决方案
我最终在“结束”中用一个积极的前瞻正则表达式解决了这个问题。
推荐阅读
- javascript - 反应 - 不点击删除(onClick)?
- javascript - JavaScript中的HTML复选框开/关检测
- django - Django 应用程序中的硒清洁数据库
- python - psycopg2.OperationalError: FATAL: password authentication failed for user but the user is not on that machine
- java - Java SWT 表格单元格比较
- python - 在 Python 中使用信号超时
- apache-spark - spark解析元素数组并比较相关字段
- sqlmap - 如何在 SQLmap 中转储没有数据类型的列?
- android - FirebaseInstanceId 服务类在从 android studio 安装后创建 ANR
- c++ - 隐藏 vtkBoxWidget2 句柄