mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 04:02:41 +01:00
Adding VSCode syntax colorizer to utils (generated from textmate colorizer).
--This line, and those below, will be igored-- A utils/vscode A utils/vscode/README A utils/vscode/tablegen A utils/vscode/tablegen/.vscode A utils/vscode/tablegen/.vscode/launch.json A utils/vscode/tablegen/CHANGELOG.md A utils/vscode/tablegen/README.md A utils/vscode/tablegen/language-configuration.json A utils/vscode/tablegen/package.json A utils/vscode/tablegen/syntaxes A utils/vscode/tablegen/syntaxes/TableGen.tmLanguage A utils/vscode/tablegen/vsc-extension-quickstart.md llvm-svn: 302553
This commit is contained in:
parent
334449f848
commit
e8dbea338b
18
utils/vscode/README
Normal file
18
utils/vscode/README
Normal file
@ -0,0 +1,18 @@
|
||||
This directory contains a "bundle" for doing syntax highlighting of TableGen
|
||||
files for the Microsoft VSCode editor. The highlighting follows that done by
|
||||
the TextMate "C" bundle as it is a translation of the textmate bundle to VSCode
|
||||
using the "yo code" npm package. Currently, keywords, comments, and strings are
|
||||
highlighted.
|
||||
|
||||
This colorizer was generate by the vscode-generator tool "Yo Code"
|
||||
(https://github.com/Microsoft/vscode-generator-code) from the existing TableGen
|
||||
text TableGen.tmLanguage syntax colorizer in utils/textmate. This README was
|
||||
copied from utils/textmate/README.
|
||||
|
||||
To install this VSCode .td file colorizer, copy it to the following locations
|
||||
per your Operating System:
|
||||
|
||||
- Windows: %USERPROFILE%\.vscode\extensions
|
||||
- Mac: ~/.vscode/extensions
|
||||
- Linux: ~/.vscode/extensions
|
||||
|
13
utils/vscode/tablegen/.vscode/launch.json
vendored
Normal file
13
utils/vscode/tablegen/.vscode/launch.json
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
// A launch configuration that launches the extension inside a new window
|
||||
{
|
||||
"version": "0.1.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Launch Extension",
|
||||
"type": "extensionHost",
|
||||
"request": "launch",
|
||||
"runtimeExecutable": "${execPath}",
|
||||
"args": ["--extensionDevelopmentPath=${workspaceRoot}" ]
|
||||
}
|
||||
]
|
||||
}
|
4
utils/vscode/tablegen/CHANGELOG.md
Normal file
4
utils/vscode/tablegen/CHANGELOG.md
Normal file
@ -0,0 +1,4 @@
|
||||
# Change Log
|
||||
|
||||
- Initial release
|
||||
|
13
utils/vscode/tablegen/README.md
Normal file
13
utils/vscode/tablegen/README.md
Normal file
@ -0,0 +1,13 @@
|
||||
# tablegen README
|
||||
|
||||
This VSCode colorizer extension is a translation of the textmate bunble to
|
||||
VSCode using the "yo code" npm package. Currently, keywords, comments, and
|
||||
strings are highlighted.
|
||||
|
||||
To install this VSCode .td file colorizer, copy it to the following locations
|
||||
per your Operating System:
|
||||
|
||||
- Windows: %USERPROFILE%\.vscode\extensions
|
||||
- Mac: ~/.vscode/extensions
|
||||
- Linux: ~/.vscode/extensions
|
||||
|
30
utils/vscode/tablegen/language-configuration.json
Normal file
30
utils/vscode/tablegen/language-configuration.json
Normal file
@ -0,0 +1,30 @@
|
||||
{
|
||||
"comments": {
|
||||
// symbol used for single line comment. Remove this entry if your language does not support line comments
|
||||
"lineComment": "//",
|
||||
// symbols used for start and end a block comment. Remove this entry if your language does not support block comments
|
||||
"blockComment": [ "/*", "*/" ]
|
||||
},
|
||||
// symbols used as brackets
|
||||
"brackets": [
|
||||
["{", "}"],
|
||||
["[", "]"],
|
||||
["(", ")"]
|
||||
],
|
||||
// symbols that are auto closed when typing
|
||||
"autoClosingPairs": [
|
||||
["{", "}"],
|
||||
["[", "]"],
|
||||
["(", ")"],
|
||||
["\"", "\""],
|
||||
["'", "'"]
|
||||
],
|
||||
// symbols that that can be used to surround a selection
|
||||
"surroundingPairs": [
|
||||
["{", "}"],
|
||||
["[", "]"],
|
||||
["(", ")"],
|
||||
["\"", "\""],
|
||||
["'", "'"]
|
||||
]
|
||||
}
|
26
utils/vscode/tablegen/package.json
Normal file
26
utils/vscode/tablegen/package.json
Normal file
@ -0,0 +1,26 @@
|
||||
{
|
||||
"name": "tablegen",
|
||||
"displayName": "TableGen",
|
||||
"description": "VSCode Language Colorizer for LLVM's TableGen language.",
|
||||
"version": "0.0.1",
|
||||
"publisher": "llvm",
|
||||
"engines": {
|
||||
"vscode": "^1.12.0"
|
||||
},
|
||||
"categories": [
|
||||
"Languages"
|
||||
],
|
||||
"contributes": {
|
||||
"languages": [{
|
||||
"id": "tablegen",
|
||||
"aliases": ["TableGen", "tablegen"],
|
||||
"extensions": [".td"],
|
||||
"configuration": "./language-configuration.json"
|
||||
}],
|
||||
"grammars": [{
|
||||
"language": "tablegen",
|
||||
"scopeName": "source.tablegen",
|
||||
"path": "./syntaxes/TableGen.tmLanguage"
|
||||
}]
|
||||
}
|
||||
}
|
132
utils/vscode/tablegen/syntaxes/TableGen.tmLanguage
Normal file
132
utils/vscode/tablegen/syntaxes/TableGen.tmLanguage
Normal file
@ -0,0 +1,132 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>fileTypes</key>
|
||||
<array><string>td</string></array>
|
||||
<key>foldingStartMarker</key>
|
||||
<string>/\*\*|\{\s*$</string>
|
||||
<key>foldingStopMarker</key>
|
||||
<string>\*\*/|^\s*\}</string>
|
||||
<key>name</key>
|
||||
<string>TableGen</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#comments</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>\b(def|let|in|code|dag|string|list|bits|bit|field|include|defm|foreach|class|multiclass|int)\b</string>
|
||||
<key>name</key>
|
||||
<string>keyword.control.tablegen</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>"</string>
|
||||
<key>end</key>
|
||||
<string>"</string>
|
||||
<key>name</key>
|
||||
<string>string.quoted.double.untitled</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>\\.</string>
|
||||
<key>name</key>
|
||||
<string>constant.character.escape.tablegen</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
<key>repository</key>
|
||||
<dict>
|
||||
<key>comments</key>
|
||||
<dict>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>captures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>meta.toc-list.banner.block.tablegen</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>match</key>
|
||||
<string>^/\* =(\s*.*?)\s*= \*/$\n?</string>
|
||||
<key>name</key>
|
||||
<string>comment.block.tablegen</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>/\*</string>
|
||||
<key>captures</key>
|
||||
<dict>
|
||||
<key>0</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.definition.comment.tablegen</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>end</key>
|
||||
<string>\*/</string>
|
||||
<key>name</key>
|
||||
<string>comment.block.tablegen</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>\*/.*\n</string>
|
||||
<key>name</key>
|
||||
<string>invalid.illegal.stray-comment-end.tablegen</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>captures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>meta.toc-list.banner.line.tablegen</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>match</key>
|
||||
<string>^// =(\s*.*?)\s*=\s*$\n?</string>
|
||||
<key>name</key>
|
||||
<string>comment.line.banner.tablegen</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>//</string>
|
||||
<key>beginCaptures</key>
|
||||
<dict>
|
||||
<key>0</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.definition.comment.tablegen</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>end</key>
|
||||
<string>$\n?</string>
|
||||
<key>name</key>
|
||||
<string>comment.line.double-slash.tablegen</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>(?>\\\s*\n)</string>
|
||||
<key>name</key>
|
||||
<string>punctuation.separator.continuation.tablegen</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>scopeName</key>
|
||||
<string>source.tablegen</string>
|
||||
<key>uuid</key>
|
||||
<string>3A090BFC-E74B-4993-8DAE-7CCF6D238A32</string>
|
||||
</dict>
|
||||
</plist>
|
27
utils/vscode/tablegen/vsc-extension-quickstart.md
Normal file
27
utils/vscode/tablegen/vsc-extension-quickstart.md
Normal file
@ -0,0 +1,27 @@
|
||||
# Welcome to your VS Code Extension
|
||||
|
||||
## What's in the folder
|
||||
* This folder contains all of the files necessary for your extension
|
||||
* `package.json` - this is the manifest file in which you declare your language support and define
|
||||
the location of the grammar file that has been copied into you extension.
|
||||
* `syntaxes/TableGen.tmLanguage` - this is the Text mate grammar file that is used for tokenization
|
||||
* `language-configuration.json` - this the language configuration, defining the tokens that are used for
|
||||
comments and brackets.
|
||||
|
||||
## Get up and running straight away
|
||||
* Make sure the language configuration settings in `language-configuration.json` are accurate
|
||||
* press `F5` to open a new window with your extension loaded
|
||||
* create a new file with a file name suffix matching your language
|
||||
* verify that syntax highlight works and that the language configuration settings are working
|
||||
|
||||
## Make changes
|
||||
* you can relaunch the extension from the debug toolbar after making changes to the files listed above
|
||||
* you can also reload (`Ctrl+R` or `Cmd+R` on Mac) the VS Code window with your extension to load your changes
|
||||
|
||||
## Add more language features
|
||||
* To add features such as intellisense, hovers and validators check out the VS Code extenders documentation at
|
||||
https://code.visualstudio.com/docs
|
||||
|
||||
## Install your extension
|
||||
* To start using your extension with Visual Studio Code copy it into the `<user home>/.vscode/extensions` folder and restart Code.
|
||||
* To share your extension with the world, read on https://code.visualstudio.com/docs about publishing an extension.
|
Loading…
Reference in New Issue
Block a user