-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit da44a32
Showing
17 changed files
with
324 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
out | ||
dist | ||
node_modules | ||
.vscode-test/ | ||
*.vsix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// A launch configuration that compiles the extension and then opens it 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": "Run Extension", | ||
"type": "extensionHost", | ||
"request": "launch", | ||
"args": [ | ||
"--extensionDevelopmentPath=${workspaceFolder}" | ||
], | ||
"outFiles": [ | ||
"${workspaceFolder}/out/**/*.js" | ||
], | ||
"preLaunchTask": "${defaultBuildTask}" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// Place your settings in this file to overwrite default and user settings. | ||
{ | ||
"files.exclude": { | ||
"out": false // set this to true to hide the "out" folder with the compiled JS files | ||
}, | ||
"search.exclude": { | ||
"out": true // set this to false to include "out" folder in search results | ||
}, | ||
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts | ||
"typescript.tsc.autoDetect": "off" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// See https://go.microsoft.com/fwlink/?LinkId=733558 | ||
// for the documentation about the tasks.json format | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"type": "npm", | ||
"script": "watch", | ||
"problemMatcher": "$tsc-watch", | ||
"isBackground": true, | ||
"presentation": { | ||
"reveal": "never" | ||
}, | ||
"group": { | ||
"kind": "build", | ||
"isDefault": true | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.vscode/** | ||
.vscode-test/** | ||
out/test/** | ||
|
||
src/** | ||
.gitignore | ||
.yarnrc | ||
vsc-extension-quickstart.md | ||
**/tsconfig.json | ||
**/.eslintrc.json | ||
**/*.map | ||
**/*.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--ignore-engines true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2022 Dmitriy Shiryaev | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# RnCore scripting language support | ||
|
||
## Release Notes | ||
|
||
### v0.1.0 — _03.02.2022_ | ||
|
||
Initial release. Basic syntax highlight. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{ | ||
"name": "rnscript-vscode", | ||
"displayName": "RnScript", | ||
"description": "RnCore scripting language support", | ||
"icon": "img/logo.png", | ||
"preview": true, | ||
"publisher": "DimaCrafter", | ||
"author": { | ||
"name": "Dmitriy Shiryaev", | ||
"email": "[email protected]" | ||
}, | ||
"repository": "https://github.com/DePowered-LLC/rnscript-vscode.git", | ||
"license": "MIT", | ||
"version": "0.1.0", | ||
"engines": { | ||
"vscode": "^1.63.0" | ||
}, | ||
"categories": [ | ||
"Programming Languages" | ||
], | ||
"activationEvents": [ | ||
"onLanguage:rnscript" | ||
], | ||
"main": "./out/extension.js", | ||
"contributes": { | ||
"languages": [ | ||
{ | ||
"id": "rnscript", | ||
"aliases": ["RnScript", "rns"], | ||
"extensions": [".rns"], | ||
"configuration": "./syntaxes/rnscript.config.json" | ||
} | ||
], | ||
"grammars": [ | ||
{ | ||
"language": "rnscript", | ||
"scopeName": "source.rnscript", | ||
"path": "./syntaxes/rnscript.tmLanguage.json" | ||
} | ||
] | ||
}, | ||
"scripts": { | ||
"vscode:prepublish": "yarn run compile", | ||
"compile": "tsc -p ./ && node syntaxes/build", | ||
"watch": "tsc -watch -p ./" | ||
}, | ||
"devDependencies": { | ||
"@types/vscode": "^1.63.0", | ||
"@types/glob": "^7.1.3", | ||
"@types/node": "14.x", | ||
"glob": "^7.1.7", | ||
"typescript": "^4.3.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import * as vscode from 'vscode' | ||
|
||
export function activate (context: vscode.ExtensionContext) { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
const { writeFileSync } = require('fs'); | ||
|
||
const ENTITY_NAME = '[A-Za-z_][A-Za-z0-9_]*'; | ||
function steppedRegExp (base, stairs, roof) { | ||
let result = base; | ||
|
||
for (const stair of stairs) result += '(?:(' + stair + ')'; | ||
result += ')?'.repeat(stairs.length); | ||
|
||
if (roof) result += roof; | ||
return result; | ||
} | ||
|
||
const rnscript = { | ||
scopeName: "source.rnscript", | ||
patterns: [ | ||
{ | ||
name: "entity.variable_declaration", | ||
match: steppedRegExp('(let)(?:', ['<', ENTITY_NAME, ':|->', ENTITY_NAME], '(>))?\\s+'), | ||
captures: { | ||
"1": { name: "keyword.variable.let" }, | ||
"2": { name: "punctuation.type_params.open" }, | ||
"3": { name: "entity.name.type.namespace" }, | ||
"4": { name: "punctuation.separator.type_access" }, | ||
"5": { name: "support.type" }, | ||
"6": { name: "punctuation.type_params.close" } | ||
} | ||
}, | ||
{ | ||
name: "keyword.variable.let", | ||
match: "let" | ||
}, | ||
{ | ||
name: "keyword.other.this", | ||
match: "this" | ||
}, | ||
{ include: "source.lua" } | ||
], | ||
repository: { | ||
} | ||
}; | ||
|
||
writeFileSync(__dirname + '/rnscript.tmLanguage.json', JSON.stringify(rnscript, null, '\t')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"comments": { | ||
"lineComment": "--" | ||
}, | ||
"brackets": [ | ||
["{", "}"], | ||
["[", "]"], | ||
["(", ")"] | ||
], | ||
"autoClosingPairs": [ | ||
{ "open": "{", "close": "}" }, | ||
{ "open": "let<", "close": ">" }, | ||
{ "open": "[", "close": "]" }, | ||
{ "open": "(", "close": ")" } | ||
], | ||
"surroundingPairs": [ | ||
["{", "}"], | ||
["[", "]"], | ||
["(", ")"] | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"scopeName": "source.rnscript", | ||
"patterns": [ | ||
{ | ||
"name": "entity.variable_declaration", | ||
"match": "(let)(?:(?:(<)(?:([A-Za-z_][A-Za-z0-9_]*)(?:(:|->)(?:([A-Za-z_][A-Za-z0-9_]*))?)?)?)?(>))?\\s+", | ||
"captures": { | ||
"1": { | ||
"name": "keyword.variable.let" | ||
}, | ||
"2": { | ||
"name": "punctuation.type_params.open" | ||
}, | ||
"3": { | ||
"name": "entity.name.type.namespace" | ||
}, | ||
"4": { | ||
"name": "punctuation.separator.type_access" | ||
}, | ||
"5": { | ||
"name": "support.type" | ||
}, | ||
"6": { | ||
"name": "punctuation.type_params.close" | ||
} | ||
} | ||
}, | ||
{ | ||
"name": "keyword.variable.let", | ||
"match": "let" | ||
}, | ||
{ | ||
"name": "keyword.other.this", | ||
"match": "this" | ||
}, | ||
{ | ||
"include": "source.lua" | ||
} | ||
], | ||
"repository": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
@AllowGET() | ||
@Middleware('session') | ||
function index() { | ||
set_header('A', 'b') | ||
|
||
this->print(get_header('Host')) | ||
|
||
let<rncore->number> test = '123' | ||
let<rncore:table> result = { | ||
a = test | ||
} | ||
|
||
let abc = 123 | ||
|
||
return this->json_data('text', false, result) | ||
} | ||
|
||
function b() { | ||
return 1234 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"compilerOptions": { | ||
"module": "commonjs", | ||
"target": "es6", | ||
"outDir": "out", | ||
"lib": [ | ||
"es6" | ||
], | ||
"sourceMap": true, | ||
"rootDir": "src", | ||
"strict": true /* enable all strict type-checking options */ | ||
/* Additional Checks */ | ||
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ | ||
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ | ||
// "noUnusedParameters": true, /* Report errors on unused parameters. */ | ||
}, | ||
"exclude": [ | ||
"node_modules", | ||
".vscode-test" | ||
] | ||
} |