From 660fb64fc0ae91f002ce2c8f6aee4e2cc3d9eae5 Mon Sep 17 00:00:00 2001 From: Pavel Murygin Date: Thu, 20 May 2021 19:05:53 +0300 Subject: [PATCH] initial syntax highlight for vscode --- README.md | 3 + vscode-highlight/.gitattributes | 3 + vscode-highlight/.gitignore | 2 + vscode-highlight/.vscode/launch.json | 17 +++++ vscode-highlight/.vscodeignore | 4 ++ vscode-highlight/CHANGELOG.md | 9 +++ vscode-highlight/README.md | 65 +++++++++++++++++++ vscode-highlight/language-configuration.json | 19 ++++++ vscode-highlight/package.json | 33 ++++++++++ .../syntaxes/aqua.tmLanguage.json | 65 +++++++++++++++++++ vscode-highlight/vsc-extension-quickstart.md | 29 +++++++++ 11 files changed, 249 insertions(+) create mode 100644 README.md create mode 100644 vscode-highlight/.gitattributes create mode 100644 vscode-highlight/.gitignore create mode 100644 vscode-highlight/.vscode/launch.json create mode 100644 vscode-highlight/.vscodeignore create mode 100644 vscode-highlight/CHANGELOG.md create mode 100644 vscode-highlight/README.md create mode 100644 vscode-highlight/language-configuration.json create mode 100644 vscode-highlight/package.json create mode 100644 vscode-highlight/syntaxes/aqua.tmLanguage.json create mode 100644 vscode-highlight/vsc-extension-quickstart.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..f69ec96 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# Collection of tools for aqua language + +TBD diff --git a/vscode-highlight/.gitattributes b/vscode-highlight/.gitattributes new file mode 100644 index 0000000..13bc9c2 --- /dev/null +++ b/vscode-highlight/.gitattributes @@ -0,0 +1,3 @@ +# Set default behavior to automatically normalize line endings. +* text=auto + diff --git a/vscode-highlight/.gitignore b/vscode-highlight/.gitignore new file mode 100644 index 0000000..67dfeb3 --- /dev/null +++ b/vscode-highlight/.gitignore @@ -0,0 +1,2 @@ +node_modules +*.vsix \ No newline at end of file diff --git a/vscode-highlight/.vscode/launch.json b/vscode-highlight/.vscode/launch.json new file mode 100644 index 0000000..0e191b5 --- /dev/null +++ b/vscode-highlight/.vscode/launch.json @@ -0,0 +1,17 @@ +// 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", + "args": [ + "--extensionDevelopmentPath=${workspaceFolder}" + ] + } + ] +} \ No newline at end of file diff --git a/vscode-highlight/.vscodeignore b/vscode-highlight/.vscodeignore new file mode 100644 index 0000000..f369b5e --- /dev/null +++ b/vscode-highlight/.vscodeignore @@ -0,0 +1,4 @@ +.vscode/** +.vscode-test/** +.gitignore +vsc-extension-quickstart.md diff --git a/vscode-highlight/CHANGELOG.md b/vscode-highlight/CHANGELOG.md new file mode 100644 index 0000000..99723f1 --- /dev/null +++ b/vscode-highlight/CHANGELOG.md @@ -0,0 +1,9 @@ +# Change Log + +All notable changes to the "aqua" extension will be documented in this file. + +Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file. + +## [Unreleased] + +- Initial release \ No newline at end of file diff --git a/vscode-highlight/README.md b/vscode-highlight/README.md new file mode 100644 index 0000000..bb26050 --- /dev/null +++ b/vscode-highlight/README.md @@ -0,0 +1,65 @@ +# aqua README + +This is the README for your extension "aqua". After writing up a brief description, we recommend including the following sections. + +## Features + +Describe specific features of your extension including screenshots of your extension in action. Image paths are relative to this README file. + +For example if there is an image subfolder under your extension project workspace: + +\!\[feature X\]\(images/feature-x.png\) + +> Tip: Many popular extensions utilize animations. This is an excellent way to show off your extension! We recommend short, focused animations that are easy to follow. + +## Requirements + +If you have any requirements or dependencies, add a section describing those and how to install and configure them. + +## Extension Settings + +Include if your extension adds any VS Code settings through the `contributes.configuration` extension point. + +For example: + +This extension contributes the following settings: + +* `myExtension.enable`: enable/disable this extension +* `myExtension.thing`: set to `blah` to do something + +## Known Issues + +Calling out known issues can help limit users opening duplicate issues against your extension. + +## Release Notes + +Users appreciate release notes as you update your extension. + +### 1.0.0 + +Initial release of ... + +### 1.0.1 + +Fixed issue #. + +### 1.1.0 + +Added features X, Y, and Z. + +----------------------------------------------------------------------------------------------------------- + +## Working with Markdown + +**Note:** You can author your README using Visual Studio Code. Here are some useful editor keyboard shortcuts: + +* Split the editor (`Cmd+\` on macOS or `Ctrl+\` on Windows and Linux) +* Toggle preview (`Shift+CMD+V` on macOS or `Shift+Ctrl+V` on Windows and Linux) +* Press `Ctrl+Space` (Windows, Linux) or `Cmd+Space` (macOS) to see a list of Markdown snippets + +### For more information + +* [Visual Studio Code's Markdown Support](http://code.visualstudio.com/docs/languages/markdown) +* [Markdown Syntax Reference](https://help.github.com/articles/markdown-basics/) + +**Enjoy!** diff --git a/vscode-highlight/language-configuration.json b/vscode-highlight/language-configuration.json new file mode 100644 index 0000000..6de70ed --- /dev/null +++ b/vscode-highlight/language-configuration.json @@ -0,0 +1,19 @@ +{ + "comments": { + "lineComment": "--", + }, + "brackets": [ + ["[", "]"], + ["(", ")"] + ], + "autoClosingPairs": [ + ["[", "]"], + ["(", ")"], + ["\"", "\""], + ], + "surroundingPairs": [ + ["[", "]"], + ["(", ")"], + ["\"", "\""], + ] +} \ No newline at end of file diff --git a/vscode-highlight/package.json b/vscode-highlight/package.json new file mode 100644 index 0000000..f4a9beb --- /dev/null +++ b/vscode-highlight/package.json @@ -0,0 +1,33 @@ +{ + "name": "aqua", + "displayName": "aqua", + "description": "aqua language support", + "version": "0.0.1", + "engines": { + "vscode": "^1.56.0" + }, + "categories": [ + "Programming Languages" + ], + "contributes": { + "languages": [ + { + "id": "aqua", + "aliases": [ + "aqua" + ], + "extensions": [ + ".aqua" + ], + "configuration": "./language-configuration.json" + } + ], + "grammars": [ + { + "language": "aqua", + "scopeName": "source.aqua", + "path": "./syntaxes/aqua.tmLanguage.json" + } + ] + } +} diff --git a/vscode-highlight/syntaxes/aqua.tmLanguage.json b/vscode-highlight/syntaxes/aqua.tmLanguage.json new file mode 100644 index 0000000..d043c28 --- /dev/null +++ b/vscode-highlight/syntaxes/aqua.tmLanguage.json @@ -0,0 +1,65 @@ +{ + "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", + "name": "aqua", + "patterns": [ + { + "include": "#keywords" + }, + { + "include": "#strings" + }, + { + "include": "#comments" + }, + { + "include": "#semantics" + } + ], + "repository": { + "keywords": { + "patterns": [ + { + "name": "keyword.control.aqua", + "match": "\\b(if|else|otherwise|use|try|catch|on|via|for|par|use|<-)\\b" + }, + { + "name": "keyword.operator.logical.aqua", + "match": "\\b(eqs|neq)\\b" + }, + { + "name": "keyword.declaration.aqua", + "match": "\\b(func|service|data|alias)\\b" + }, + { + "name": "keyword.control.import", + "match": "\\b(import)\\b" + } + ] + }, + "strings": { + "name": "string.quoted.double.aqua", + "begin": "\"", + "end": "\"", + "patterns": [ + { + "name": "constant.character.escape.aqua", + "match": "\\\\." + } + ] + }, + "comments": { + "name": "comment.line.aqua", + "begin": "--", + "end": "$" + }, + "semantics": { + "patterns": [ + { + "name": "storage.type.aqua", + "match": "\\b(string|bool|u8|u16|u32|u64|s8|s16|s32|s64|f32|f64)\\b" + } + ] + } + }, + "scopeName": "source.aqua" +} diff --git a/vscode-highlight/vsc-extension-quickstart.md b/vscode-highlight/vsc-extension-quickstart.md new file mode 100644 index 0000000..1c12c52 --- /dev/null +++ b/vscode-highlight/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/aqua.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.