vscode-textmate
vscode-textmate copied to clipboard
A library that helps tokenize text using Text Mate grammars.
You cant define recursive regex patterns to match, this would be useful when doing something, that might need matched parenthesis and you are already using a begin/end or this method...
Languages often have patterns that reappear in multiple places, like identifiers or argument-lists. These can have quite some length to it and may make the match-expression as a whole less...
Example code from the HTML syntax highlighting extension: https://github.com/microsoft/vscode/blob/2260d7cca34384a2838c728850afdd38113ddb47/extensions/html/syntaxes/html.tmLanguage.json#L11 ![image](https://user-images.githubusercontent.com/33529441/171994566-473be163-1bd0-44f6-bac5-dc0d8d4d4929.png) It would be expected that `meta.tag.*.*.html` matches a scope starting with `meta.tag`, containing any 2 words inside and ends with...
I think this line: https://github.com/microsoft/vscode-textmate/blob/9157c7f869219dbaf9a5a5607f099c00fe694a29/src/grammar.ts#L147 should rather be this: ```ts collectSpecificDependencies(result, baseGrammar, baseGrammar, includedName, baseGrammar.repository); ``` Also, this line: https://github.com/microsoft/vscode-textmate/blob/9157c7f869219dbaf9a5a5607f099c00fe694a29/src/grammar.ts#L149 should be this: ```ts collectSpecificDependencies(result, baseGrammar, selfGrammar, includedName, selfGrammar.repository); ```...
This line collects the dependencies of a relative reference: https://github.com/microsoft/vscode-textmate/blob/9157c7f869219dbaf9a5a5607f099c00fe694a29/src/grammar.ts#L139 However, it passes in the `patternRepository` of the current rule. `collectSpecificDependencies` then continues to use this `patternRepository` as new local...
Problem: "c++.json" file in ".\test-cases\themes\syntaxes" can not be parsed to a grammar, using the way the readme.md file says. I called loadGrammar method to parse this grammar file, **But the...
Some integers (or strings?) are treated differently even though they look the same to me. In each comment I've specified what the scope inspector reports the scope as. Testcase: ```yaml...
Create a syntax highlighter with the following code: ![image](https://user-images.githubusercontent.com/33529441/150917587-7a5afb36-7c12-4005-b466-f402c403f4c9.png) ```json { "scopeName": "source.redcmd.syntax.lag", "patterns": [ { "match": "a", "name": "keyword.control", "captures": { "0": { "patterns": [] } } } ]...
The regex `[[:upper:]]` works as expected at matching only upper case letters. Normally if you missspell anything inside the posix class, the textmate engine will fail. Except for a few...
Creating a syntax highlighter with the following code and running it on a single line file filled with thousands of the letter `c` will cause tremendous lag ![image](https://user-images.githubusercontent.com/33529441/148741438-16ba238c-fb79-4c1f-a454-7618164b5fe2.png) ```json {...