mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 14:54:07 +10:00
Added vscode syntax highlighting under /tools
This commit is contained in:
17
tools/toylang.vscode-highlighting/.vscode/launch.json
vendored
Normal file
17
tools/toylang.vscode-highlighting/.vscode/launch.json
vendored
Normal file
@@ -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}"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
4
tools/toylang.vscode-highlighting/.vscodeignore
Normal file
4
tools/toylang.vscode-highlighting/.vscodeignore
Normal file
@@ -0,0 +1,4 @@
|
||||
.vscode/**
|
||||
.vscode-test/**
|
||||
.gitignore
|
||||
vsc-extension-quickstart.md
|
||||
2
tools/toylang.vscode-highlighting/CHANGELOG.md
Normal file
2
tools/toylang.vscode-highlighting/CHANGELOG.md
Normal file
@@ -0,0 +1,2 @@
|
||||
# Change Log
|
||||
|
||||
8
tools/toylang.vscode-highlighting/README.md
Normal file
8
tools/toylang.vscode-highlighting/README.md
Normal file
@@ -0,0 +1,8 @@
|
||||
# Toy vscode Highlighting
|
||||
|
||||
This is included in the core repo under `/tools`, and is supposed to make your time writing Toy code easier.
|
||||
|
||||
## Installing
|
||||
|
||||
Just copy the whole folder into the extensions folder for VSCode.
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"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": [
|
||||
["{", "}"],
|
||||
["[", "]"],
|
||||
["(", ")"],
|
||||
["\"", "\""],
|
||||
]
|
||||
}
|
||||
25
tools/toylang.vscode-highlighting/package.json
Normal file
25
tools/toylang.vscode-highlighting/package.json
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"name": "toy-syntax-highlighting",
|
||||
"displayName": "Toy Syntax Highlighting",
|
||||
"description": "A toy programming language",
|
||||
"version": "0.0.1",
|
||||
"engines": {
|
||||
"vscode": "^1.73.0"
|
||||
},
|
||||
"categories": [
|
||||
"Programming Languages"
|
||||
],
|
||||
"contributes": {
|
||||
"languages": [{
|
||||
"id": "toy",
|
||||
"aliases": ["Toy", "toy"],
|
||||
"extensions": [".toy"],
|
||||
"configuration": "./language-configuration.json"
|
||||
}],
|
||||
"grammars": [{
|
||||
"language": "toy",
|
||||
"scopeName": "source.toy",
|
||||
"path": "./syntaxes/toy.tmLanguage.json"
|
||||
}]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
|
||||
"name": "Toy",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#comments"
|
||||
},
|
||||
{
|
||||
"include": "#keywords"
|
||||
},
|
||||
{
|
||||
"include": "#strings"
|
||||
},
|
||||
{
|
||||
"include": "#numbers"
|
||||
},
|
||||
{
|
||||
"include": "#booleans"
|
||||
},
|
||||
{
|
||||
"include": "#null"
|
||||
},
|
||||
{
|
||||
"include": "#reserved"
|
||||
}
|
||||
],
|
||||
"repository": {
|
||||
"comments": {
|
||||
"patterns": [{
|
||||
"name": "comment.line.toy",
|
||||
"begin": "\/\/",
|
||||
"end": "\\n"
|
||||
},
|
||||
{
|
||||
"name": "comment.block.toy",
|
||||
"begin": "/\\*",
|
||||
"end": "\\*/"
|
||||
}]
|
||||
},
|
||||
"keywords": {
|
||||
"patterns": [{
|
||||
"name": "keyword.control.toy",
|
||||
"match": "\\b(if|else|while|for|return|break|continue)\\b"
|
||||
},
|
||||
{
|
||||
"name": "keyword.type.toy",
|
||||
"match": "\\b(any|bool|const|float|int|string|type)\\b"
|
||||
},
|
||||
{
|
||||
"name": "keyword.other.toy",
|
||||
"match": "\\b(as|astype|assert|export|fn|import|print|typeof|var)\\b"
|
||||
}]
|
||||
},
|
||||
"strings": {
|
||||
"name": "string.quoted.double.toy",
|
||||
"begin": "\"",
|
||||
"end": "\""
|
||||
},
|
||||
"numbers": {
|
||||
"patterns": [{
|
||||
"match": "[-]?[0-9]+(.[0-9]+)?",
|
||||
"name": "constant.numeric.toy"
|
||||
}]
|
||||
},
|
||||
"booleans": {
|
||||
"patterns": [{
|
||||
"match": "\\b(true|false)\\b",
|
||||
"name": "constant.numeric.toy"
|
||||
}]
|
||||
},
|
||||
"null": {
|
||||
"patterns": [{
|
||||
"match": "\\b(null)\\b",
|
||||
"name": "constant.numeric.toy"
|
||||
}]
|
||||
},
|
||||
"reserved": {
|
||||
"patterns": [{
|
||||
"name": "keyword.reserved.toy",
|
||||
"match": "\\b(class|do|foreach|in|of)\\b"
|
||||
}]
|
||||
}
|
||||
},
|
||||
"scopeName": "source.toy"
|
||||
}
|
||||
Reference in New Issue
Block a user