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
0
votes
0 answers

What is equivalent for injection grammars in Visual Studio

In visual studio code we have a concept who name is injection grammars and definition is let you extend an existing grammar. An injection grammar is a regular TextMate grammar that is injected into a specific scope within an existing grammar.…
0
votes
1 answer

fstring quotes scope vscode theme

I'm using a vscode customized theme that I changed to fit my needs, which I based on github dark for scopes. I'm finally in a spot I find it nice looking but I have a problem with fstring quotes, they simply don't get colored. I've tried some…
0
votes
0 answers

Parsing complex function declarations using tmlanguage

I'm writing a vscode extension for my programming language. I'm having difficulty coming up with a tmlanguage rule to parse my function declarations. A function can look like this: def macro_1 macro_2(foo, 20) function1(a: int, b: double) -> int…
0
votes
1 answer

Custom language vscode extension syntax highlighting for variables and function call

I'm working on vscode extension for custom language. I've developed tmlangauge.json for syntax highlighting keywords and operators. I find it a hard time to add syntax highlighting for variables and function calls. The variable declaration looks…
0
votes
0 answers

User defined colors in textmate grammar?

I use TexMate grammar to change colors of certain keywords/lines in output pane.: my-output.tmLanguage.json { "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", "name": "my-output", "scopeName":…
vanowm
  • 9,466
  • 2
  • 21
  • 37
0
votes
0 answers

Nested patterns in tmLanguage.json - how to match first keyword occurrence only?

I'm confused how nested patterns work in tmLanguage.json When I have the following code: { "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", "name": "myexample", "scopeName": "source.myexample", …
Xyu
  • 56
  • 3
0
votes
0 answers

I'm developing a programing language extension for visual studio code

I'm developing a programing language extension for visual studio code, and I need help with highlighting code.
user19745181
0
votes
0 answers

Using the capture from begin in the text between in tmLanguage

I am trying to color my language like this, where the loop variable in detected from the variable name in the ?myFor and subsequently colored in the body of the for loop. My grammar looks like this for now where I am able to detect begin and end…
Shashank Holla
  • 377
  • 3
  • 12
0
votes
0 answers

Why does `captures` not work in tmLanguage when the capture groups are too complex?

I'm wondering why captures isn't able to determine the capture groups when they get too complex. I have created the following regex, and it only matches the first group. (type)((((…
Stan Hurks
  • 1,844
  • 4
  • 14
  • 25
0
votes
1 answer

VSCode create custom colorized language syntax highlighter extension for a custom language

Where and how do we change the colors for the syntax highlighters for specific languages? GOAL: Ideally, I'd like to: 1. Understand how to create an extension that modifies the colors of code 2. Branch and modify this extension to do what I want…
MaxRocket
  • 920
  • 1
  • 12
  • 26
0
votes
1 answer

How to syntax highlight nested items in VSCode tmlanguage.json?

How do I syntax highlight this part in the image below: function foo input x, default 123 input y call z, x, y Basically, anything nested inside something else, should be black, while the "parent" object should be some other color (gray…
Lance
  • 75,200
  • 93
  • 289
  • 503
0
votes
1 answer

How to customize the theme of this syntax highlighter for VSCode (tmlanguage.json)?

I have a few questions about VSCode Syntax Highlighting tmLanguage.json that I haven't been able to find easily so far in browsing google and the VSCode docs (and textmate docs). All of these apply to building your own language extension (I used yo…
Lance
  • 75,200
  • 93
  • 289
  • 503
0
votes
1 answer

How to define template strings in textmate language definitions for VSCode syntax highlighting?

I have a script which has these components: terms: /[a-z][a-z0-9]*(?:-[a-z0-9]+)*/ strings: <.+> numbers: \d+ However, strings can also be "template strings", and have nested terms/strings/numbers inside. They are delimited by {...} curly…
Lance
  • 75,200
  • 93
  • 289
  • 503
0
votes
1 answer

Is there a way to prevent (have everything but) specific characters in "match" in .tmLanguage

As the title said, is there a way to prevent specific characters in "match" in .tmLanguage syntax highlighting? Like, for example, match everything but w and s.
TeaCoast
  • 352
  • 3
  • 12
0
votes
1 answer

Regex to match anything between = object and (

I'm developing a VS Code extension to support a new language, and for some syntax highlight I want to match any text between = object and (. I tried the following Regex: { "name": "entity.name.class", "match":…
rbasniak
  • 4,484
  • 11
  • 51
  • 100