[vscode-torque] Add vscode extension with basic Torque support.
This CL creates the "tools/torque" directory. It moves the existing two scripts (making the parser and formatting Torque code) into that director. The extension lives in "tools/torque/vscode-torque" and currently only provides basic syntax highlighting support. The easiest way to install the extension is to simply create a symlink into your local vscode extension directory (see README.md). R=jgruber@chromium.org, tebbi@chromium.org Change-Id: Ifc22b615341ed18f91c9b046090f569fcc083ab6 Reviewed-on: https://chromium-review.googlesource.com/1076548 Commit-Queue: Simon Zünd <szuend@google.com> Reviewed-by: Tobias Tebbi <tebbi@chromium.org> Cr-Commit-Position: refs/heads/master@{#53421}
This commit is contained in:
parent
0dbac434af
commit
7975b8cef9
14
tools/torque/vscode-torque/README.md
Normal file
14
tools/torque/vscode-torque/README.md
Normal file
@ -0,0 +1,14 @@
|
||||
# Torque syntax support
|
||||
|
||||
This extensions adds rudimentary syntax highlighting support for the WIP
|
||||
Torque language used in V8.
|
||||
|
||||
## Installation
|
||||
|
||||
Since the extension is not published to the marketplace, the easiest way to
|
||||
install the extension is to symlink the extension to your local extension
|
||||
directory:
|
||||
|
||||
```
|
||||
ln -s $V8/tools/torque/vscode-torque $HOME/.vscode/extensions/vscode-torque
|
||||
```
|
25
tools/torque/vscode-torque/language-configuration.json
Normal file
25
tools/torque/vscode-torque/language-configuration.json
Normal file
@ -0,0 +1,25 @@
|
||||
{
|
||||
"comments": {
|
||||
"lineComment": "//",
|
||||
"blockComment": [ "/*", "*/" ]
|
||||
},
|
||||
"brackets": [
|
||||
["{", "}"],
|
||||
["[", "]"],
|
||||
["(", ")"]
|
||||
],
|
||||
"autoClosingPairs": [
|
||||
["{", "}"],
|
||||
["[", "]"],
|
||||
["(", ")"],
|
||||
["\"", "\""],
|
||||
["'", "'"]
|
||||
],
|
||||
"surroundingPairs": [
|
||||
["{", "}"],
|
||||
["[", "]"],
|
||||
["(", ")"],
|
||||
["\"", "\""],
|
||||
["'", "'"]
|
||||
]
|
||||
}
|
26
tools/torque/vscode-torque/package.json
Normal file
26
tools/torque/vscode-torque/package.json
Normal file
@ -0,0 +1,26 @@
|
||||
{
|
||||
"name": "vscode-torque",
|
||||
"displayName": "Torque syntax support",
|
||||
"description": "Basic Torque syntax highlighting support",
|
||||
"version": "0.0.1",
|
||||
"publisher": "szuend",
|
||||
"engines": {
|
||||
"vscode": "^1.22.0"
|
||||
},
|
||||
"categories": [
|
||||
"Languages"
|
||||
],
|
||||
"contributes": {
|
||||
"languages": [{
|
||||
"id": "torque",
|
||||
"aliases": ["Torque", "torque"],
|
||||
"extensions": [".tq"],
|
||||
"configuration": "./language-configuration.json"
|
||||
}],
|
||||
"grammars": [{
|
||||
"language": "torque",
|
||||
"scopeName": "source.torque",
|
||||
"path": "./syntaxes/torque.tmLanguage.json"
|
||||
}]
|
||||
}
|
||||
}
|
88
tools/torque/vscode-torque/syntaxes/torque.tmLanguage.json
Normal file
88
tools/torque/vscode-torque/syntaxes/torque.tmLanguage.json
Normal file
@ -0,0 +1,88 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
|
||||
"name": "Torque",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#keywords"
|
||||
},
|
||||
{
|
||||
"include": "#strings"
|
||||
},
|
||||
{
|
||||
"name": "comment.line.double-slash.torque",
|
||||
"begin": "//",
|
||||
"end": "$"
|
||||
},
|
||||
{
|
||||
"name": "comment.block.torque",
|
||||
"begin": "/\\*",
|
||||
"end": "\\*/"
|
||||
},
|
||||
{
|
||||
"name": "string.quoted.single.torque",
|
||||
"begin": "'",
|
||||
"end": "'",
|
||||
"patterns": [
|
||||
{
|
||||
"name": "constant.character.escape.torque",
|
||||
"match": "\\\\."
|
||||
}]
|
||||
},
|
||||
{
|
||||
"name": "support.function.torque",
|
||||
"match": "\\b(min|max|assert|check|debug|unreachable)\\b"
|
||||
},
|
||||
{
|
||||
"name": "support.variable.torque",
|
||||
"match": "\\b(true|True|false|False|Undefined|Hole|Null)\\b"
|
||||
},
|
||||
{
|
||||
"begin": "<(?=[A-Za-z][0-9A-Za-z_]*>)",
|
||||
"end": ">",
|
||||
"patterns": [
|
||||
{
|
||||
"name": "support.type.torque",
|
||||
"match": "([A-Za-z][0-9A-Za-z_]*)"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": ":(\\s*)?",
|
||||
"end": "(?=[^0-9A-Za-z_])",
|
||||
"patterns": [
|
||||
{
|
||||
"name": "support.type.torque",
|
||||
"match": "([A-Za-z][0-9A-Za-z_]*)"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"repository": {
|
||||
"keywords": {
|
||||
"patterns": [{
|
||||
"name": "keyword.control.torque",
|
||||
"match": "\\b(if|else|while|for|return|continue|break|goto|otherwise|try|catch)\\b"
|
||||
},
|
||||
{
|
||||
"name": "keyword.other.torque",
|
||||
"match": "\\b(constexpr|module|macro|builtin|runtime|javascript|implicit|deferred|cast|convert|label|labels|tail|isnt|is|let|generates|type|extends|extern|const)\\b"
|
||||
},
|
||||
{
|
||||
"name": "keyword.operator.torque",
|
||||
"match": "\\b(=|\\*=)\\b"
|
||||
}]
|
||||
},
|
||||
"strings": {
|
||||
"name": "string.quoted.double.torque",
|
||||
"begin": "\"",
|
||||
"end": "\"",
|
||||
"patterns": [
|
||||
{
|
||||
"name": "constant.character.escape.torque",
|
||||
"match": "\\\\."
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"scopeName": "source.torque"
|
||||
}
|
Loading…
Reference in New Issue
Block a user