Skip to content

Commit 05549ab

Browse files
committed
List TextMate engines
1 parent b61ffb7 commit 05549ab

File tree

2 files changed

+44
-15
lines changed

2 files changed

+44
-15
lines changed

documentation/README.md

Lines changed: 41 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,58 @@ Supported by [VSCode](https://code.visualstudio.com/), [Github](https://github.c
77
TextMate has a lot of incomplete and fragmented [documentation](https://macromates.com/manual/en/).
88
Hopefully this can be a comprehensive guide for VSCode's JSON TextMate.
99

10-
VSCode supports TextMate in [JSON](https://www.json.org/json-en.html) (`.tmLanguage.json`) and [XML](https://en.wikipedia.org/wiki/XML) (`.tmLanguage`) formats.
11-
[TextMate](https://macromates.com/manual/en/appendix#property-list-format) uses the [old-style property list format](http://developer.apple.com/documentation/Cocoa/Conceptual/PropertyLists/Articles/OldStylePListsConcept.html) (Which Apple has kindly removed the link for us).
12-
Sublime supports [YAML](https://yaml.org/).
13-
Atom supports [CSON](https://github.com/lifthrasiir/cson).
10+
Supported formats:
11+
* VSCode
12+
* [JSON](https://www.json.org/json-en.html) `.tmLanguage.json`
13+
* [XML](https://en.wikipedia.org/wiki/XML) `.tmLanguage`
14+
* [TextMate](https://macromates.com/manual/en/appendix#property-list-format)
15+
* [Ascii Plist](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/PropertyLists/OldStylePlists/OldStylePLists.html) `.tmLanguage` Old-style property list format [parser](https://github.com/textmate/textmate/blob/master/Frameworks/plist/src/ascii.rl)
16+
* Sublime
17+
* [YAML](https://yaml.org/) `.yaml`
18+
* Atom
19+
* [CSON](https://github.com/lifthrasiir/cson) `.cson`
20+
* [Github-Linguist](https://github.com/github-linguist/linguist)
21+
* JSON `.json`
22+
* XML `.plist`, `.tmlanguage`
23+
* YAML `.yaml-tmlanguage`
24+
* CSON `.cson`
1425

1526
TextMate is a top down line based lexer. This was done for performance reasons.
16-
Meaning you cant match new lines `\n`.
27+
Meaning you can't match past/over new lines `\n`.
1728

18-
The rest of this file will be in the context of VSCode's JSON TextMate.
19-
20-
* Todo: Improve layout of this file. Split each section into its own separate file?
2129

2230
## Package.json
23-
VSCode TextMate syntax files use the file extension `.tmLanguage.json` and are located in `./extensions/publisher.extension_name.version/syntaxes/*`.
31+
VSCode's TextMate grammar files use the file extension `.tmLanguage.json` & `.tmLanguage` and are located in `./extensions/publisher.extension_name.version/syntaxes/*`.
2432
Todo: Explain basics of the `Package.json` in relation to TextMate syntaxes.
2533

2634
## [Rules](rules.md)
2735

2836
## [Injections](injections.md)
2937

3038
## Regex
31-
VSCode TextMate uses the [oniguruma](https://github.com/kkos/oniguruma) dialect.
32-
It used to use Ruby.
33-
Here is a list of all valid regex [expressions](https://github.com/kkos/oniguruma/blob/v6.9.8/doc/RE).
39+
List of TextMate engines and their regex engines:
40+
* [VSCode](https://github.com/microsoft/vscode)
41+
* [vscode-textmate](https://github.com/microsoft/vscode-textmate/tree/v9.2.0) v9.2.0
42+
* [vscode-oniguruma](https://github.com/microsoft/vscode-oniguruma/tree/v1.7.0) v1.7.0
43+
* [oniguruma](https://github.com/kkos/oniguruma/blob/v6.9.8/doc/RE) v6.9.8
44+
* [TextMate](https://macromates.com/) 2.0
45+
* [textmate/Onigmo](https://github.com/textmate/Onigmo/blob/Onigmo-5.13.5/doc/RE) v5.13.5
46+
* [k-takata/Onigmo](https://github.com/k-takata/Onigmo)
47+
* [oniguruma](https://github.com/kkos/oniguruma)
48+
* [GitHub](https://github.com/)
49+
* [Linguist](https://github.com/github-linguist)
50+
* PrettyLights
51+
* [PCRE](https://www.pcre.org/) v8.45
52+
* Pygments
53+
* [NovaLightshow](https://github.com/Nixinova/NovaLightshow)
54+
* [starry-night](https://github.com/wooorm/starry-night)
55+
* [vscode-textmate](https://github.com/microsoft/vscode-textmate)
56+
* [vscode-oniguruma](https://github.com/microsoft/vscode-oniguruma)
57+
* [oniguruma](https://github.com/kkos/oniguruma/blob/v6.9.8/doc/RE) v6.9.8
58+
* [ShikiJS](https://github.com/shikijs/shiki)
59+
* [vscode-oniguruma](https://github.com/microsoft/vscode-oniguruma)
60+
* [oniguruma](https://github.com/kkos/oniguruma/blob/v6.9.8/doc/RE) v6.9.8
61+
3462
[regex.tmLanguage.json](https://github.com/RedCMD/TmLanguage-Syntax-Highlighter/blob/main/syntaxes/regex.tmLanguage.json).
3563
`\\K` [Keep](https://github.com/kkos/oniguruma/blob/v6.9.8/doc/RE#L183) effectively moves the start position of the captured text.
3664
`\\G` [MatchAnchor](https://github.com/kkos/oniguruma/blob/v6.9.8/doc/RE#L182) matches against the end of a [begin](./rules.md#begin) rule.
@@ -54,6 +82,7 @@ Todo:
5482
- https://markdown-all-in-one.github.io/docs/contributing/textmate-language-grammar.html
5583
- https://gist.github.com/Aerijo/b8c82d647db783187804e86fa0a604a1
5684
- https://gist.github.com/DamnedScholar/622926bcd222eb1ddc483d12103fd315
85+
- https://github.com/Alhadis/language-etc/blob/master/samples/lists/scope-previews.nanorc
5786
- https://github.com/mjbvz/vscode-fenced-code-block-grammar-injection-example
5887
- https://github.com/kkos/oniguruma/blob/v6.9.8/doc/RE
5988
- https://github.com/chbk/flight-manual.atom.io/blob/scopes/content/hacking-atom/sections/syntax-naming-conventions.md

documentation/rules.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ Valid VSCode TextMate rules:
1818
* [patterns](#patterns)
1919
* [repository](#repository)
2020

21-
Valid official TextMate rules: (ignored by VSCode TextMate)
21+
Valid TextMate 2.0 rules: (ignored by VSCode TextMate)
2222
* [name](#name_display)
2323
* [fileTypes](#filetypes)
2424
* [firstLineMatch](#firstlinematch)
2525
* [foldingStartMarker](#foldingstartmarker)
2626
* [foldingStopMarker](#foldingstopmarker)
2727

28-
Other supported rules: (ignored by VSCode/official TextMate)
28+
Other rules: (ignored by VSCode/TextMate)
2929
* [information_for_contributors](#information_for_contributors)
3030
* [version](#version)
3131
* [$schema](#schema)
@@ -44,7 +44,7 @@ The [scopeName](https://github.com/microsoft/vscode-textmate/blob/main/src/rawGr
4444
It is the same value as `"scopeName"` under `"grammars"` in your `package.json` file.
4545
It should be globally unique.
4646
You should use the recommended format of `source.languageId` or `text.languageId`.
47-
Or if you are extending another language via injections etc, use `source`/`text.theirLanguageId.yourScope`.
47+
If you are extending another language, you should add your language on the end of their scopeName `source.theirLanguageId.yourLanguageId`.
4848
For example [HTML (Derivative)](https://github.com/textmate/html.tmbundle/blob/master/Syntaxes/HTML.plist) `text.html.derivative` extending [HTML](https://github.com/textmate/html.tmbundle/blob/master/Syntaxes/HTML%20(Derivative).tmLanguage) `text.html.basic`
4949

5050
## patterns

0 commit comments

Comments
 (0)