Questions tagged [tmlanguage]

The .tmLanguage TextMate language format describes language grammars, enabling text editors like TextMate, Sublime Text, and VS Code to provide syntax highlighting.

The -based .tmLanguage format contains expressions to capture particular features of a programming language, such as keywords, variables, strings, etc. and names them with one or more scopes.

107 questions
4
votes
1 answer

How to ADD grammar and configuration to an existing VSCode language extension with an Extension?

I am trying to extend the AL language from Microsoft by adding regions. I can do this manually by going to the vscode extension folder .vscode\extensions\Microsoft.al-0.14.17461 and changing the file al.configuration.json and…
BartP
  • 91
  • 4
4
votes
0 answers

Visual Studio Code Syntax HighLighting tmLanguage.json

I'm working on my first compiler as a bit of training project. I'd also like to create a small syntax highlighting project. Looking at the default tmLanguage file, it's unclear to me what triggers a color. For example, I see the string type does in…
4
votes
1 answer

What's wrong with my syntax highlighting grammar injection?

I am following this example for a simple grammar injection in markdown. { "fileTypes": [], "injectionSelector": "L:markup.fenced_code.block.markdown", "patterns": [ { "include": "#superjs-code-block" } ], …
colinfang
  • 20,909
  • 19
  • 90
  • 173
4
votes
1 answer

What does `L:` mean in `"injectionSelector": "L:markup.fenced_code.block.markdown"`?

At https://github.com/mjbvz/vscode-fenced-code-block-grammar-injection-example/blob/master/syntaxes/codeblock.json The extra grammar is injected into the scope markup.fenced_code.block.markdown However L:markup.fenced_code.block.markdown is used.…
colinfang
  • 20,909
  • 19
  • 90
  • 173
4
votes
1 answer

TextMate Grammar -- precedence of rules

I'm trying modify syntax highlighting for CSharp language, so I will get syntax highlighting for SQL in C# string. TextMate has support for embeded languages, so this seems possible. I build on csharp.tmLanguage.json and I would like to be able to…
4
votes
1 answer

Sublime color scheme for XML with Unicode node name

If I use node name in ASCII, I have a nice view: but if I use Unicode node name it is not pretty: How can I fix this?
3
votes
0 answers

VSCode: change precedence of rules in custom TextMate grammar?

In a simple to-do list language grammar that I made, some scopes overlap in their regex rules, so certain scopes are not being recognized at all. I'd like to give these scopes precedence so that they're recognized within another scope. Currently it…
3
votes
1 answer

Define a VSCode Scheme Syntax rule that "always wins"

I'd like to add some additional syntax highlighting to markdown. I defined an injection grammar: { "scopeName": "markdown.mytodos", "injectionSelector": "L:text.html.markdown", "patterns": [ { "include": "#todo" } ], …
SimplGy
  • 20,079
  • 15
  • 107
  • 144
3
votes
0 answers

TextMate grammar - avoid external 'include' overriding local patterns

Tweaking a Atom IDE grammar for SaltStack which has the below pattern but the source.python seems to be overriding one or more of the patterns that are defined in the SaltStack grammar file. { 'include': 'source.python' } How can I set a…
Flo Woo
  • 949
  • 1
  • 12
  • 26
3
votes
1 answer

Syntax highlighting for multiline string literals

I have a custom language for which I want to provide syntax highlighting in Visual Studio Code. In this language string literals start and end either with a double or a single quote. A string literal starting with a double quote may contain single…
3
votes
1 answer

Visual Studio Code Theming - Change CSS Syntax Error Font Color

In addition to this great Q&A, found at Visual Studio Code Theming - change editor error indicator, I am curious what setting / scope controls the font color during an error output in a CSS file? I'd like to be able to change the default value.…
user8299327
3
votes
1 answer

Extend existing tmLanguage file

I am using Sublime Text 3, in this case to edit LaTeX. To further customize the syntax highlighting I would like to define a new scope that simply extends the shipped LaTeX.tmLanguage (to which I do not have access, not even to read). N.B. I have…
Tom de Geus
  • 5,625
  • 2
  • 33
  • 77
3
votes
0 answers

Modifying word separators per scope

I have a custom .tmLanguage file on Sublime Text that require certain word separators. Can I change the word separator per scope inside the same language? I can change the separators using the .sublime-settings file, but it changes to the entire…
3
votes
1 answer

How do I get comment toggle to work with my own tmLanguage syntax for Sublime Text 2?

I made my own syntax highlighting (for a language using c++ code with some additional keywords) by copying and editing the C.tmLanguage file. I did not edit any of the "comments" keys, but now the comment toggle in ST2 does not work. (I think it did…
2
votes
1 answer

TMLanguage, what does captures do?

I am working on a tm language project for vscode and I'm wondering what the captures property on a pattern does exactly. I can't seem to figure out what the indexes of the captures object stand for and I can't find any information on it…
Stan Hurks
  • 1,844
  • 4
  • 14
  • 25