tmlanguage

What's wrong with my syntax highlighting grammar injection?

冷暖自知 提交于 2020-06-27 13:59:19
问题 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" } ], "repository": { "superjs-code-block": { "begin": "superjs", "end": "(^|\\G)(?=\\s*[`~]{3,}\\s*$)", "contentName": "meta.embedded.block.superjs", "patterns": [ { "include": "source.js" } ] } }, "scopeName": "markdown.superjs.codeblock" } There is a small problem with the above code - As long

VSCode: change precedence of rules in custom TextMate grammar?

房东的猫 提交于 2020-06-17 22:57:45
问题 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 looks like this: The scopes are: urgent (red; lines starting with XXam/pm or * ) waiting (yellow; lines starting with ` ) url (purple; words starting with http ) tag (blue; words starting with @ ) I'd like tags and URLs to be colored even within

Can a language in Visual Studio Code be extended?

最后都变了- 提交于 2020-01-13 10:10:06
问题 Scenario I have JSON files that describe a series of tasks to be carried out, where each task can refer to other tasks and objects in the JSON file. { "tasks": [ { "id": "first", "action": "doSomething()", "result": {} }, { "id": "second", "action": "doSomething(${id:first.result})", "result": {} }, ] } I'd like to have both JSON schema validation and custom language text effects like keyword coloring and even "Go to definition" support within strings in the JSON. What I can do I can create

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

时光毁灭记忆、已成空白 提交于 2020-01-03 05:54:08
问题 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 folding rules. I would like to inherit language A's syntax when it is embedded in Language B between START_MARKER and END_MARKER. Is this possible? Can someone help with the JSON syntax to accomplish this? Bonus Q: Can anyone point me to a real

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

坚强是说给别人听的谎言 提交于 2020-01-03 05:54:02
问题 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 folding rules. I would like to inherit language A's syntax when it is embedded in Language B between START_MARKER and END_MARKER. Is this possible? Can someone help with the JSON syntax to accomplish this? Bonus Q: Can anyone point me to a real

How to match operator-separated strings in Sublime Package Development YAML tmlanguage

此生再无相见时 提交于 2019-12-12 03:28:20
问题 I am making a syntax definition for a custom-made language in sublime text 2 using PackageDevelopment's .YAML-tmLanguage . For now I want my syntax to identify strings to non strings. sample line of code: string name = "Chuck Norris"; string message = "I am " + name + ", don't mess with a \"ROCKSTAR\"!"; my pattern for double quoted string: - comment: strings in double quotes match: (".+") captures: '1': {name: string.quoted.double.me} what the pattern captures: string name = "Chuck Norris" ;

How can I extend existing tmLanguage Colorizer/ Syntax highlighter?

别说谁变了你拦得住时间么 提交于 2019-12-12 02:54:16
问题 I'm trying to extend https://github.com/dzannotti/vscode-babel/blob/master/syntaxes/Babel%20Language.json but all my attempts just result in a complete override, leaving the text blank. I'd rather not be a jerk and just copy the code into my highlighter. I want to extend the colorizer and just add my patterns ontop of it. Here's my current attempt: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0

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

若如初见. 提交于 2019-12-08 03:52:02
问题 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() command, it means NOT. For example some of my code would look like: if condition=(eval(!DB_EXIST)) ! this is a comment (eval( !DB_UPDATED && !DB_EXIST)) !---"!" inside eval() means NOT !this is another comment <some commands> ! this is also a

Add an operator to visual studio code theme in settings.json

為{幸葍}努か 提交于 2019-12-07 10:05:51
问题 I'm trying to add the words and , or , not (for Lua) to the Visual Studio Code theme called "Visual Studio Dark" that is included in the vscode regular download and in the "select color theme" screen is called "Dark (Visual Studio)" I've searched online and came about this page: Visual Studio Code Themes. This page made clear via the pictures in it that by adding a setting in the settings.json file I could get this done. I added the "editor.tokenColorCustomizations" setting as seen in the

Add an operator to visual studio code theme in settings.json

南笙酒味 提交于 2019-12-05 15:49:36
I'm trying to add the words and , or , not (for Lua) to the Visual Studio Code theme called "Visual Studio Dark" that is included in the vscode regular download and in the "select color theme" screen is called "Dark (Visual Studio)" I've searched online and came about this page: Visual Studio Code Themes . This page made clear via the pictures in it that by adding a setting in the settings.json file I could get this done. I added the "editor.tokenColorCustomizations" setting as seen in the second and third picture on that page. Two pages of linking through further I found this page: Scope