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

VS Code Extension HTML Injection Grammar

I'm trying to make everything inside a comment inside TODO(...) to act like javascript. It just doesn't work. There is neither any output. package.json { "contributes": { "grammars": [ { "path":…
tscpp
  • 1,298
  • 2
  • 12
  • 35
2
votes
1 answer

Can't get the scope inspector to recognise comments

I've been trying to write my own syntax highlighting extension for the rules we use in a document composition tool. I've been able to get most of it working okay but I just can't get the comments to be recognised by the scope inspector. I removed…
2
votes
1 answer

What is the difference between `injections` and `injectionSelector` in tmLanguage grammars?

I'm already familiar with the injectionScope property when writing an injection grammar for Visual Studio Code. However, I've come across some grammars also using an injections property, for example here:…
2
votes
1 answer

How to use multiple tmLanguage files in vscode extension

I am creating a language extension in vscode for myself. Because it will associate with different file types, I plan to make different tmlanguge files for specific rules. According to this, I could extend the scopeName to achieve that. So I created…
NAX
  • 139
  • 1
  • 7
2
votes
1 answer

How to use "!" as the comment indicator, but also NOT operator in language syntax highlight?

I am using VScode and create my own language extension to highlight syntax, where I need to use regular expression to find the comments. The basic rule is that everything after ! is a comment, however there is a special case. When ! is inside eval()…
NAX
  • 139
  • 1
  • 7
2
votes
1 answer

Dynamic Syntax Highlighting in VSCode

I'm writing an extension for Visual Studio Code which features syntax highlighting for a scripting language. I was able to color many important elements via a TextMate grammar file. There are many lines where I would not know if a captured string…
2
votes
1 answer

How to embed a syntax object in another in TextMate language definitions, tmLanguage

I am trying to support Clojure's ignore text form, #_, (a sort of comment) in VS Code, which uses tmLanguage for its grammar definitions. Since it is common to disable a block of code using #_, I want the disabled block of code to retain its syntax…
PEZ
  • 16,821
  • 7
  • 45
  • 66
2
votes
1 answer

Match single character not enclosed by braces

I am making a property list syntax definition file (tmLanguage) for practice. It's in Sublime Text's YAML format, but I'll be using it in VS Code. I need to match all characters (including unterminated { and }) that are not enclosed by {}. I have…
Jacob Birkett
  • 1,927
  • 3
  • 24
  • 49
2
votes
1 answer

Visual Studio Code C++ color formatting in type declarations

As you can see, in C++ type declarations (string and new type), the colors of the types are in normal text color, which I find oddly peculiar, since it isn't the case for java source codes (even using the exact same theme). I've tried customizing…
Anthony
  • 409
  • 1
  • 5
  • 10
2
votes
1 answer

VSCode Python Language Extension

I'm trying to create a VSCode extension for Ribosome .py.dna files Basically, .py.dna is identical to python, except that lines that start with . should have comment syntax highlighting. So far, this is what I have for my tmLanguage.json: { …
Gillespie
  • 5,780
  • 3
  • 32
  • 54
2
votes
2 answers

Language Syntax Highlight - Comment Line Starts With * may or may not have following words

I am creating a syntax highlight file for a language and I have everything mapped out and working with one exception. I cannot come up with a regex that will match the following conditions for a specific line comment style. If the first non…
2
votes
1 answer

Set color of quotes in Visual Studio Code customized theme

I'm using vscode a customized theme of my own, which I based on another theme. Currently text like this is displayed in white: """ some Python comment """ I would like to change the color but cannot find the right attribute to change. I tried…
f10w
  • 1,524
  • 4
  • 24
  • 39
2
votes
1 answer

tmLanguage syntax highlighting with begin-end rules without highlighting a begin that doesn't have an end

I am creating a simple postfix programming language. The syntax is as follows: 2 3 add adds the two integers 2 and 3 together. "hello, world!" puts puts the string "hello, world!" to STDOUT. The defining of new functions that can be used, is done as…
Qqwy
  • 5,214
  • 5
  • 42
  • 83
2
votes
2 answers

Matching of identifiers between tmLanguage and tmTheme files

I'm trying to understand how Visual Studio Code matches identifiers between theme and language files. For instance in one tmLanguage file I have a definition like this: ... begin
Mike Lischke
  • 48,925
  • 16
  • 119
  • 181
2
votes
2 answers

What is tmLanguage?

I saw this repository. sublimehq/Packages I use sublime text 3, but I don't know tmLanguage file. Also I googled definition of it, but I couldn't find it. What is it?
neosarchizo
  • 648
  • 1
  • 7
  • 16