commit db8cae6fad99df194355bcbbfe74e78e53cd4df6 Author: Stefano Pigozzi Date: Mon May 13 19:16:03 2019 +0200 First commit 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..b761ee9 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,9 @@ +# Change Log + +All notable changes to the "riscv-plus" extension will be documented in this file. + +Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file. + +## [0.0.1] - 2019-05-13 + +- Initial release diff --git a/README.md b/README.md new file mode 100644 index 0000000..99e07f1 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# RISC-V Assembly + +Really basic RISC-V support. \ No newline at end of file diff --git a/language-configuration.json b/language-configuration.json new file mode 100644 index 0000000..496dfe4 --- /dev/null +++ b/language-configuration.json @@ -0,0 +1,20 @@ +{ + "comments": { + // symbol used for single line comment. Remove this entry if your language does not support line comments + "lineComment": "#", + }, + // 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..44a3e9c --- /dev/null +++ b/package.json @@ -0,0 +1,26 @@ +{ + "name": "riscv-plus", + "displayName": "RISC-V Assembly", + "description": "Alpha for RISC-V Syntax Highlighting.", + "publisher": "steffo", + "version": "0.0.1", + "engines": { + "vscode": "^1.33.0" + }, + "categories": [ + "Programming Languages" + ], + "contributes": { + "languages": [{ + "id": "riscv", + "aliases": ["RISC-V Assembly", "riscv"], + "extensions": [".riscv"], + "configuration": "./language-configuration.json" + }], + "grammars": [{ + "language": "riscv", + "scopeName": "source.riscv", + "path": "./syntaxes/riscv.tmLanguage.json" + }] + } +} \ No newline at end of file diff --git a/syntaxes/riscv.tmLanguage.json b/syntaxes/riscv.tmLanguage.json new file mode 100644 index 0000000..0e45ddc --- /dev/null +++ b/syntaxes/riscv.tmLanguage.json @@ -0,0 +1,105 @@ +{ + "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", + "name": "RISC-V Assembly", + "patterns": [ + { + "include": "#structure" + }, + { + "include": "#entities" + } + ], + "repository": { + "structure": { + "patterns": [ + { + "match": "\\b([A-Za-z0-9_]+)(:)", + "name": "meta.line.label.riscv", + "captures": { + "1": { + "name": "keyword.name.tag.riscv" + }, + "2": { + "name": "punctuation.colon.riscv" + } + } + }, + { + "match": "\\b([A-Za-z]+)\\s+([A-Za-z0-9_-]+)(,)\\s+([A-Za-z0-9_-]+)(\\()([A-Za-z0-9_-]+)(\\))", + "name": "meta.line.instruction.parenthesis.riscv", + "captures": { + "1": { + "name": "entity.name.function.riscv" + }, + "2": { + "name": "variable.parameter.riscv" + }, + "3": { + "name": "punctuation.comma.riscv" + }, + "4": { + "name": "variable.parameter.riscv" + }, + "5": { + "name": "punctuation.parenthesis.open.riscv" + }, + "6": { + "name": "variable.parameter.riscv" + }, + "7": { + "name": "punctuation.parenthesis.close.riscv" + } + } + }, + { + "match": "\\b([A-Za-z]+)(?:\\s+([A-Za-z0-9_-]+))?(?:(,)\\s+([A-Za-z0-9_-]+))?(?:(,)\\s+([A-Za-z0-9_-]+))?\\b", + "name": "meta.line.instruction.riscv", + "captures": { + "1": { + "name": "entity.name.function.riscv" + }, + "2": { + "name": "variable.parameter.riscv" + }, + "3": { + "name": "punctuation.comma.riscv" + }, + "4": { + "name": "variable.parameter.riscv" + }, + "5": { + "name": "punctuation.comma.riscv" + }, + "6": { + "name": "variable.parameter.riscv" + } + } + } + ] + }, + "entities": { + "patterns": [ + { + "begin": "\"", + "end": "\"", + "name": "string.quoted.double.riscv", + "patterns": [ + { + "match": "\\\\.", + "name": "constant.character.escape.riscv" + } + ] + }, + { + "match": "#.+", + "name": "comment.line.number-sign.riscv" + }, + { + "match": "\\.[A-Za-z0-9_-]+", + "name": "constant.language.riscv" + } + ] + } + }, + "scopeName": "source.riscv" +} \ No newline at end of file diff --git a/vsc-extension-quickstart.md b/vsc-extension-quickstart.md new file mode 100644 index 0000000..4d60cf0 --- /dev/null +++ b/vsc-extension-quickstart.md @@ -0,0 +1,29 @@ +# 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 your extension. +* `syntaxes/riscv.tmLanguage.json` - this is the Text mate grammar file that is used for tokenization. +* `language-configuration.json` - this is 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 highlighting 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 `/.vscode/extensions` folder and restart Code. +* To share your extension with the world, read on https://code.visualstudio.com/docs about publishing an extension.