diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..67dfeb3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +node_modules +*.vsix \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..7bc18a4 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,18 @@ +// A launch configuration that launches the extension inside a new window +// Use IntelliSense to learn about possible attributes. +// Hover to view descriptions of existing attributes. +// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Extension", + "type": "extensionHost", + "request": "launch", + "runtimeExecutable": "${execPath}", + "args": [ + "--extensionDevelopmentPath=${workspaceFolder}" + ] + } + ] +} \ No newline at end of file diff --git a/.vscodeignore b/.vscodeignore new file mode 100644 index 0000000..f369b5e --- /dev/null +++ b/.vscodeignore @@ -0,0 +1,4 @@ +.vscode/** +.vscode-test/** +.gitignore +vsc-extension-quickstart.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..5999cc2 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,4 @@ +# Change Log + +## [0.0.1] - 2018-04-27 +- Initial release, featuring ismple syntax highlighting. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..6e62bbc --- /dev/null +++ b/README.md @@ -0,0 +1,16 @@ +# LLVM TableGen + +Simple syntax highlighting support for the LLVM TableGen language. + +TextMate grammar used was taken from the official [LLVM repository](https://github.com/llvm-mirror/llvm/blob/master/utils/textmate/TableGen.tmbundle/Syntaxes/TableGen.tmLanguage). + +## Features + +- Syntax highlighting + +![Syntax highlighting](images/syntax.png) + + +## Known Issues + +- Please report any issues or suggestions you find on [GitHub](https://github.com/jakoberzar/vscode-llvm-tablegen/issues). \ No newline at end of file diff --git a/images/syntax.png b/images/syntax.png new file mode 100644 index 0000000..35f9d2a Binary files /dev/null and b/images/syntax.png differ diff --git a/language-configuration.json b/language-configuration.json new file mode 100644 index 0000000..aa25710 --- /dev/null +++ b/language-configuration.json @@ -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": [ + ["{", "}"], + ["[", "]"], + ["(", ")"], + ["\"", "\""], + ["'", "'"] + ] +} \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..deb0617 --- /dev/null +++ b/package.json @@ -0,0 +1,43 @@ +{ + "name": "llvm-tablegen", + "displayName": "LLVM TableGen", + "description": "Syntax highlighting for TableGen.", + "version": "0.0.1", + "publisher": "jakob-erzar", + "engines": { + "vscode": "^1.22.0" + }, + "categories": [ + "Languages" + ], + "keywords": [ + "llvm-tablegen", + "llvm-tblgen", + "tblgen", + "llvm", + "tablegen", + "table gen", + "syntax" + ], + "contributes": { + "languages": [{ + "id": "tablegen", + "aliases": ["TableGen", "tblgen", "tablegen"], + "extensions": [".td"], + "configuration": "./language-configuration.json" + }], + "grammars": [{ + "language": "tablegen", + "scopeName": "source.tablegen", + "path": "./syntaxes/tablegen.tmLanguage" + }] + }, + "bugs": { + "url": "https://github.com/jakoberzar/vscode-llvm-tablegen/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/jakoberzar/vscode-llvm-tablegen.git" + }, + "homepage": "https://github.com/jakoberzar/vscode-llvm-tablegen/blob/master/README.md" +} \ No newline at end of file diff --git a/syntaxes/tablegen.tmLanguage b/syntaxes/tablegen.tmLanguage new file mode 100644 index 0000000..f3cf2d6 --- /dev/null +++ b/syntaxes/tablegen.tmLanguage @@ -0,0 +1,132 @@ + + + + + fileTypes + td + foldingStartMarker + /\*\*|\{\s*$ + foldingStopMarker + \*\*/|^\s*\} + name + TableGen + patterns + + + include + #comments + + + match + \b(def|let|in|code|dag|string|list|bits|bit|field|include|defm|foreach|class|multiclass|int)\b + name + keyword.control.tablegen + + + begin + " + end + " + name + string.quoted.double.untitled + patterns + + + match + \\. + name + constant.character.escape.tablegen + + + + + repository + + comments + + patterns + + + captures + + 1 + + name + meta.toc-list.banner.block.tablegen + + + match + ^/\* =(\s*.*?)\s*= \*/$\n? + name + comment.block.tablegen + + + begin + /\* + captures + + 0 + + name + punctuation.definition.comment.tablegen + + + end + \*/ + name + comment.block.tablegen + + + match + \*/.*\n + name + invalid.illegal.stray-comment-end.tablegen + + + captures + + 1 + + name + meta.toc-list.banner.line.tablegen + + + match + ^// =(\s*.*?)\s*=\s*$\n? + name + comment.line.banner.tablegen + + + begin + // + beginCaptures + + 0 + + name + punctuation.definition.comment.tablegen + + + end + $\n? + name + comment.line.double-slash.tablegen + patterns + + + match + (?>\\\s*\n) + name + punctuation.separator.continuation.tablegen + + + + + + + scopeName + source.tablegen + uuid + 3A090BFC-E74B-4993-8DAE-7CCF6D238A32 + +