You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: documentation/README.md
+41-12Lines changed: 41 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,30 +7,58 @@ Supported by [VSCode](https://code.visualstudio.com/), [Github](https://github.c
7
7
TextMate has a lot of incomplete and fragmented [documentation](https://macromates.com/manual/en/).
8
8
Hopefully this can be a comprehensive guide for VSCode's JSON TextMate.
9
9
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).
*[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)
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`.
17
28
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?
21
29
22
30
## 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/*`.
24
32
Todo: Explain basics of the `Package.json` in relation to TextMate syntaxes.
25
33
26
34
## [Rules](rules.md)
27
35
28
36
## [Injections](injections.md)
29
37
30
38
## 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).
@@ -44,7 +44,7 @@ The [scopeName](https://github.com/microsoft/vscode-textmate/blob/main/src/rawGr
44
44
It is the same value as `"scopeName"` under `"grammars"` in your `package.json` file.
45
45
It should be globally unique.
46
46
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`.
48
48
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`
0 commit comments