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
1
vote
1 answer

How to detect multiline string when the start and end is a keyword?

I'm trying to get develop a syntax highlighting for such a text: PAGE_TEXT_PARAGRAPH_START (HN 10 JUSTIFIED 0.0 4.0) Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed sagittis varius nulla, nec rhoncus erat vehicula eget. Sed suscipit…
1
vote
1 answer

Why is my tmLanguage syntax highlighter for VSCode not working on curly brackets?

I have this as my vscode tmLanguage.json sort of syntax highlighter config: { "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", "name": "Link", "patterns": [ { "include":…
Lance
  • 75,200
  • 93
  • 289
  • 503
1
vote
1 answer

Match beginning of a line and beginning of remain line

I'm trying come up with syntax highlighter that would match beginning of the line (timestamp) and then beginning of the remaining line. For example: 12:34:56.789 some1 text some2 other text some3 text some4 other text I need to capture words some…
vanowm
  • 9,466
  • 2
  • 21
  • 37
1
vote
0 answers

Regex matching but no highlighting

I am currently creating a language extension. When adding comments (starts with $$), I ran into a hurdle. "comments":{ "patterns": [{ "name": "comment.line.sahutorepol", "match": "\\$\\$.*$\\n?" }] }, Despite the regex…
Minek Po1
  • 142
  • 1
  • 9
1
vote
1 answer

.tmLanguage.json RegEx expression not working/leads to no syntax highlighting

I want to highlight everything after "print" as a string, the problem is that this leads to no highlighting even though the regex, in theory, should work. As an example replacing "match": with "begin":"somestring" and typing somestring into vscode,…
mrx
  • 51
  • 6
1
vote
1 answer

How to add a custom tmLanguage syntax to Sphinx/RST

Is there a method to import a tmLanguage.json into Sphinx to add support for a new/custom language for RST?
Ajani Bilby
  • 112
  • 10
1
vote
1 answer

tmLanguage support for strange multiline string literal

I've got an extension for the LPC programming language for Visual Studio Code. I'm using tmLanguage grammars. However, I haven't figure out a way to support the language's multiline string literals. regex would be:…
1
vote
0 answers

How to multiple colors in vs code syntax highlighting?

I have created a language support extension in vs code. Now I have added all the keywords to my tmLanguage.json file. But I see all the keywords are highlighted in a single color(Blue). Is there any way to add multi colors to my syntax highlighting?…
akhil
  • 105
  • 10
1
vote
0 answers

Trying to build a regex for if then statement in vscode extension syntax

Long time lurker, first time poster. I'm trying to write a vscode syntax for TeraTerm (ttl), of which has been quite the learning experience, and have hit a few walls. Biggest problem I have is writing a regex for ttl's if/then/endif. Normally I…
Cohors
  • 11
  • 2
1
vote
0 answers

Is it possible to dynamically add "keywords" in VS Code syntax highlighting?

I've been playing around with syntax highlighting in VS Code and have so far been able to get a pretty good result using a custom JSON TextMate grammar. Although an extension already existed for GCC ARM Assembly, I thought it sucked, so I used the…
1
vote
0 answers

Visual studio code tmlanguage extend existing lang

I would like to create my syntax for VS code, expanding the TypeScript one. This is my tmlanguage.json created with yo code helper: { "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", "name":…
marco burrometo
  • 1,055
  • 3
  • 16
  • 33
1
vote
1 answer

VS Code Extension: how to match "strings" without overwrite the color of another pattern (tmLanguage.json)

I am writing an extension for a specific language for Visual Studio Code and I made it so far that I can set the colors for several commands. I have my mylang.tmLanguage.json which contains (simplified) the following: { "\\$schema":…
Raydir
  • 27
  • 5
1
vote
1 answer

Visual Studio Code: How to Include another language in a user defined language?

I have downloaded a plugin for Language A. It is at %USERPROFILE%\.vscode\extensions\langA\syntaxes. There is a file langA.tmLanguage. It is XML. I am creating Language B. I have a JSON .tmLanguage file. I have already added some custom coloring and…
1
vote
1 answer

vscode new language configuration not changing syntax colors

I'm trying to create a new language for syntax highighting in Visual Studio Code for the CPU12 assembly language. When I use the new language in a new .asm file, the editor knows that the comment character is (it adds a semicolon to a line when I…
vahlala
  • 355
  • 3
  • 14
1
vote
0 answers

Regular expression, find all occurrence of the result (group)

I have this regular expression: (?i)((\w+\s+)(?=\s*IN\s+|\s*IN\s+OUT\s+|(?
Danieleee
  • 721
  • 1
  • 6
  • 6