diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..0e191b5 --- /dev/null +++ b/.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/.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/README.md b/README.md new file mode 100644 index 0000000..127b076 --- /dev/null +++ b/README.md @@ -0,0 +1,41 @@ +# vscode-codegame +![CGE Version](https://img.shields.io/badge/CGE-v0.2-green) + +A VS Code extension for writing [CodeGame](https://github.com/code-game-project) applications. + +## Features + +- Syntax highlighting `.cge` files + +## Installation + +- [Download](https://github.com/code-game-project/vscode-codegame/releases) the `*.vsix` file. +- Open the _Extensions_ tab in VS Code. +- Press the three dots in the top right corner of the _Extensions_ window. +- Choose _Install from VSIX…_. +- Select the downloaded file. +- Hit _Open_. + +## License + +MIT License + +Copyright (c) 2022 CodeGame Contributors (https://github.com/orgs/code-game-project/people) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/language-configuration.json b/language-configuration.json new file mode 100644 index 0000000..85da905 --- /dev/null +++ b/language-configuration.json @@ -0,0 +1,41 @@ +{ + "comments": { + "lineComment": "//", + "blockComment": [ + "/*", + "*/" + ] + }, + "brackets": [ + [ + "{", + "}" + ] + ], + // symbols that are auto closed when typing + "autoClosingPairs": [ + [ + "{", + "}" + ], + [ + "[", + "]" + ], + [ + "<", + ">" + ] + ], + // symbols that can be used to surround a selection + "surroundingPairs": [ + [ + "{", + "}" + ], + [ + "<", + ">" + ] + ] +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..7e60c7b --- /dev/null +++ b/package.json @@ -0,0 +1,38 @@ +{ + "name": "codegame", + "displayName": "CodeGame", + "description": "An extension for writing CodeGame applications.", + "version": "0.2.0", + "repository": { + "type": "git", + "url": "https://github.com/code-game-project/vscode-codegame" + }, + "engines": { + "vscode": "^1.67.0" + }, + "categories": [ + "Programming Languages" + ], + "contributes": { + "languages": [ + { + "id": "cge", + "aliases": [ + "CGE", + "cge" + ], + "extensions": [ + ".cge" + ], + "configuration": "./language-configuration.json" + } + ], + "grammars": [ + { + "language": "cge", + "scopeName": "source.cge", + "path": "./syntaxes/cge.tmLanguage.json" + } + ] + } +} diff --git a/syntaxes/cge.tmLanguage.json b/syntaxes/cge.tmLanguage.json new file mode 100644 index 0000000..81424f5 --- /dev/null +++ b/syntaxes/cge.tmLanguage.json @@ -0,0 +1,63 @@ +{ + "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", + "name": "CGE", + "patterns": [ + { + "include": "#keywords" + }, + { + "include": "#types" + }, + { + "include": "#comments" + } + ], + "repository": { + "keywords": { + "patterns": [ + { + "name": "keyword.cge", + "match": "\\b(name|version|event|type|enum)\\b" + } + ] + }, + "types": { + "patterns": [ + { + "name": "storage.type.cge", + "match": "\\b(string|bool|int|int32|int64|bigint|float|float32|float64|map|list)\\b" + } + ] + }, + "comments": { + "patterns": [ + { + "name": "comment.block.cge", + "begin": "(\\/\\*)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.comment.cge" + } + }, + "end": "(\\*\\/)", + "endCaptures": { + "1": { + "name": "punctuation.definition.comment.cge" + } + } + }, + { + "name": "comment.line.double-slash.cge", + "begin": "(\\/\\/)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.comment.cge" + } + }, + "end": "(?:\\n|$)" + } + ] + } + }, + "scopeName": "source.cge" +}