Skip to content

Commit b6114ff

Browse files
committed
Rearrange docs
1 parent 5c23adb commit b6114ff

File tree

4 files changed

+102
-84
lines changed

4 files changed

+102
-84
lines changed

README.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,6 @@ Highlights scope names with their own themed colour in realtime:
5151
}
5252
```
5353

54-
Invalid code is highlighted in red and underlined
55-
Incorrect code is highlighted in red and with italics
56-
Unsupported json keys and values default back to their standard json colours
57-
Unknown code is highlighted red
58-
59-
60-
## Requirements
61-
This extension was designed with VSCode's default Dark+ theme in mind
62-
Other themes may work with various successes
63-
If you would like me to add support for a theme, please just message me
6454

6555

6656
### For more information

documentation/README.md

Lines changed: 70 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,70 @@
1-
### [Introduction](https://github.com/RedCMD/TmLanguage-Syntax-Highlighter/blob/main/documentation/index.md)
2-
### [Github](https://github.com/RedCMD/TmLanguage-Syntax-Highlighter)
3-
### [Rules](https://github.com/RedCMD/TmLanguage-Syntax-Highlighter/blob/main/documentation/rules.md)
4-
### [Schema](https://github.com/RedCMD/TmLanguage-Syntax-Highlighter/blob/main/vscode.tmLanguage.schema.json)
1+
## Introduction
2+
3+
TextMate is a general purpose GUI text editor for MacOS released by [MacroMates](https://macromates.com/).
4+
It is also a language grammar specification that is mainly used for syntax highlighting.
5+
Supported by [VSCode](https://code.visualstudio.com/), [Github](https://github.com/github-linguist/linguist), [Sublime](https://www.sublimetext.com/), [Atom](https://github.com/atom) and of course [TextMate](https://macromates.com/manual/en/language_grammars).
6+
7+
TextMate has a lot of incomplete and fragmented [documentation](https://macromates.com/manual/en/).
8+
Hopefully this can be a comprehensive guide for VSCode's JSON TextMate.
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).
14+
15+
TextMate is a top down line based lexer. This was done for performance reasons.
16+
Meaning you cant match new lines `\n`.
17+
18+
The rest of this file will be in the context of VSCode's TextMate JSON.
19+
20+
* Todo: Improve layout of this file. Split each section into its own separate file?
21+
22+
## Package.json
23+
VSCode TextMate syntax files use the file extension `.tmLanguage.json` and are located in `./extensions/publisher.extension_name.version/syntaxes/*`.
24+
Todo: Explain basics of the `Package.json` in relation to TextMate syntaxes.
25+
26+
## [Rules](rules.md)
27+
28+
## Regex
29+
VSCode TextMate uses the [oniguruma](https://github.com/kkos/oniguruma) dialect.
30+
It used to use Ruby.
31+
Here is a list of all valid regex [expressions](https://github.com/kkos/oniguruma/blob/master/doc/RE).
32+
[regex.tmLanguage.json](https://github.com/RedCMD/TmLanguage-Syntax-Highlighter/blob/main/syntaxes/regex.tmLanguage.json).
33+
`\\K` [Keep](https://github.com/kkos/oniguruma/blob/master/doc/RE#L183) effectively moves the start position of the captured text.
34+
`\\G` [MatchAnchor](https://github.com/kkos/oniguruma/blob/master/doc/RE#L182) matches against the end of a [begin](./rules.md#begin) rule.
35+
Capture groups inside a positive-lookaround can be targeted by [capture](rules.md#capture).
36+
Capture groups inside a negative-lookaround will cause an error. Use non-capture group `(?:...)` instead.
37+
38+
## Embedded Languages
39+
[embedded-languages](https://code.visualstudio.com/api/language-extensions/embedded-languages)
40+
Todo:
41+
42+
43+
## More Links
44+
- https://code.visualstudio.com/api/language-extensions/syntax-highlight-guide
45+
- https://code.visualstudio.com/api/language-extensions/embedded-languages
46+
- https://macromates.com/manual/en/
47+
- https://macromates.com/textmate/manual/
48+
- https://www.apeth.com/nonblog/stories/textmatebundle.html
49+
- https://www.sublimetext.com/docs/3/scope_naming.html
50+
- https://www.regular-expressions.info/refquick.html\
51+
- https://gist.github.com/Aerijo/b8c82d647db783187804e86fa0a604a1
52+
- https://gist.github.com/DamnedScholar/622926bcd222eb1ddc483d12103fd315
53+
- https://github.com/kkos/oniguruma/blob/master/doc/RE
54+
- https://github.com/chbk/flight-manual.atom.io/blob/scopes/content/hacking-atom/sections/syntax-naming-conventions.md
55+
- https://github.com/jeff-hykin/better-cpp-syntax/blob/master/documentation/library/textmate_while.md
56+
- https://github.com/RedCMD/TmLanguage-Syntax-Highlighter
57+
- https://github.com/bevry/cson#what-is-cson
58+
- https://github.com/microsoft/vscode/tree/main/extensions
59+
- https://github.com/microsoft/vscode/blob/main/extensions/json/syntaxes/JSON.tmLanguage.json
60+
- https://github.com/dunstontc/textmate/blob/master/readme.md
61+
- https://github.com/microsoft/vscode-textmate/issues/208
62+
- https://github.com/microsoft/vscode-textmate/issues/193
63+
- https://github.com/microsoft/vscode-textmate/issues/167
64+
- https://github.com/microsoft/vscode-textmate/issues/140
65+
- https://github.com/microsoft/vscode-textmate/issues/127
66+
- https://github.com/microsoft/vscode-textmate/issues/83
67+
- https://github.com/microsoft/vscode-textmate/issues/74
68+
- https://github.com/microsoft/vscode-textmate/issues/52
69+
- https://github.com/microsoft/vscode-textmate/issues/48
70+
- https://github.com/Microsoft/vscode-textmate/issues/12

documentation/index.md

Lines changed: 4 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,4 @@
1-
## Introduction
2-
3-
TextMate is a general purpose GUI text editor for MacOS released by [MacroMates](https://macromates.com/).
4-
It is also a language grammar specification that is mainly used for syntax highlighting.
5-
Supported by [VSCode](https://code.visualstudio.com/), [Github](https://github.com/github-linguist/linguist), [Sublime](https://www.sublimetext.com/), [Atom](https://github.com/atom) and of course [TextMate](https://macromates.com/manual/en/language_grammars).
6-
7-
TextMate has a lot of incomplete and fragmented [documentation](https://macromates.com/manual/en/).
8-
Hopefully this can be a comprehensive guide for VSCode's JSON TextMate.
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).
14-
15-
TextMate is a top down line based lexer. This was done for performance reasons.
16-
Meaning you cant match new lines `\n`.
17-
18-
The rest of this file will be in the context of VSCode's TextMate JSON.
19-
20-
* Todo: Improve layout of this file. Split each section into its own separate file?
21-
22-
## Package.json
23-
VSCode TextMate syntax files use the file extension `.tmLanguage.json` and are located in `./extensions/publisher.extension_name.version/syntaxes/*`.
24-
Todo: Explain basics of the `Package.json` in relation to TextMate syntaxes.
25-
26-
## [Rules](rules.md)
27-
28-
## Regex
29-
VSCode TextMate uses the [oniguruma](https://github.com/kkos/oniguruma) dialect.
30-
It used to use Ruby.
31-
Here is a list of all valid regex [expressions](https://github.com/kkos/oniguruma/blob/master/doc/RE).
32-
[regex.tmLanguage.json](https://github.com/RedCMD/TmLanguage-Syntax-Highlighter/blob/main/syntaxes/regex.tmLanguage.json).
33-
`\\K` [Keep](https://github.com/kkos/oniguruma/blob/master/doc/RE#L183) effectively moves the start position of the captured text.
34-
`\\G` [MatchAnchor](https://github.com/kkos/oniguruma/blob/master/doc/RE#L182) matches against the end of a [begin](./rules.md#begin) rule.
35-
Capture groups inside a positive-lookaround can be targeted by [capture](rules.md#capture).
36-
Capture groups inside a negative-lookaround will cause an error. Use non-capture group `(?:...)` instead.
37-
38-
## Embedded Languages
39-
[embedded-languages](https://code.visualstudio.com/api/language-extensions/embedded-languages)
40-
Todo:
41-
42-
43-
## More Links
44-
- https://code.visualstudio.com/api/language-extensions/syntax-highlight-guide
45-
- https://code.visualstudio.com/api/language-extensions/embedded-languages
46-
- https://macromates.com/manual/en/
47-
- https://macromates.com/textmate/manual/
48-
- https://www.apeth.com/nonblog/stories/textmatebundle.html
49-
- https://www.sublimetext.com/docs/3/scope_naming.html
50-
- https://www.regular-expressions.info/refquick.html\
51-
- https://gist.github.com/Aerijo/b8c82d647db783187804e86fa0a604a1
52-
- https://gist.github.com/DamnedScholar/622926bcd222eb1ddc483d12103fd315
53-
- https://github.com/kkos/oniguruma/blob/master/doc/RE
54-
- https://github.com/chbk/flight-manual.atom.io/blob/scopes/content/hacking-atom/sections/syntax-naming-conventions.md
55-
- https://github.com/jeff-hykin/better-cpp-syntax/blob/master/documentation/library/textmate_while.md
56-
- https://github.com/RedCMD/TmLanguage-Syntax-Highlighter
57-
- https://github.com/bevry/cson#what-is-cson
58-
- https://github.com/microsoft/vscode/tree/main/extensions
59-
- https://github.com/microsoft/vscode/blob/main/extensions/json/syntaxes/JSON.tmLanguage.json
60-
- https://github.com/dunstontc/textmate/blob/master/readme.md
61-
- https://github.com/microsoft/vscode-textmate/issues/208
62-
- https://github.com/microsoft/vscode-textmate/issues/193
63-
- https://github.com/microsoft/vscode-textmate/issues/167
64-
- https://github.com/microsoft/vscode-textmate/issues/140
65-
- https://github.com/microsoft/vscode-textmate/issues/127
66-
- https://github.com/microsoft/vscode-textmate/issues/83
67-
- https://github.com/microsoft/vscode-textmate/issues/74
68-
- https://github.com/microsoft/vscode-textmate/issues/52
69-
- https://github.com/microsoft/vscode-textmate/issues/48
70-
- https://github.com/Microsoft/vscode-textmate/issues/12
1+
### [Introduction](https://github.com/RedCMD/TmLanguage-Syntax-Highlighter/blob/main/documentation/index.md)
2+
### [Github](https://github.com/RedCMD/TmLanguage-Syntax-Highlighter)
3+
### [Rules](https://github.com/RedCMD/TmLanguage-Syntax-Highlighter/blob/main/documentation/rules.md)
4+
### [Schema](https://github.com/RedCMD/TmLanguage-Syntax-Highlighter/blob/main/vscode.tmLanguage.schema.json)

documentation/injection_order.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
## Injections
2+
3+
There are two different injection types:
4+
`"injectionSelector"` which is used with `"injectTo"` in `package.json`.
5+
`"injections"` which is only used within a TextMate grammar and doesn't work from embedded grammars.
6+
7+
```json textmate
8+
"injectionSelector": "L:text.html.markdown -meta.embedded.block.json.textmate"
9+
10+
"injections": {
11+
"L:capture-group-lookbehind -capture-group-modify-extended -character-class -comment": {
12+
"patterns": [
13+
{ "include": "source.syntax.regexp.tmLanguage#capture-group-lookbehind-invalid" },
14+
{ "include": "source.syntax.regexp.tmLanguage#absent-invalid" }
15+
]
16+
}
17+
}
18+
```
19+
20+
## Pattern order
21+
22+
23+
1. L:injection
24+
2. end
25+
3. patterns
26+
4. applyEndPatternLast
27+
5. injection
28+
6. R:injection

0 commit comments

Comments
 (0)