Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
sedyh committed Jul 20, 2022
0 parents commit 100bb6f
Show file tree
Hide file tree
Showing 11 changed files with 477 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.vim linguist-detectable=false
*.snippets linguist-detectable=false
13 changes: 13 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Extension",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
]
}
]
}
4 changes: 4 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
This repository is licensed under:

CC0 1.0 Universal
https://creativecommons.org/publicdomain/zero/1.0
72 changes: 72 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
## <img align="left" width="100px" src="https://user-images.githubusercontent.com/19890545/179967638-6b0e4e7d-7f8c-412a-b87d-47ba8e694477.png" alt="ebitengine-kage-support" /> Ebitengine Kage support for Visual Studio Code

Basic syntax and snippet support for the Ebitengine Kage shading language.

<br>

Ebitengine adopts an original shading language 'Kage'. This has a compatible syntax with Go, but the details are different. Kage has high portability. Ebitengine uses graphics libraries like OpenGL or Metal and this depends on environments, but Kage is compiled on the fly so that this works equally everywhere.

### Installation

[![](https://img.shields.io/badge/get%20it%20from-555555?style=for-the-badge&logo=visualstudiocode&logoColor=72a9d4)![](https://img.shields.io/badge/marketplace-72a9d4?style=for-the-badge)](https://marketplace.visualstudio.com/items?itemName=sedyh.ebitengine-kage)

<details><summary>Manual installation</summary><br>

Install `vsce` from `npm`.

```
npm install --global vsce
```

Package extension in `.vsix` archive.

```
vsce package
```

Run this command to install package from `.vsix`, replace `ebitengine-kage.vsix` with your path.

```
code --install-extension ebitengine-kage.vsix
```

</details>

### Other editors
[![](https://img.shields.io/badge/source-555555?style=for-the-badge&logo=sublimetext&logoColor=ba9759)](https://github.com/sedyh/ebitengine-kage-sublime)[![](https://img.shields.io/badge/download-ba9759?style=for-the-badge)](https://packagecontrol.io)<br>
[![](https://img.shields.io/badge/source-555555?style=for-the-badge&logo=vim&logoColor=60b371)](https://github.com/sedyh/ebitengine-kage-vim)[![](https://img.shields.io/badge/download-60b371?style=for-the-badge)](https://www.vim.org/scripts/script.php?script_id=6021)

### Features

- [Basic syntax highlighting](#basic-syntax-highlighting)
- [Quick start](#quick-start)
- [Short documentation](#short-documentation)
- [List of all built-in functions](#list-of-all-built-in-functions)

### Basic syntax highlighting

<a href="#features"><img src="https://user-images.githubusercontent.com/19890545/150034365-6561ab71-5cb4-466f-996c-ae4204ef7c12.png" alt="back" title="back" width="16px"/></a> This plugin provides basic Kage language support for Ebitengine. It includes keywords, types, literals and snippets.

![feature-syntax](https://user-images.githubusercontent.com/19890545/177754828-9ab585c9-56be-4304-92e5-dafa0b10ba97.png)

### Quick start

<a href="#features"><img src="https://user-images.githubusercontent.com/19890545/150034365-6561ab71-5cb4-466f-996c-ae4204ef7c12.png" alt="back" title="back" width="16px"/></a> To quickly start writing a shader, you can type "fragment" or "package".

![feature-quickstart](https://user-images.githubusercontent.com/19890545/177755034-58f14b63-f92d-4bba-8e7e-3e740cd81e60.png)

### Short documentation

<a href="#features"><img src="https://user-images.githubusercontent.com/19890545/150034365-6561ab71-5cb4-466f-996c-ae4204ef7c12.png" alt="back" title="back" width="16px"/></a> The plugin provides a short help for each feature in Kage.

![feature-description](https://user-images.githubusercontent.com/19890545/177755312-77153cff-16a7-46ce-b962-c002fc92c2ff.png)

### List of all built-in functions

<a href="#features"><img src="https://user-images.githubusercontent.com/19890545/150034365-6561ab71-5cb4-466f-996c-ae4204ef7c12.png" alt="back" title="back" width="16px"/></a> You can see a list of all built-in functions by typing "kage".

![feature-help](https://user-images.githubusercontent.com/19890545/177755430-0f020abf-abcc-4b02-8138-410695e09fbd.png)

## Known Issues

The plugin will highlight complex numbers despite the fact that, at the moment, Kage does not support them.
Binary file added kage-file-dark-theme.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added kage-file-light-theme.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added kage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 42 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"name": "ebitengine-kage",
"publisher": "sedyh",
"displayName": "ebitengine-kage",
"description": "Language for writing shaders on Ebitengine",
"version": "0.1.1",
"repository": {
"type": "git",
"url": "https://github.com/sedyh/ebitengine-kage-support.git"
},
"engines": {
"vscode": "^1.68.0"
},
"categories": [
"Programming Languages"
],
"license": "See LICENSE file",
"icon": "kage.png",
"contributes": {
"languages": [{
"id": "kage",
"aliases": ["kage", "kage"],
"extensions": [".kage",".go.kage",".kage.go"],
"configuration": "./syntaxes/language-configuration.json",
"icon": {
"light": "kage-file-light-theme.png",
"dark": "kage-file-dark-theme.png"
}
}],
"grammars": [{
"language": "kage",
"scopeName": "source.kage",
"path": "./syntaxes/kage.tmLanguage.json"
}],
"snippets": [
{
"language": "kage",
"path": "./syntaxes/snippets.json"
}
]
}
}
87 changes: 87 additions & 0 deletions syntaxes/kage.tmLanguage.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
{
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
"name": "kage",
"patterns": [
{ "include": "#keywords" },
{ "include": "#types" },
{ "include": "#builtins" },
{ "include": "#functions" },
{ "include": "#numbers" },
{ "include": "#comments" }
],
"repository": {
"keywords": {
"patterns": [
{
"name": "keyword.control.kage",
"match": "\\b(package|var|func|if|for|return|true|false|nil)\\b"
}
]
},
"types": {
"patterns": [
{
"name": "constant.language.kage",
"match": "\\b(bool|int|float|vec2|vec3|vec4|mat2|mat3|mat4)\\b"
}
]
},
"builtins": {
"patterns": [
{
"name": "entity.name.tag.kage",
"match": "\\b(sin|cos|tan|asin|acos|atan|atan2|pow|exp|log|exp2|log2|sqrt|inversesqrt|abs|sign|floor|ceil|fract|mod|min|max|clamp|mix|step|smoothstep|length|distance|dot|bcross|normalize|faceforward|reflect|refract|transpose|dfdx|dfdy|fwidth)\\b"
}
]
},
"functions": {
"patterns": [
{
"name": "entity.name.function.kage",
"match": "(?<=func )([a-zA-Z][a-zA-Z0-9]+)(?=\\()"
},
{
"name": "support.function.kage",
"match": "[a-zA-Z][a-zA-Z0-9]+(?=\\(.*\\))"
}
]
},
"numbers": {
"patterns": [
{
"name": "constant.numeric.kage",
"match": "(((\\.\\d+|0[xXbBoO][\\dbBxXaAbBcCdDeEfF_]*|(?<=[^\\w])\\d+)\\.{0,1}[\\dbBxXaAbBcCdDeEfF_]*([eEpP][-+]{0,1}\\d+))|((\\.\\d+|0[xXbBoO][\\dbBxXaAbBcCdDeEfF_]*|(?<=[^\\w])\\d+)\\.{0,1}[\\dbBxXaAbBcCdDeEfF_]*))i{0,1}"
}
]
},
"comments": {
"patterns": [
{
"name": "comment.line.double-slash.kage",
"match": "//.*"
},
{
"name": "comment.block.kage",
"begin": "/\\*(?!\\*)",
"end": "\\*/",
"patterns": [
{
"include": "#comments"
}
]
},
{
"name": "comment.block.documentation.kage",
"begin": "/\\*\\*",
"end": "\\*/",
"patterns": [
{
"include": "#comments"
}
]
}
]
}
},
"scopeName": "source.kage"
}
30 changes: 30 additions & 0 deletions syntaxes/language-configuration.json
Original file line number Diff line number Diff line change
@@ -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 can be used to surround a selection
"surroundingPairs": [
["{", "}"],
["[", "]"],
["(", ")"],
["\"", "\""],
["'", "'"]
]
}
Loading

0 comments on commit 100bb6f

Please sign in to comment.