mirror of
https://github.com/Steffo99/riscv-plus.git
synced 2024-12-03 13:34:19 +00:00
First commit
This commit is contained in:
commit
db8cae6fad
8 changed files with 214 additions and 0 deletions
18
.vscode/launch.json
vendored
Normal file
18
.vscode/launch.json
vendored
Normal file
|
@ -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}"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
4
.vscodeignore
Normal file
4
.vscodeignore
Normal file
|
@ -0,0 +1,4 @@
|
|||
.vscode/**
|
||||
.vscode-test/**
|
||||
.gitignore
|
||||
vsc-extension-quickstart.md
|
9
CHANGELOG.md
Normal file
9
CHANGELOG.md
Normal file
|
@ -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
|
3
README.md
Normal file
3
README.md
Normal file
|
@ -0,0 +1,3 @@
|
|||
# RISC-V Assembly
|
||||
|
||||
Really basic RISC-V support.
|
20
language-configuration.json
Normal file
20
language-configuration.json
Normal file
|
@ -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": [
|
||||
["(", ")"],
|
||||
["\"", "\""]
|
||||
]
|
||||
}
|
26
package.json
Normal file
26
package.json
Normal file
|
@ -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"
|
||||
}]
|
||||
}
|
||||
}
|
105
syntaxes/riscv.tmLanguage.json
Normal file
105
syntaxes/riscv.tmLanguage.json
Normal file
|
@ -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"
|
||||
}
|
29
vsc-extension-quickstart.md
Normal file
29
vsc-extension-quickstart.md
Normal file
|
@ -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 `<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 a new issue