Skip to content

Commit e367f2e

Browse files
committed
[zh] add notes for onigurma-native
1 parent 37fb408 commit e367f2e

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

docs/zh/guide/using-language.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,16 @@ GrammarRegistry.getInstance().loadGrammars(
217217

218218
:::
219219

220+
#### Optional Step
221+
222+
TextMate 默认情况下使用 Joni 作为正则表达式库。Joni 是由纯 Java 实现的,因此在正则表达式匹配过程中,将会生成大量的对象,给虚拟机带来 GC 压力。
223+
224+
为此,我们在 `0.24.0` 版本中引入了原生的 [oniguruma](https://github.com/kkos/oniguruma) 实现,您可以引入 `oniguruma-native` 模块以启用它。这能够加速 TextMate 的高亮速度并减少内存分配。
225+
226+
oniguruma 也是 VSCode 使用的正则表达式库,因此在引入它之后,您应该能使用更多来自 VSCode 的 TextMate Bundles.
227+
228+
我们的[oniguruma 分支](https://github.com/project-sora/oniguruma) 目前支持 Unicode 17.0.0.
229+
220230
#### 设置编辑器
221231

222232
设置编辑器的配色方案。如果`TextMateColorScheme`没被应用到编辑器中,则textmate的语法高亮结果的颜色是透明的。

0 commit comments

Comments
 (0)