Skip to content

Commit c96e318

Browse files
committed
add tip for textmate grammars files
1 parent 2ab7d01 commit c96e318

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

docs/guide/using-language.md

+8
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ TextMate supports various languages, and syntax-highlight rules are defined by `
2121
You can find those files in:
2222
* [TM4E Language Packs](https://github.com/eclipse/tm4e/tree/25e7fbe39c02644ca5d541d20a2c601791af7b8d/org.eclipse.tm4e.language_pack/syntaxes)
2323
* [VSCode Extensions](https://github.com/microsoft/vscode/tree/4f2ff19ecacffa0aa4874db4d63ed4e899d98431/extensions)
24+
25+
::: tip NOTE
26+
27+
Some TextMate syntaxes are not fully supported by current TextMate engine. Because the regexp library [Joni](https://github.com/jruby/joni) does not fully support those regular expressions used in grammar files.
28+
29+
These regexps will fallback to `^$` to avoid errors during highlight analysis.
30+
31+
:::
2432
#### Find Themes
2533
TextMate must be used together with TextMate themes. You also need to find theme JSON files from [VSCode Extensions](https://github.com/microsoft/vscode/tree/4f2ff19ecacffa0aa4874db4d63ed4e899d98431/extensions).
2634
There are some folders named in `theme-*` pattern. Those folders are for VSCode built-in TextMate themes.

docs/zh/guide/using-language.md

+7
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ textmate支持非常多的语言,它的语法高亮规则由名为`*.tmLanguag
3636
* [TM4E语言包](https://github.com/eclipse/tm4e/tree/25e7fbe39c02644ca5d541d20a2c601791af7b8d/org.eclipse.tm4e.language_pack/syntaxes)
3737
* [VSCode扩展](https://github.com/microsoft/vscode/tree/4f2ff19ecacffa0aa4874db4d63ed4e899d98431/extensions)
3838

39+
::: tip 注意
40+
41+
当前的 TextMate 引擎对某些 TextMate 语法文件支持不完全。这是正则表达式库 [Joni](https://github.com/jruby/joni) 对这些语法文件中的正则表达式支持不完全导致的。
42+
43+
在进行高亮分析时,这些不受支持的正则表达式将用 `^$` 代替以避免产生错误。
44+
45+
:::
3946
#### 查找主题
4047

4148
textmate必须和textmate主题搭配使用。你还需要从[VSCode Extensions](https://github.com/microsoft/vscode/tree/4f2ff19ecacffa0aa4874db4d63ed4e899d98431/extensions)

0 commit comments

Comments
 (0)