return the editor folder

This commit is contained in:
MCorange 2023-04-13 13:43:53 +03:00
parent 5e2ffcdfda
commit 946bdef7ff
12 changed files with 2081 additions and 0 deletions

2
editor/vscode/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
**/*.log
**/node_modules/

17
editor/vscode/.vscode/launch.json vendored Normal file
View 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}"
]
}
]
}

View File

@ -0,0 +1,4 @@
.vscode/**
.vscode-test/**
.gitignore
vsc-extension-quickstart.md

View File

@ -0,0 +1,9 @@
# Change Log
All notable changes to the "mclang" 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

0
editor/vscode/LICENSE Normal file
View File

17
editor/vscode/README.md Normal file
View File

@ -0,0 +1,17 @@
# mclang README
Code highlghting for mclang 1 and 2
## Known Issues
None
## Release Notes
Users appreciate release notes as you update your extension.
### 1.0.0
Initial release of mclang
**Enjoy!**

View File

@ -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": [
["{", "}"],
["[", "]"],
["(", ")"],
["\"", "\""],
["'", "'"]
]
}

Binary file not shown.

View File

@ -0,0 +1,42 @@
{
"name": "mclang",
"displayName": "mclang",
"description": "Code highlighting for mclang",
"version": "0.0.3",
"repository": {
"type": "git",
"url": "git@github.com:mc-lang/mclang2.git"
},
"engines": {
"vscode": "^1.54.0"
},
"categories": [
"Programming Languages"
],
"contributes": {
"languages": [
{
"id": "mclang",
"aliases": [
"MCLang",
"mclang"
],
"extensions": [
".mcl"
],
"configuration": "./language-configuration.json"
}
],
"grammars": [
{
"language": "mclang",
"scopeName": "source.mcl",
"path": "./syntaxes/mclang.tmLanguage.json"
}
]
},
"dependencies": {
"generator-code": "^1.7.4",
"@vscode/vsce": "^2.15.0"
}
}

View File

@ -0,0 +1,147 @@
{
"name": "MCLang",
"fileTypes": [
"mcl"
],
"scopeName": "source.mcl",
"patterns": [
{
"include": "#errors"
},
{
"include": "#keywords"
},
{
"include": "#definitions"
},
{
"include": "#placeholders"
},
{
"include": "#strings"
},
{
"include": "#comments"
},
{
"include": "#intrinsics"
},
{
"include": "#constants-and-special-vars"
}
],
"repository": {
"errors": {
"patterns": [
{
"name": "invalid.illegal",
"match": "(?<=^|\\s)(?:const|memory)\\s+(end)(?:$|\\s)"
},
{
"name": "invalid.illegal",
"match": "(?<=^|\\s)(?:fn)\\s+(done)(?:$|\\s)"
},
{
"name": "invalid.illegal",
"match": "(?<=^|\\s)(memory|const)\\s+\\S*(\\s+|$)end(?:\n|\\s)"
},
{
"name": "invalid.illegal",
"match": "(?<=^|\\s)(inline)\\s+(?!fn(\\s|$))"
}
]
},
"keywords": {
"patterns": [
{
"name": "keyword.declaration.mclang",
"match": "(?<=\\s|^)(macro|memory|fn|const|in|inline|include|assert|offset|addr-of|call-like|reset|let|peek|with|returns)(?:\\s|$)"
},
{
"name": "keyword.control.mclang",
"match": "(?<=\\s|^)(if|else|elif|end|done|then|while|do|if\\*)(?:\\s|$)"
}
]
},
"definitions": {
"patterns": [
{
"name": "support.class.mclang",
"match": "(?<=(macro|memory|fn|const)\\s+)(\\S*)"
},
{
"name": "support.class.mclang",
"match": "(?<=(let|peek)\\s+)\\S+.*(?=\\s+(in))"
}
]
},
"placeholders": {
"patterns": [
{
"name": "markup.italic.mclang",
"match": "(?<=(\\s|^))_[\\S]*_(?:(\\s|$))"
}
]
},
"strings": {
"patterns": [
{
"name": "string.quoted.double.mclang",
"begin": "\"",
"end": "\"",
"patterns": [
{
"name": "constant.character.escape.mclang",
"match": "\\\\."
}
]
},
{
"name": "string.quoted.single.mclang",
"begin": "'",
"end": "'",
"patterns": [
{
"name": "constant.character.escape.mclang",
"match": "\\\\."
}
]
}
]
},
"comments": {
"patterns": [
{
"name": "constant.other.character-class.regexp",
"match": "(?://\\s*)(TODO(O*)|FIXME).*"
},
{
"name": "comment.line.double-slash.mclang",
"match": "(//(?!\\s?(TODO(O*)|FIXME)(\\s|:|$)).*|//\\s*)"
}
]
},
"intrinsics": {
"patterns": [
{
"name": "variable.name.source.mclang",
"match": "(?<=^|\\s)(\\+|-|\\*|int|ptr|bool|addr|any|void|max|divmod|_dbg_print|=|>|<|>=|<=|!=|>>|<<|\\||&|not|dup|swap|drop|over|rot|argc|argv|here|syscall0|syscall1|syscall2|syscall3|syscall4|syscall5|syscall6|\\?\\?\\?)(?=>$|\\s)"
}
]
},
"constants-and-special-vars": {
"patterns": [
{
"name": "constant.numeric.mclang",
"match": "\\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)\\b(?!\\$)"
},
{
"name": "entity.name.function.mclang",
"match": "(?<=^|\\s)(NULL|true|false|cast(ptr)|cast(int)|cast(bool)|sizeof\\(u64\\)|sizeof\\(u32\\)|sizeof\\(ptr\\)|sizeof\\(bool\\)|sizeof\\(int\\)|sizeof\\(addr\\)|STDIN|STDOUT|STDERR|@ptr|@@ptr|@bool|@int|@addr|!bool|!ptr|!int|!addr|AT_FDCWD|O_RDONLY|O_WRONLY|O_RDWR|O_CREAT|O_TRUNC|O_NONBLOCK|F_SETFL|F_GETFL|EAGAIN|CLOCK_MONOTONIC|TIMER_ABSTIME|MAP_PRIVATE|MAP_ANONYMOUS|PROT_READ|PROT_WRITE|SIGQUIT|timespec\\.tv_sec|timespec\\.tv_nsec|sizeof\\(timespec\\)|ptr\\+|ptr-|ptr!=|ptr=|ptr<|\\+ptr|ptr-diff|sizeof\\(stat\\)|stat\\.st_dev|stat\\.st_ino|stat\\.st_mode|stat\\.st_nlink|stat\\.st_uid|stat\\.st_gid|stat\\.st_rdev|stat\\.st_size|@stat\\.st_size|stat\\.st_blksize|stat\\.st_blocks|stat\\.st_atim|stat\\.st_mtim|stat\\.st_ctim|sizeof\\(stat\\.st_dev\\)|sizeof\\(stat\\.st_ino\\)|sizeof\\(stat\\.st_mode\\)|sizeof\\(stat\\.st_nlink\\)|sizeof\\(stat\\.st_uid\\)|sizeof\\(stat\\.st_gid\\)|sizeof\\(stat\\.st_rdev\\)|sizeof\\(stat\\.st_size\\)|sizeof\\(stat\\.st_blksize\\)|sizeof\\(stat\\.st_blocks\\)|sizeof\\(stat\\.st_atim\\)|sizeof\\(stat\\.st_mtim\\)|sizeof\\(stat\\.st_ctim\\)|write|read|openat|fstat|stat|close|exit|mmap|clock_nanosleep|clock_gettime|fork|getpid|execve|wait4|rename|fcntl|kill|dup2|/|%|mod|div|imod|idiv|emod|nth_argv|lnot|land|lor|inc64-by|inc64|dec64|inc32|dec32|inc8|dec8|swap64|cstrlen|cstreq|cstr-to-str|fputs|puts|eputs|WIFSTOPPED|WIFCONTINUED|WIFSIGNALED|WTERMSIG|WIFEXITED|WEXITSTATUS|offsetof\\(Str\\.count\\)|offsetof\\(Str\\.data\\)|sizeof\\(Str\\)|Str\\.count|Str\\.data|@Str\\.count|@Str\\.data|!Str\\.count|!Str\\.data|@Str|!Str|str-chop-one-left|str-chop-one-right|\\?space|str-trim-left|str-chop-by-predicate|str-chop-by-delim|str-starts-with|\\?str-empty|streq|\\?digit|isdigit|\\?alpha|isalpha|\\?alnum|isalnum|try-parse-int|PUTU_BUFFER_CAP|fputu|fput0u|putu|put0u|eputu|memcpy|memset|srand|RAND_A|RAND_C|rand|getenv|TMP_CAP|tmp-clean|tmp-end|tmp-rewind|tmp-alloc|tmp-str-to-cstr|tmp-append|tmp-append-ptr|execvp|append-item|tmp-utos|map-file|\\?file-exist|\\?shell-safe-char|\\?shell-safe-str|shell-escape|timeit/from-here|1e9|timeit/to-here|str-rfind|dirname|putch|remove-ext|cmd-echoed)(?:\\s|$)"
}
]
}
}
}

View 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/mclang.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.

1784
editor/vscode/yarn.lock Normal file

File diff suppressed because it is too large Load Diff