From c7512d97db4a165f5cf34e5d670f79f697c31f91 Mon Sep 17 00:00:00 2001 From: Eivind Fasting Date: Mon, 3 Jun 2024 23:33:34 +0200 Subject: [PATCH] Updated crmscript-langium to now support basic types and some scopes for nested. Updated vscode extension to read client_id from a file, and refactored the authenticationService to be more dependency injection pattern --- packages/langium-crmscript/.eslintrc.json | 13 + packages/langium-crmscript/.gitignore | 11 + .../langium-crmscript/.vscode/extensions.json | 11 + .../langium-crmscript/.vscode/launch.json | 36 + packages/langium-crmscript/.vscode/tasks.json | 21 + packages/langium-crmscript/.vscodeignore | 4 + packages/langium-crmscript/README.md | 2 + packages/langium-crmscript/esbuild.mjs | 54 + .../examples/basic.crmscript-definition | 19 + .../langium-crmscript/examples/test.crmscript | 77 + .../langium-crmscript/langium-config.json | 21 +- .../language-configuration.json | 30 + packages/langium-crmscript/package-lock.json | 3895 +++++++++++++++++ packages/langium-crmscript/package.json | 100 +- packages/langium-crmscript/src/backup.langium | 189 + .../langium-crmscript/src/extension/main.ts | 53 + .../src/language/builtin/builtin.ts | 6 + .../{lib => builtin}/workspaceManager.ts | 4 +- ...t.langium => crmscript-definition.langium} | 75 +- .../language/crmscript-implementation.langium | 46 + .../src/language/crmscript-module.ts | 54 +- .../src/language/crmscript-scope.ts | 48 + .../src/language/crmscript-validator.ts | 83 +- .../src/language/generated/ast.ts | 279 +- .../src/language/generated/grammar.ts | 2516 +++++++++-- .../src/language/generated/module.ts | 24 +- .../src/language/lib/builtinCrmscript.ts | 13 - .../langium-crmscript/src/language/main.ts | 13 + .../language/overrides/completionProvider.ts | 181 - .../src/language/type-system/assignment.ts | 5 +- .../src/language/type-system/descriptions.ts | 28 +- .../src/language/type-system/infer.ts | 75 +- .../src/language/type-system/operator.ts | 10 +- .../syntaxes/crmscript.tmLanguage.json | 2 +- .../test/linking/linking.test.ts | 53 + .../test/parsing/parsing.test.ts | 60 + .../test/validating/validating.test.ts | 66 + packages/langium-crmscript/tsconfig.json | 33 +- packages/langium-crmscript/tsconfig.src.json | 11 + packages/langium-crmscript/vitest.config.ts | 20 + .../language-server/src/core/superoffice.ts | 10 +- .../src/plugins/crmscript-definition.ts | 98 + .../language-server/src/plugins/crmscript.ts | 58 - packages/language-server/src/server.ts | 31 +- .../crmscript-language-configuration.json | 54 +- packages/vscode/package.json | 73 +- packages/vscode/src/commands.ts | 127 +- packages/vscode/src/config.ts | 19 +- packages/vscode/src/container.ts | 35 + packages/vscode/src/extension.ts | 39 +- .../src/providers/authenticationProvider.ts | 34 +- .../providers/dslLibraryFileSystemProvider.ts | 2 +- .../src/providers/treeViewDataProvider.ts | 19 +- .../src/services/authenticationService.ts | 412 +- packages/vscode/src/services/httpService.ts | 2 +- packages/vscode/src/services/scriptService.ts | 134 +- packages/vscode/src/services/systemService.ts | 2 +- packages/vscode/src/services/uriHandler.ts | 12 + packages/vscode/src/types.ts | 2 + .../vscode/src/workspace/fileSystemHandler.ts | 156 +- .../workspace/virtualWorkspaceFileManager.ts | 2 +- .../crmscript-definition.tmLanguage.json | 61 + ... crmscript-implementation.tmLanguage.json} | 32 +- test/.superoffice/.suo | 2 +- test/.vscode/settings.json | 1 + test/basic-sample.crmscript | 32 +- ...t => embedded-sample.crmscript-definition} | 0 test/test.crmscript | 0 test/test.crmscript-definition | 25 + 69 files changed, 8329 insertions(+), 1386 deletions(-) create mode 100644 packages/langium-crmscript/.eslintrc.json create mode 100644 packages/langium-crmscript/.gitignore create mode 100644 packages/langium-crmscript/.vscode/extensions.json create mode 100644 packages/langium-crmscript/.vscode/launch.json create mode 100644 packages/langium-crmscript/.vscode/tasks.json create mode 100644 packages/langium-crmscript/.vscodeignore create mode 100644 packages/langium-crmscript/README.md create mode 100644 packages/langium-crmscript/esbuild.mjs create mode 100644 packages/langium-crmscript/examples/basic.crmscript-definition create mode 100644 packages/langium-crmscript/examples/test.crmscript create mode 100644 packages/langium-crmscript/language-configuration.json create mode 100644 packages/langium-crmscript/package-lock.json create mode 100644 packages/langium-crmscript/src/backup.langium create mode 100644 packages/langium-crmscript/src/extension/main.ts create mode 100644 packages/langium-crmscript/src/language/builtin/builtin.ts rename packages/langium-crmscript/src/language/{lib => builtin}/workspaceManager.ts (83%) rename packages/langium-crmscript/src/language/{crmscript.langium => crmscript-definition.langium} (61%) create mode 100644 packages/langium-crmscript/src/language/crmscript-implementation.langium create mode 100644 packages/langium-crmscript/src/language/crmscript-scope.ts delete mode 100644 packages/langium-crmscript/src/language/lib/builtinCrmscript.ts create mode 100644 packages/langium-crmscript/src/language/main.ts delete mode 100644 packages/langium-crmscript/src/language/overrides/completionProvider.ts create mode 100644 packages/langium-crmscript/test/linking/linking.test.ts create mode 100644 packages/langium-crmscript/test/parsing/parsing.test.ts create mode 100644 packages/langium-crmscript/test/validating/validating.test.ts create mode 100644 packages/langium-crmscript/tsconfig.src.json create mode 100644 packages/langium-crmscript/vitest.config.ts create mode 100644 packages/language-server/src/plugins/crmscript-definition.ts delete mode 100644 packages/language-server/src/plugins/crmscript.ts create mode 100644 packages/vscode/src/container.ts create mode 100644 packages/vscode/src/services/uriHandler.ts create mode 100644 packages/vscode/syntaxes/crmscript-definition.tmLanguage.json rename packages/vscode/syntaxes/{crmscript.tmLanguage.json => crmscript-implementation.tmLanguage.json} (58%) create mode 100644 test/.vscode/settings.json rename test/{embedded-sample.crmscript => embedded-sample.crmscript-definition} (100%) delete mode 100644 test/test.crmscript create mode 100644 test/test.crmscript-definition diff --git a/packages/langium-crmscript/.eslintrc.json b/packages/langium-crmscript/.eslintrc.json new file mode 100644 index 0000000..8252235 --- /dev/null +++ b/packages/langium-crmscript/.eslintrc.json @@ -0,0 +1,13 @@ +{ + "root": true, + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaVersion": 6, + "sourceType": "module" + }, + "plugins": [ + "@typescript-eslint" + ], + "rules": { + } +} diff --git a/packages/langium-crmscript/.gitignore b/packages/langium-crmscript/.gitignore new file mode 100644 index 0000000..1ff0854 --- /dev/null +++ b/packages/langium-crmscript/.gitignore @@ -0,0 +1,11 @@ +.vscode/* +!.vscode/extensions.json +!.vscode/launch.json +!.vscode/tasks.json +node_modules/ +out/ +src/language/generated/ +static/bundle/ +static/monaco-editor-workers/ +static/worker/ +syntaxes/ diff --git a/packages/langium-crmscript/.vscode/extensions.json b/packages/langium-crmscript/.vscode/extensions.json new file mode 100644 index 0000000..1252a6c --- /dev/null +++ b/packages/langium-crmscript/.vscode/extensions.json @@ -0,0 +1,11 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations. + // Extension identifier format: ${publisher}.${name}. Example: vscode.csharp + + // List of extensions which should be recommended for users of this workspace. + "recommendations": [ + "langium.langium-vscode", + "ZixuanChen.vitest-explorer", + "kingwl.vscode-vitest-runner" + ] +} diff --git a/packages/langium-crmscript/.vscode/launch.json b/packages/langium-crmscript/.vscode/launch.json new file mode 100644 index 0000000..030f16a --- /dev/null +++ b/packages/langium-crmscript/.vscode/launch.json @@ -0,0 +1,36 @@ +// 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": "Run Extension", + "type": "extensionHost", + "request": "launch", + "args": [ + "--extensionDevelopmentPath=${workspaceFolder}", + "--folder-uri=${workspaceRoot}/examples" + ], + "sourceMaps": true, + "outFiles": [ + "${workspaceFolder}/out/**/*.js" + ] + }, + { + "name": "Attach to Language Server", + "type": "node", + "port": 6009, + "request": "attach", + "skipFiles": [ + "/**" + ], + "sourceMaps": true, + "outFiles": [ + "${workspaceFolder}/out/**/*.js", + "${workspaceFolder}/node_modules/langium" + ] + } + ] +} diff --git a/packages/langium-crmscript/.vscode/tasks.json b/packages/langium-crmscript/.vscode/tasks.json new file mode 100644 index 0000000..1924dab --- /dev/null +++ b/packages/langium-crmscript/.vscode/tasks.json @@ -0,0 +1,21 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "label": "Build crmscript", + "command": "npm run langium:generate && npm run build", + "type": "shell", + "group": { + "kind": "build", + "isDefault": true + }, + "detail": "Langium: Generate grammar and build the crmscript language", + "icon": { + "color": "terminal.ansiGreen", + "id": "server-process" + } + } + ] +} diff --git a/packages/langium-crmscript/.vscodeignore b/packages/langium-crmscript/.vscodeignore new file mode 100644 index 0000000..4f97a26 --- /dev/null +++ b/packages/langium-crmscript/.vscodeignore @@ -0,0 +1,4 @@ +.vscode/** +.vscode-test/** +.gitignore +langium-quickstart.md diff --git a/packages/langium-crmscript/README.md b/packages/langium-crmscript/README.md new file mode 100644 index 0000000..fd46e26 --- /dev/null +++ b/packages/langium-crmscript/README.md @@ -0,0 +1,2 @@ +# langium-crmscript +Language definition for CRMScript using Langium diff --git a/packages/langium-crmscript/esbuild.mjs b/packages/langium-crmscript/esbuild.mjs new file mode 100644 index 0000000..db5eff8 --- /dev/null +++ b/packages/langium-crmscript/esbuild.mjs @@ -0,0 +1,54 @@ +//@ts-check +import * as esbuild from 'esbuild'; + +const watch = process.argv.includes('--watch'); +const minify = process.argv.includes('--minify'); + +const success = watch ? 'Watch build succeeded' : 'Build succeeded'; + +function getTime() { + const date = new Date(); + return `[${`${padZeroes(date.getHours())}:${padZeroes(date.getMinutes())}:${padZeroes(date.getSeconds())}`}] `; +} + +function padZeroes(i) { + return i.toString().padStart(2, '0'); +} + +const plugins = [{ + name: 'watch-plugin', + setup(build) { + build.onEnd(result => { + if (result.errors.length === 0) { + console.log(getTime() + success); + } + }); + }, +}]; + +const ctx = await esbuild.context({ + // Entry points for the vscode extension and the language server + entryPoints: ['src/extension/main.ts', 'src/language/main.ts'], + outdir: 'out', + bundle: true, + target: "ES2017", + // VSCode's extension host is still using cjs, so we need to transform the code + format: 'cjs', + // To prevent confusing node, we explicitly use the `.cjs` extension + outExtension: { + '.js': '.cjs' + }, + loader: { '.ts': 'ts' }, + external: ['vscode'], + platform: 'node', + sourcemap: !minify, + minify, + plugins +}); + +if (watch) { + await ctx.watch(); +} else { + await ctx.rebuild(); + ctx.dispose(); +} diff --git a/packages/langium-crmscript/examples/basic.crmscript-definition b/packages/langium-crmscript/examples/basic.crmscript-definition new file mode 100644 index 0000000..107aac2 --- /dev/null +++ b/packages/langium-crmscript/examples/basic.crmscript-definition @@ -0,0 +1,19 @@ +/** +# String + +Summary goes here. + +I just love **bold text**. + +```crmscript + +String something = "Hello"; + +``` + +*/ +class String { +} + +String temp = ""; + diff --git a/packages/langium-crmscript/examples/test.crmscript b/packages/langium-crmscript/examples/test.crmscript new file mode 100644 index 0000000..36a0781 --- /dev/null +++ b/packages/langium-crmscript/examples/test.crmscript @@ -0,0 +1,77 @@ + + +// ///Should be invalid +// Integer invalidSetInteger = "123"; +// Integer invalidSetInteger2 = true; +// String invalidSetString = 123; +// String invalidSetString2 = true; +// Bool invalidSetBool = "123"; +// Bool invalidSetBool2 = 123; +// Integer invalidSumInteger = 123 + "123"; + +// String myStringFunction() { +// return 123; +// } + +// Integer myIntegerFunction() { +// return "123"; +// } +// //--------------------------------------- --------------------------------------- + + +// /////Should be valid +// "123"; +// 13213; +// true; +// Bool validEmptyBool; +// Bool validSetBool = true; +// String validEmptyString; +// String validSetString = "123"; +// String validSumString = "123" + "123"; +// Integer validEmptyInteger; +// Integer validSetInteger = 123; +// Integer validSumInteger = 123 + 123; + +// for(Integer i = 0; i > 20; i++){ +// Integer j = i + 20; +// String bla = "123" + 20; +// } + +// String myStringFunction() { +// return "123"; +// } + +// Integer myIntegerFunction() { +// return 123; +// } + + +// try{} +// catch(exception){} + + +// /** Hover*/ +// //Builtin Class +// Customer c; +// c.firstName = "123"; + +// //--------------------------------------- --------------------------------------- + +// //--------------------------------------- Not working correctly --------------------------------------- +// //Not working correctly +// String invalidSumString = 123 + "123"; // <= This should be invalid, need to look at the validation of number + string +// //TODO: Implement Structs +// // struct myStruct { //Hover returned from the checkStructDeclaration validation method +// // String structString; +// // Integer structInt; +// // Customer cust; +// // String getString(){ +// // this.structString = "1232"; // <= this keyword is not recognized as a NamedElement (?) +// // return this.customerString; // Need to validate this is possible after the line above is working +// // } +// // }; + +// String temp = "123"; +// Integer int = 123; + +// temp. \ No newline at end of file diff --git a/packages/langium-crmscript/langium-config.json b/packages/langium-crmscript/langium-config.json index ed1ac03..bb2567a 100644 --- a/packages/langium-crmscript/langium-config.json +++ b/packages/langium-crmscript/langium-config.json @@ -1,11 +1,24 @@ { "projectName": "Crmscript", - "languages": [{ - "id": "crmscript", - "grammar": "src/language/crmscript.langium", + "languages": [ { + "id": "crmscript-definition", + "grammar": "src/language/crmscript-definition.langium", + "fileExtensions": [".crmscript-definition"], + "textMate": { + "out": "syntaxes/crmscript-definition.tmLanguage.json" + }, + "monarch": { + "out": "syntaxes/crmscript-definition.monarch.ts" + } + }, { + "id": "crmscript-implementation", + "grammar": "src/language/crmscript-implementation.langium", "fileExtensions": [".crmscript"], "textMate": { - "out": "syntaxes/crmscript.tmLanguage.json" + "out": "syntaxes/crmscript-implementation.tmLanguage.json" + }, + "monarch": { + "out": "syntaxes/crmscript-implementation.monarch.ts" } }], "out": "src/language/generated" diff --git a/packages/langium-crmscript/language-configuration.json b/packages/langium-crmscript/language-configuration.json new file mode 100644 index 0000000..6b619d0 --- /dev/null +++ b/packages/langium-crmscript/language-configuration.json @@ -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": [ + ["{", "}"], + ["[", "]"], + ["(", ")"], + ["\"", "\""], + ["'", "'"] + ] +} diff --git a/packages/langium-crmscript/package-lock.json b/packages/langium-crmscript/package-lock.json new file mode 100644 index 0000000..784f601 --- /dev/null +++ b/packages/langium-crmscript/package-lock.json @@ -0,0 +1,3895 @@ +{ + "name": "langium-crmscript", + "version": "0.0.1", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "langium-crmscript", + "version": "0.0.1", + "dependencies": { + "langium": "~3.0.0", + "vscode-languageclient": "~9.0.1", + "vscode-languageserver": "~9.0.1" + }, + "devDependencies": { + "@types/node": "^18.0.0", + "@types/vscode": "~1.67.0", + "@typescript-eslint/eslint-plugin": "~6.4.1", + "@typescript-eslint/parser": "~6.4.1", + "concurrently": "~8.2.1", + "esbuild": "~0.19.2", + "eslint": "~8.47.0", + "langium-cli": "~3.0.0", + "typescript": "~5.1.6", + "vitest": "~1.0.0" + }, + "engines": { + "vscode": "^1.67.0" + } + }, + "node_modules/@babel/runtime": { + "version": "7.24.6", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.6.tgz", + "integrity": "sha512-Ja18XcETdEl5mzzACGd+DKgaGJzPTCow7EglgwTmHdwokzDFYh/MHua6lU6DV/hjF2IaOJ4oX2nqnjG7RElKOw==", + "dev": true, + "dependencies": { + "regenerator-runtime": "^0.14.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@chevrotain/cst-dts-gen": { + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/@chevrotain/cst-dts-gen/-/cst-dts-gen-11.0.3.tgz", + "integrity": "sha512-BvIKpRLeS/8UbfxXxgC33xOumsacaeCKAjAeLyOn7Pcp95HiRbrpl14S+9vaZLolnbssPIUuiUd8IvgkRyt6NQ==", + "dependencies": { + "@chevrotain/gast": "11.0.3", + "@chevrotain/types": "11.0.3", + "lodash-es": "4.17.21" + } + }, + "node_modules/@chevrotain/gast": { + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/@chevrotain/gast/-/gast-11.0.3.tgz", + "integrity": "sha512-+qNfcoNk70PyS/uxmj3li5NiECO+2YKZZQMbmjTqRI3Qchu8Hig/Q9vgkHpI3alNjr7M+a2St5pw5w5F6NL5/Q==", + "dependencies": { + "@chevrotain/types": "11.0.3", + "lodash-es": "4.17.21" + } + }, + "node_modules/@chevrotain/regexp-to-ast": { + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/@chevrotain/regexp-to-ast/-/regexp-to-ast-11.0.3.tgz", + "integrity": "sha512-1fMHaBZxLFvWI067AVbGJav1eRY7N8DDvYCTwGBiE/ytKBgP8azTdgyrKyWZ9Mfh09eHWb5PgTSO8wi7U824RA==" + }, + "node_modules/@chevrotain/types": { + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/@chevrotain/types/-/types-11.0.3.tgz", + "integrity": "sha512-gsiM3G8b58kZC2HaWR50gu6Y1440cHiJ+i3JUvcp/35JchYejb2+5MVeJK0iKThYpAa/P2PYFV4hoi44HD+aHQ==" + }, + "node_modules/@chevrotain/utils": { + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/@chevrotain/utils/-/utils-11.0.3.tgz", + "integrity": "sha512-YslZMgtJUyuMbZ+aKvfF3x1f5liK4mWNxghFRv7jqRR9C3R3fAOGTTKvxXDa2Y1s9zSbcpuO0cAxDYsc9SrXoQ==" + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.19.12.tgz", + "integrity": "sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.12.tgz", + "integrity": "sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.12.tgz", + "integrity": "sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.12.tgz", + "integrity": "sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.12.tgz", + "integrity": "sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.12.tgz", + "integrity": "sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.12.tgz", + "integrity": "sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.12.tgz", + "integrity": "sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.12.tgz", + "integrity": "sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.12.tgz", + "integrity": "sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.12.tgz", + "integrity": "sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.12.tgz", + "integrity": "sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.12.tgz", + "integrity": "sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.12.tgz", + "integrity": "sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.12.tgz", + "integrity": "sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.12.tgz", + "integrity": "sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.12.tgz", + "integrity": "sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.12.tgz", + "integrity": "sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.12.tgz", + "integrity": "sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.12.tgz", + "integrity": "sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.12.tgz", + "integrity": "sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.12.tgz", + "integrity": "sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.12.tgz", + "integrity": "sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz", + "integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==", + "dev": true, + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "dev": true, + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.6.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/js": { + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", + "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.11.14", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", + "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", + "dev": true, + "dependencies": { + "@humanwhocodes/object-schema": "^2.0.2", + "debug": "^4.3.1", + "minimatch": "^3.0.5" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", + "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", + "dev": true + }, + "node_modules/@jest/schemas": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", + "dev": true, + "dependencies": { + "@sinclair/typebox": "^0.27.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "dev": true + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.18.0.tgz", + "integrity": "sha512-Tya6xypR10giZV1XzxmH5wr25VcZSncG0pZIjfePT0OVBvqNEurzValetGNarVrGiq66EBVAFn15iYX4w6FKgQ==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.18.0.tgz", + "integrity": "sha512-avCea0RAP03lTsDhEyfy+hpfr85KfyTctMADqHVhLAF3MlIkq83CP8UfAHUssgXTYd+6er6PaAhx/QGv4L1EiA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.18.0.tgz", + "integrity": "sha512-IWfdwU7KDSm07Ty0PuA/W2JYoZ4iTj3TUQjkVsO/6U+4I1jN5lcR71ZEvRh52sDOERdnNhhHU57UITXz5jC1/w==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.18.0.tgz", + "integrity": "sha512-n2LMsUz7Ynu7DoQrSQkBf8iNrjOGyPLrdSg802vk6XT3FtsgX6JbE8IHRvposskFm9SNxzkLYGSq9QdpLYpRNA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.18.0.tgz", + "integrity": "sha512-C/zbRYRXFjWvz9Z4haRxcTdnkPt1BtCkz+7RtBSuNmKzMzp3ZxdM28Mpccn6pt28/UWUCTXa+b0Mx1k3g6NOMA==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.18.0.tgz", + "integrity": "sha512-l3m9ewPgjQSXrUMHg93vt0hYCGnrMOcUpTz6FLtbwljo2HluS4zTXFy2571YQbisTnfTKPZ01u/ukJdQTLGh9A==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.18.0.tgz", + "integrity": "sha512-rJ5D47d8WD7J+7STKdCUAgmQk49xuFrRi9pZkWoRD1UeSMakbcepWXPF8ycChBoAqs1pb2wzvbY6Q33WmN2ftw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.18.0.tgz", + "integrity": "sha512-be6Yx37b24ZwxQ+wOQXXLZqpq4jTckJhtGlWGZs68TgdKXJgw54lUUoFYrg6Zs/kjzAQwEwYbp8JxZVzZLRepQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.18.0.tgz", + "integrity": "sha512-hNVMQK+qrA9Todu9+wqrXOHxFiD5YmdEi3paj6vP02Kx1hjd2LLYR2eaN7DsEshg09+9uzWi2W18MJDlG0cxJA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.18.0.tgz", + "integrity": "sha512-ROCM7i+m1NfdrsmvwSzoxp9HFtmKGHEqu5NNDiZWQtXLA8S5HBCkVvKAxJ8U+CVctHwV2Gb5VUaK7UAkzhDjlg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.18.0.tgz", + "integrity": "sha512-0UyyRHyDN42QL+NbqevXIIUnKA47A+45WyasO+y2bGJ1mhQrfrtXUpTxCOrfxCR4esV3/RLYyucGVPiUsO8xjg==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.18.0.tgz", + "integrity": "sha512-xuglR2rBVHA5UsI8h8UbX4VJ470PtGCf5Vpswh7p2ukaqBGFTnsfzxUBetoWBWymHMxbIG0Cmx7Y9qDZzr648w==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.18.0.tgz", + "integrity": "sha512-LKaqQL9osY/ir2geuLVvRRs+utWUNilzdE90TpyoX0eNqPzWjRm14oMEE+YLve4k/NAqCdPkGYDaDF5Sw+xBfg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.18.0.tgz", + "integrity": "sha512-7J6TkZQFGo9qBKH0pk2cEVSRhJbL6MtfWxth7Y5YmZs57Pi+4x6c2dStAUvaQkHQLnEQv1jzBUW43GvZW8OFqA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.18.0.tgz", + "integrity": "sha512-Txjh+IxBPbkUB9+SXZMpv+b/vnTEtFyfWZgJ6iyCmt2tdx0OF5WhFowLmnh8ENGNpfUlUZkdI//4IEmhwPieNg==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.18.0.tgz", + "integrity": "sha512-UOo5FdvOL0+eIVTgS4tIdbW+TtnBLWg1YBCcU2KWM7nuNwRz9bksDX1bekJJCpu25N1DVWaCwnT39dVQxzqS8g==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@sinclair/typebox": { + "version": "0.27.8", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", + "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "dev": true + }, + "node_modules/@types/estree": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", + "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", + "dev": true + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true + }, + "node_modules/@types/node": { + "version": "18.19.33", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.33.tgz", + "integrity": "sha512-NR9+KrpSajr2qBVp/Yt5TU/rp+b5Mayi3+OlMlcg2cVCfRmcG5PWZ7S4+MG9PZ5gWBoc9Pd0BKSRViuBCRPu0A==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@types/semver": { + "version": "7.5.8", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz", + "integrity": "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==", + "dev": true + }, + "node_modules/@types/vscode": { + "version": "1.67.0", + "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.67.0.tgz", + "integrity": "sha512-GH8BDf8cw9AC9080uneJfulhSa7KHSMI2s/CyKePXoGNos9J486w2V4YKoeNUqIEkW4hKoEAWp6/cXTwyGj47g==", + "dev": true + }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.4.1.tgz", + "integrity": "sha512-3F5PtBzUW0dYlq77Lcqo13fv+58KDwUib3BddilE8ajPJT+faGgxmI9Sw+I8ZS22BYwoir9ZhNXcLi+S+I2bkw==", + "dev": true, + "dependencies": { + "@eslint-community/regexpp": "^4.5.1", + "@typescript-eslint/scope-manager": "6.4.1", + "@typescript-eslint/type-utils": "6.4.1", + "@typescript-eslint/utils": "6.4.1", + "@typescript-eslint/visitor-keys": "6.4.1", + "debug": "^4.3.4", + "graphemer": "^1.4.0", + "ignore": "^5.2.4", + "natural-compare": "^1.4.0", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^6.0.0 || ^6.0.0-alpha", + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.4.1.tgz", + "integrity": "sha512-610G6KHymg9V7EqOaNBMtD1GgpAmGROsmfHJPXNLCU9bfIuLrkdOygltK784F6Crboyd5tBFayPB7Sf0McrQwg==", + "dev": true, + "dependencies": { + "@typescript-eslint/scope-manager": "6.4.1", + "@typescript-eslint/types": "6.4.1", + "@typescript-eslint/typescript-estree": "6.4.1", + "@typescript-eslint/visitor-keys": "6.4.1", + "debug": "^4.3.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.4.1.tgz", + "integrity": "sha512-p/OavqOQfm4/Hdrr7kvacOSFjwQ2rrDVJRPxt/o0TOWdFnjJptnjnZ+sYDR7fi4OimvIuKp+2LCkc+rt9fIW+A==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "6.4.1", + "@typescript-eslint/visitor-keys": "6.4.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.4.1.tgz", + "integrity": "sha512-7ON8M8NXh73SGZ5XvIqWHjgX2f+vvaOarNliGhjrJnv1vdjG0LVIz+ToYfPirOoBi56jxAKLfsLm40+RvxVVXA==", + "dev": true, + "dependencies": { + "@typescript-eslint/typescript-estree": "6.4.1", + "@typescript-eslint/utils": "6.4.1", + "debug": "^4.3.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/types": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.4.1.tgz", + "integrity": "sha512-zAAopbNuYu++ijY1GV2ylCsQsi3B8QvfPHVqhGdDcbx/NK5lkqMnCGU53amAjccSpk+LfeONxwzUhDzArSfZJg==", + "dev": true, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.4.1.tgz", + "integrity": "sha512-xF6Y7SatVE/OyV93h1xGgfOkHr2iXuo8ip0gbfzaKeGGuKiAnzS+HtVhSPx8Www243bwlW8IF7X0/B62SzFftg==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "6.4.1", + "@typescript-eslint/visitor-keys": "6.4.1", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.4.1.tgz", + "integrity": "sha512-F/6r2RieNeorU0zhqZNv89s9bDZSovv3bZQpUNOmmQK1L80/cV4KEu95YUJWi75u5PhboFoKUJBnZ4FQcoqhDw==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@types/json-schema": "^7.0.12", + "@types/semver": "^7.5.0", + "@typescript-eslint/scope-manager": "6.4.1", + "@typescript-eslint/types": "6.4.1", + "@typescript-eslint/typescript-estree": "6.4.1", + "semver": "^7.5.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.4.1.tgz", + "integrity": "sha512-y/TyRJsbZPkJIZQXrHfdnxVnxyKegnpEvnRGNam7s3TRR2ykGefEWOhaef00/UUN3IZxizS7BTO3svd3lCOJRQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "6.4.1", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@vitest/expect": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.0.4.tgz", + "integrity": "sha512-/NRN9N88qjg3dkhmFcCBwhn/Ie4h064pY3iv7WLRsDJW7dXnEgeoa8W9zy7gIPluhz6CkgqiB3HmpIXgmEY5dQ==", + "dev": true, + "dependencies": { + "@vitest/spy": "1.0.4", + "@vitest/utils": "1.0.4", + "chai": "^4.3.10" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/runner": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.0.4.tgz", + "integrity": "sha512-rhOQ9FZTEkV41JWXozFM8YgOqaG9zA7QXbhg5gy6mFOVqh4PcupirIJ+wN7QjeJt8S8nJRYuZH1OjJjsbxAXTQ==", + "dev": true, + "dependencies": { + "@vitest/utils": "1.0.4", + "p-limit": "^5.0.0", + "pathe": "^1.1.1" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/runner/node_modules/p-limit": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-5.0.0.tgz", + "integrity": "sha512-/Eaoq+QyLSiXQ4lyYV23f14mZRQcXnxfHrN0vCai+ak9G0pp9iEQukIIZq5NccEvwRB8PUnZT0KsOoDCINS1qQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^1.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@vitest/runner/node_modules/yocto-queue": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", + "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", + "dev": true, + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@vitest/snapshot": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.0.4.tgz", + "integrity": "sha512-vkfXUrNyNRA/Gzsp2lpyJxh94vU2OHT1amoD6WuvUAA12n32xeVZQ0KjjQIf8F6u7bcq2A2k969fMVxEsxeKYA==", + "dev": true, + "dependencies": { + "magic-string": "^0.30.5", + "pathe": "^1.1.1", + "pretty-format": "^29.7.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/spy": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.0.4.tgz", + "integrity": "sha512-9ojTFRL1AJVh0hvfzAQpm0QS6xIS+1HFIw94kl/1ucTfGCaj1LV/iuJU4Y6cdR03EzPDygxTHwE1JOm+5RCcvA==", + "dev": true, + "dependencies": { + "tinyspy": "^2.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/utils": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.0.4.tgz", + "integrity": "sha512-gsswWDXxtt0QvtK/y/LWukN7sGMYmnCcv1qv05CsY6cU/Y1zpGX1QuvLs+GO1inczpE6Owixeel3ShkjhYtGfA==", + "dev": true, + "dependencies": { + "diff-sequences": "^29.6.3", + "loupe": "^2.3.7", + "pretty-format": "^29.7.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/acorn": { + "version": "8.11.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", + "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/acorn-walk": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz", + "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cac": { + "version": "6.7.14", + "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", + "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/chai": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.4.1.tgz", + "integrity": "sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g==", + "dev": true, + "dependencies": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.3", + "deep-eql": "^4.1.3", + "get-func-name": "^2.0.2", + "loupe": "^2.3.6", + "pathval": "^1.1.1", + "type-detect": "^4.0.8" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/chalk/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/check-error": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", + "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", + "dev": true, + "dependencies": { + "get-func-name": "^2.0.2" + }, + "engines": { + "node": "*" + } + }, + "node_modules/chevrotain": { + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/chevrotain/-/chevrotain-11.0.3.tgz", + "integrity": "sha512-ci2iJH6LeIkvP9eJW6gpueU8cnZhv85ELY8w8WiFtNjMHA5ad6pQLaJo9mEly/9qUyCpvqX8/POVUTf18/HFdw==", + "dependencies": { + "@chevrotain/cst-dts-gen": "11.0.3", + "@chevrotain/gast": "11.0.3", + "@chevrotain/regexp-to-ast": "11.0.3", + "@chevrotain/types": "11.0.3", + "@chevrotain/utils": "11.0.3", + "lodash-es": "4.17.21" + } + }, + "node_modules/chevrotain-allstar": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/chevrotain-allstar/-/chevrotain-allstar-0.3.1.tgz", + "integrity": "sha512-b7g+y9A0v4mxCW1qUhf3BSVPg+/NvGErk/dOkrDaHA0nQIQGAtrOjlX//9OQtRlSCy+x9rfB5N8yC71lH1nvMw==", + "dependencies": { + "lodash-es": "^4.17.21" + }, + "peerDependencies": { + "chevrotain": "^11.0.0" + } + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/commander": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-11.0.0.tgz", + "integrity": "sha512-9HMlXtt/BNoYr8ooyjjNRdIilOTkVJXB+GhxMTtOKwk0R4j4lS4NpjuqmRxroBfnfTSHQIHQB7wryHhXarNjmQ==", + "dev": true, + "engines": { + "node": ">=16" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, + "node_modules/concurrently": { + "version": "8.2.2", + "resolved": "https://registry.npmjs.org/concurrently/-/concurrently-8.2.2.tgz", + "integrity": "sha512-1dP4gpXFhei8IOtlXRE/T/4H88ElHgTiUzh71YUmtjTEHMSRS2Z/fgOxHSxxusGHogsRfxNq1vyAwxSC+EVyDg==", + "dev": true, + "dependencies": { + "chalk": "^4.1.2", + "date-fns": "^2.30.0", + "lodash": "^4.17.21", + "rxjs": "^7.8.1", + "shell-quote": "^1.8.1", + "spawn-command": "0.0.2", + "supports-color": "^8.1.1", + "tree-kill": "^1.2.2", + "yargs": "^17.7.2" + }, + "bin": { + "conc": "dist/bin/concurrently.js", + "concurrently": "dist/bin/concurrently.js" + }, + "engines": { + "node": "^14.13.0 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/open-cli-tools/concurrently?sponsor=1" + } + }, + "node_modules/confbox": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.7.tgz", + "integrity": "sha512-uJcB/FKZtBMCJpK8MQji6bJHgu1tixKPxRLeGkNzBoOZzpnZUJm0jm2/sBDWcuBx1dYgxV4JU+g5hmNxCyAmdA==", + "dev": true + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/date-fns": { + "version": "2.30.0", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz", + "integrity": "sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==", + "dev": true, + "dependencies": { + "@babel/runtime": "^7.21.0" + }, + "engines": { + "node": ">=0.11" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/date-fns" + } + }, + "node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/deep-eql": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", + "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==", + "dev": true, + "dependencies": { + "type-detect": "^4.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, + "node_modules/diff-sequences": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", + "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", + "dev": true, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/esbuild": { + "version": "0.19.12", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.12.tgz", + "integrity": "sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.19.12", + "@esbuild/android-arm": "0.19.12", + "@esbuild/android-arm64": "0.19.12", + "@esbuild/android-x64": "0.19.12", + "@esbuild/darwin-arm64": "0.19.12", + "@esbuild/darwin-x64": "0.19.12", + "@esbuild/freebsd-arm64": "0.19.12", + "@esbuild/freebsd-x64": "0.19.12", + "@esbuild/linux-arm": "0.19.12", + "@esbuild/linux-arm64": "0.19.12", + "@esbuild/linux-ia32": "0.19.12", + "@esbuild/linux-loong64": "0.19.12", + "@esbuild/linux-mips64el": "0.19.12", + "@esbuild/linux-ppc64": "0.19.12", + "@esbuild/linux-riscv64": "0.19.12", + "@esbuild/linux-s390x": "0.19.12", + "@esbuild/linux-x64": "0.19.12", + "@esbuild/netbsd-x64": "0.19.12", + "@esbuild/openbsd-x64": "0.19.12", + "@esbuild/sunos-x64": "0.19.12", + "@esbuild/win32-arm64": "0.19.12", + "@esbuild/win32-ia32": "0.19.12", + "@esbuild/win32-x64": "0.19.12" + } + }, + "node_modules/escalade": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", + "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint": { + "version": "8.47.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.47.0.tgz", + "integrity": "sha512-spUQWrdPt+pRVP1TTJLmfRNJJHHZryFmptzcafwSvHsceV81djHOdnEeDmkdotZyLNjDhrOasNK8nikkoG1O8Q==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.2", + "@eslint/js": "^8.47.0", + "@humanwhocodes/config-array": "^0.11.10", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-scope": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/espree": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "dev": true, + "dependencies": { + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esquery": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", + "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", + "dev": true, + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/execa": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", + "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^8.0.1", + "human-signals": "^5.0.0", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^4.1.0", + "strip-final-newline": "^3.0.0" + }, + "engines": { + "node": ">=16.17" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "node_modules/fast-glob": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true + }, + "node_modules/fastq": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", + "dev": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", + "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", + "dev": true, + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.3", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/flatted": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", + "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", + "dev": true + }, + "node_modules/fs-extra": { + "version": "11.1.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.1.1.tgz", + "integrity": "sha512-MGIE4HOvQCeUCzmlHs0vXpih4ysz4wg9qiSAu6cd42lVwPbTM1TjV7RusoyQqMmk/95gdQZX72u+YW+c3eEpFQ==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=14.14" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-func-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", + "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/get-stream": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", + "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", + "dev": true, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/globals": { + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "dev": true, + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true + }, + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/human-signals": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", + "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", + "dev": true, + "engines": { + "node": ">=16.17.0" + } + }, + "node_modules/ignore": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", + "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true + }, + "node_modules/jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dev": true, + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/jsonschema": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsonschema/-/jsonschema-1.4.1.tgz", + "integrity": "sha512-S6cATIPVv1z0IlxdN+zUk5EPjkGCdnhN4wVSBlvoUO1tOLJootbo9CquNJmbIh4yikWHiUedhRYrNPn1arpEmQ==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/langium": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/langium/-/langium-3.0.0.tgz", + "integrity": "sha512-+Ez9EoiByeoTu/2BXmEaZ06iPNXM6thWJp02KfBO/raSMyCJ4jw7AkWWa+zBCTm0+Tw1Fj9FOxdqSskyN5nAwg==", + "dependencies": { + "chevrotain": "~11.0.3", + "chevrotain-allstar": "~0.3.0", + "vscode-languageserver": "~9.0.1", + "vscode-languageserver-textdocument": "~1.0.11", + "vscode-uri": "~3.0.8" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/langium-cli": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/langium-cli/-/langium-cli-3.0.3.tgz", + "integrity": "sha512-g6PdhEq5IiYWK/oiySILglPvFdK6ofQdzC+U7PJmFH++bDKu0DGdxjWzDauUN5WUDyVQETWKgtYDmmbcxPzN0w==", + "dev": true, + "dependencies": { + "chalk": "~5.3.0", + "commander": "~11.0.0", + "fs-extra": "~11.1.1", + "jsonschema": "~1.4.1", + "langium": "~3.0.0", + "langium-railroad": "~3.0.0", + "lodash": "~4.17.21" + }, + "bin": { + "langium": "bin/langium.js" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/langium-cli/node_modules/chalk": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", + "dev": true, + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/langium-railroad": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/langium-railroad/-/langium-railroad-3.0.0.tgz", + "integrity": "sha512-GQOnQBGl5gJqzgK/4bKvJO5QhJGNnprpYH6Fghbl4FviVLHwP6yzyqiouDelLSoCadChCr2JqKaBp5HXv7CgWw==", + "dev": true, + "dependencies": { + "langium": "~3.0.0", + "railroad-diagrams": "~1.0.0" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/local-pkg": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.5.0.tgz", + "integrity": "sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==", + "dev": true, + "dependencies": { + "mlly": "^1.4.2", + "pkg-types": "^1.0.3" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/lodash-es": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz", + "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==" + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, + "node_modules/loupe": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", + "integrity": "sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==", + "dev": true, + "dependencies": { + "get-func-name": "^2.0.1" + } + }, + "node_modules/magic-string": { + "version": "0.30.10", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.10.tgz", + "integrity": "sha512-iIRwTIf0QKV3UAnYK4PU8uiEc4SRh5jX0mwpIwETPpHdhVM4f53RSwS/vXvN1JhGX+Cs7B8qIq3d6AH49O5fAQ==", + "dev": true, + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.4.15" + } + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", + "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", + "dev": true, + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mimic-fn": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/mlly": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.7.0.tgz", + "integrity": "sha512-U9SDaXGEREBYQgfejV97coK0UL1r+qnF2SyO9A3qcI8MzKnsIFKHNVEkrDyNncQTKQQumsasmeq84eNMdBfsNQ==", + "dev": true, + "dependencies": { + "acorn": "^8.11.3", + "pathe": "^1.1.2", + "pkg-types": "^1.1.0", + "ufo": "^1.5.3" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/nanoid": { + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", + "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true + }, + "node_modules/npm-run-path": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", + "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", + "dev": true, + "dependencies": { + "path-key": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/npm-run-path/node_modules/path-key": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "dev": true, + "dependencies": { + "mimic-fn": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "dev": true, + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/pathe": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", + "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", + "dev": true + }, + "node_modules/pathval": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", + "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/picocolors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", + "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==", + "dev": true + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pkg-types": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.1.1.tgz", + "integrity": "sha512-ko14TjmDuQJ14zsotODv7dBlwxKhUKQEhuhmbqo1uCi9BB0Z2alo/wAXg6q1dTR5TyuqYyWhjtfe/Tsh+X28jQ==", + "dev": true, + "dependencies": { + "confbox": "^0.1.7", + "mlly": "^1.7.0", + "pathe": "^1.1.2" + } + }, + "node_modules/postcss": { + "version": "8.4.38", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.38.tgz", + "integrity": "sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "nanoid": "^3.3.7", + "picocolors": "^1.0.0", + "source-map-js": "^1.2.0" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "dev": true, + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/railroad-diagrams": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/railroad-diagrams/-/railroad-diagrams-1.0.0.tgz", + "integrity": "sha512-cz93DjNeLY0idrCNOH6PviZGRN9GJhsdm9hpn1YCS879fj4W+x5IFJhhkRZcwVgMmFF7R82UA/7Oh+R8lLZg6A==", + "dev": true + }, + "node_modules/react-is": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "dev": true + }, + "node_modules/regenerator-runtime": { + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", + "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==", + "dev": true + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rollup": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.18.0.tgz", + "integrity": "sha512-QmJz14PX3rzbJCN1SG4Xe/bAAX2a6NpCP8ab2vfu2GiUr8AQcr2nCV/oEO3yneFarB67zk8ShlIyWb2LGTb3Sg==", + "dev": true, + "dependencies": { + "@types/estree": "1.0.5" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.18.0", + "@rollup/rollup-android-arm64": "4.18.0", + "@rollup/rollup-darwin-arm64": "4.18.0", + "@rollup/rollup-darwin-x64": "4.18.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.18.0", + "@rollup/rollup-linux-arm-musleabihf": "4.18.0", + "@rollup/rollup-linux-arm64-gnu": "4.18.0", + "@rollup/rollup-linux-arm64-musl": "4.18.0", + "@rollup/rollup-linux-powerpc64le-gnu": "4.18.0", + "@rollup/rollup-linux-riscv64-gnu": "4.18.0", + "@rollup/rollup-linux-s390x-gnu": "4.18.0", + "@rollup/rollup-linux-x64-gnu": "4.18.0", + "@rollup/rollup-linux-x64-musl": "4.18.0", + "@rollup/rollup-win32-arm64-msvc": "4.18.0", + "@rollup/rollup-win32-ia32-msvc": "4.18.0", + "@rollup/rollup-win32-x64-msvc": "4.18.0", + "fsevents": "~2.3.2" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/rxjs": { + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", + "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==", + "dev": true, + "dependencies": { + "tslib": "^2.1.0" + } + }, + "node_modules/semver": { + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/shell-quote": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.1.tgz", + "integrity": "sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/siginfo": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", + "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", + "dev": true + }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/source-map-js": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz", + "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/spawn-command": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/spawn-command/-/spawn-command-0.0.2.tgz", + "integrity": "sha512-zC8zGoGkmc8J9ndvml8Xksr1Amk9qBujgbF0JAIWO7kXr43w0h/0GJNM/Vustixu+YE8N/MTrQ7N31FvHUACxQ==", + "dev": true + }, + "node_modules/stackback": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", + "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", + "dev": true + }, + "node_modules/std-env": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.7.0.tgz", + "integrity": "sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg==", + "dev": true + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/strip-literal": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-1.3.0.tgz", + "integrity": "sha512-PugKzOsyXpArk0yWmUwqOZecSO0GH0bPoctLcqNDH9J04pVW3lflYE0ujElBGTloevcxF5MofAOZ7C5l2b+wLg==", + "dev": true, + "dependencies": { + "acorn": "^8.10.0" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true + }, + "node_modules/tinybench": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.8.0.tgz", + "integrity": "sha512-1/eK7zUnIklz4JUUlL+658n58XO2hHLQfSk1Zf2LKieUjxidN16eKFEoDEfjHc3ohofSSqK3X5yO6VGb6iW8Lw==", + "dev": true + }, + "node_modules/tinypool": { + "version": "0.8.4", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.8.4.tgz", + "integrity": "sha512-i11VH5gS6IFeLY3gMBQ00/MmLncVP7JLXOw1vlgkytLmJK7QnEr7NXf0LBdxfmNPAeyetukOk0bOYrJrFGjYJQ==", + "dev": true, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/tinyspy": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.2.1.tgz", + "integrity": "sha512-KYad6Vy5VDWV4GH3fjpseMQ/XU2BhIYP7Vzd0LG44qRWm/Yt2WCOTicFdvmgo6gWaqooMQCawTtILVQJupKu7A==", + "dev": true, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/tree-kill": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", + "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", + "dev": true, + "bin": { + "tree-kill": "cli.js" + } + }, + "node_modules/ts-api-utils": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz", + "integrity": "sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==", + "dev": true, + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "typescript": ">=4.2.0" + } + }, + "node_modules/tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "dev": true + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typescript": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", + "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/ufo": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.5.3.tgz", + "integrity": "sha512-Y7HYmWaFwPUmkoQCUIAYpKqkOf+SbVj/2fJJZ4RJMCfZp0rTGwRbzQD+HghfnhKOjL9E01okqz+ncJskGYfBNw==", + "dev": true + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, + "node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "dev": true, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/vite": { + "version": "5.2.12", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.2.12.tgz", + "integrity": "sha512-/gC8GxzxMK5ntBwb48pR32GGhENnjtY30G4A0jemunsBkiEZFw60s8InGpN8gkhHEkjnRK1aSAxeQgwvFhUHAA==", + "dev": true, + "dependencies": { + "esbuild": "^0.20.1", + "postcss": "^8.4.38", + "rollup": "^4.13.0" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^18.0.0 || >=20.0.0", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.4.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + } + } + }, + "node_modules/vite-node": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.0.4.tgz", + "integrity": "sha512-9xQQtHdsz5Qn8hqbV7UKqkm8YkJhzT/zr41Dmt5N7AlD8hJXw/Z7y0QiD5I8lnTthV9Rvcvi0QW7PI0Fq83ZPg==", + "dev": true, + "dependencies": { + "cac": "^6.7.14", + "debug": "^4.3.4", + "pathe": "^1.1.1", + "picocolors": "^1.0.0", + "vite": "^5.0.0" + }, + "bin": { + "vite-node": "vite-node.mjs" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/vite/node_modules/@esbuild/aix-ppc64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.20.2.tgz", + "integrity": "sha512-D+EBOJHXdNZcLJRBkhENNG8Wji2kgc9AZ9KiPr1JuZjsNtyHzrsfLRrY0tk2H2aoFu6RANO1y1iPPUCDYWkb5g==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/android-arm": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.20.2.tgz", + "integrity": "sha512-t98Ra6pw2VaDhqNWO2Oph2LXbz/EJcnLmKLGBJwEwXX/JAN83Fym1rU8l0JUWK6HkIbWONCSSatf4sf2NBRx/w==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/android-arm64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.20.2.tgz", + "integrity": "sha512-mRzjLacRtl/tWU0SvD8lUEwb61yP9cqQo6noDZP/O8VkwafSYwZ4yWy24kan8jE/IMERpYncRt2dw438LP3Xmg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/android-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.20.2.tgz", + "integrity": "sha512-btzExgV+/lMGDDa194CcUQm53ncxzeBrWJcncOBxuC6ndBkKxnHdFJn86mCIgTELsooUmwUm9FkhSp5HYu00Rg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/darwin-arm64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.20.2.tgz", + "integrity": "sha512-4J6IRT+10J3aJH3l1yzEg9y3wkTDgDk7TSDFX+wKFiWjqWp/iCfLIYzGyasx9l0SAFPT1HwSCR+0w/h1ES/MjA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/darwin-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.20.2.tgz", + "integrity": "sha512-tBcXp9KNphnNH0dfhv8KYkZhjc+H3XBkF5DKtswJblV7KlT9EI2+jeA8DgBjp908WEuYll6pF+UStUCfEpdysA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/freebsd-arm64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.20.2.tgz", + "integrity": "sha512-d3qI41G4SuLiCGCFGUrKsSeTXyWG6yem1KcGZVS+3FYlYhtNoNgYrWcvkOoaqMhwXSMrZRl69ArHsGJ9mYdbbw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/freebsd-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.20.2.tgz", + "integrity": "sha512-d+DipyvHRuqEeM5zDivKV1KuXn9WeRX6vqSqIDgwIfPQtwMP4jaDsQsDncjTDDsExT4lR/91OLjRo8bmC1e+Cw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-arm": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.20.2.tgz", + "integrity": "sha512-VhLPeR8HTMPccbuWWcEUD1Az68TqaTYyj6nfE4QByZIQEQVWBB8vup8PpR7y1QHL3CpcF6xd5WVBU/+SBEvGTg==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-arm64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.20.2.tgz", + "integrity": "sha512-9pb6rBjGvTFNira2FLIWqDk/uaf42sSyLE8j1rnUpuzsODBq7FvpwHYZxQ/It/8b+QOS1RYfqgGFNLRI+qlq2A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-ia32": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.20.2.tgz", + "integrity": "sha512-o10utieEkNPFDZFQm9CoP7Tvb33UutoJqg3qKf1PWVeeJhJw0Q347PxMvBgVVFgouYLGIhFYG0UGdBumROyiig==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-loong64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.20.2.tgz", + "integrity": "sha512-PR7sp6R/UC4CFVomVINKJ80pMFlfDfMQMYynX7t1tNTeivQ6XdX5r2XovMmha/VjR1YN/HgHWsVcTRIMkymrgQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-mips64el": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.20.2.tgz", + "integrity": "sha512-4BlTqeutE/KnOiTG5Y6Sb/Hw6hsBOZapOVF6njAESHInhlQAghVVZL1ZpIctBOoTFbQyGW+LsVYZ8lSSB3wkjA==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-ppc64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.20.2.tgz", + "integrity": "sha512-rD3KsaDprDcfajSKdn25ooz5J5/fWBylaaXkuotBDGnMnDP1Uv5DLAN/45qfnf3JDYyJv/ytGHQaziHUdyzaAg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-riscv64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.20.2.tgz", + "integrity": "sha512-snwmBKacKmwTMmhLlz/3aH1Q9T8v45bKYGE3j26TsaOVtjIag4wLfWSiZykXzXuE1kbCE+zJRmwp+ZbIHinnVg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-s390x": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.20.2.tgz", + "integrity": "sha512-wcWISOobRWNm3cezm5HOZcYz1sKoHLd8VL1dl309DiixxVFoFe/o8HnwuIwn6sXre88Nwj+VwZUvJf4AFxkyrQ==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/linux-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.20.2.tgz", + "integrity": "sha512-1MdwI6OOTsfQfek8sLwgyjOXAu+wKhLEoaOLTjbijk6E2WONYpH9ZU2mNtR+lZ2B4uwr+usqGuVfFT9tMtGvGw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/netbsd-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.20.2.tgz", + "integrity": "sha512-K8/DhBxcVQkzYc43yJXDSyjlFeHQJBiowJ0uVL6Tor3jGQfSGHNNJcWxNbOI8v5k82prYqzPuwkzHt3J1T1iZQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/openbsd-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.20.2.tgz", + "integrity": "sha512-eMpKlV0SThJmmJgiVyN9jTPJ2VBPquf6Kt/nAoo6DgHAoN57K15ZghiHaMvqjCye/uU4X5u3YSMgVBI1h3vKrQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/sunos-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.20.2.tgz", + "integrity": "sha512-2UyFtRC6cXLyejf/YEld4Hajo7UHILetzE1vsRcGL3earZEW77JxrFjH4Ez2qaTiEfMgAXxfAZCm1fvM/G/o8w==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/win32-arm64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.20.2.tgz", + "integrity": "sha512-GRibxoawM9ZCnDxnP3usoUDO9vUkpAxIIZ6GQI+IlVmr5kP3zUq+l17xELTHMWTWzjxa2guPNyrpq1GWmPvcGQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/win32-ia32": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.20.2.tgz", + "integrity": "sha512-HfLOfn9YWmkSKRQqovpnITazdtquEW8/SoHW7pWpuEeguaZI4QnCRW6b+oZTztdBnZOS2hqJ6im/D5cPzBTTlQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/@esbuild/win32-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.20.2.tgz", + "integrity": "sha512-N49X4lJX27+l9jbLKSqZ6bKNjzQvHaT8IIFUy+YIqmXQdjYCToGWwOItDrfby14c78aDd5NHQl29xingXfCdLQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/vite/node_modules/esbuild": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.20.2.tgz", + "integrity": "sha512-WdOOppmUNU+IbZ0PaDiTst80zjnrOkyJNHoKupIcVyU8Lvla3Ugx94VzkQ32Ijqd7UhHJy75gNWDMUekcrSJ6g==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.20.2", + "@esbuild/android-arm": "0.20.2", + "@esbuild/android-arm64": "0.20.2", + "@esbuild/android-x64": "0.20.2", + "@esbuild/darwin-arm64": "0.20.2", + "@esbuild/darwin-x64": "0.20.2", + "@esbuild/freebsd-arm64": "0.20.2", + "@esbuild/freebsd-x64": "0.20.2", + "@esbuild/linux-arm": "0.20.2", + "@esbuild/linux-arm64": "0.20.2", + "@esbuild/linux-ia32": "0.20.2", + "@esbuild/linux-loong64": "0.20.2", + "@esbuild/linux-mips64el": "0.20.2", + "@esbuild/linux-ppc64": "0.20.2", + "@esbuild/linux-riscv64": "0.20.2", + "@esbuild/linux-s390x": "0.20.2", + "@esbuild/linux-x64": "0.20.2", + "@esbuild/netbsd-x64": "0.20.2", + "@esbuild/openbsd-x64": "0.20.2", + "@esbuild/sunos-x64": "0.20.2", + "@esbuild/win32-arm64": "0.20.2", + "@esbuild/win32-ia32": "0.20.2", + "@esbuild/win32-x64": "0.20.2" + } + }, + "node_modules/vitest": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.0.4.tgz", + "integrity": "sha512-s1GQHp/UOeWEo4+aXDOeFBJwFzL6mjycbQwwKWX2QcYfh/7tIerS59hWQ20mxzupTJluA2SdwiBuWwQHH67ckg==", + "dev": true, + "dependencies": { + "@vitest/expect": "1.0.4", + "@vitest/runner": "1.0.4", + "@vitest/snapshot": "1.0.4", + "@vitest/spy": "1.0.4", + "@vitest/utils": "1.0.4", + "acorn-walk": "^8.3.0", + "cac": "^6.7.14", + "chai": "^4.3.10", + "debug": "^4.3.4", + "execa": "^8.0.1", + "local-pkg": "^0.5.0", + "magic-string": "^0.30.5", + "pathe": "^1.1.1", + "picocolors": "^1.0.0", + "std-env": "^3.5.0", + "strip-literal": "^1.3.0", + "tinybench": "^2.5.1", + "tinypool": "^0.8.1", + "vite": "^5.0.0", + "vite-node": "1.0.4", + "why-is-node-running": "^2.2.2" + }, + "bin": { + "vitest": "vitest.mjs" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@edge-runtime/vm": "*", + "@types/node": "^18.0.0 || >=20.0.0", + "@vitest/browser": "^1.0.0", + "@vitest/ui": "^1.0.0", + "happy-dom": "*", + "jsdom": "*" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@types/node": { + "optional": true + }, + "@vitest/browser": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true + } + } + }, + "node_modules/vscode-jsonrpc": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.2.0.tgz", + "integrity": "sha512-C+r0eKJUIfiDIfwJhria30+TYWPtuHJXHtI7J0YlOmKAo7ogxP20T0zxB7HZQIFhIyvoBPwWskjxrvAtfjyZfA==", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/vscode-languageclient": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-9.0.1.tgz", + "integrity": "sha512-JZiimVdvimEuHh5olxhxkht09m3JzUGwggb5eRUkzzJhZ2KjCN0nh55VfiED9oez9DyF8/fz1g1iBV3h+0Z2EA==", + "dependencies": { + "minimatch": "^5.1.0", + "semver": "^7.3.7", + "vscode-languageserver-protocol": "3.17.5" + }, + "engines": { + "vscode": "^1.82.0" + } + }, + "node_modules/vscode-languageclient/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/vscode-languageclient/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/vscode-languageserver": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-9.0.1.tgz", + "integrity": "sha512-woByF3PDpkHFUreUa7Hos7+pUWdeWMXRd26+ZX2A8cFx6v/JPTtd4/uN0/jB6XQHYaOlHbio03NTHCqrgG5n7g==", + "dependencies": { + "vscode-languageserver-protocol": "3.17.5" + }, + "bin": { + "installServerIntoExtension": "bin/installServerIntoExtension" + } + }, + "node_modules/vscode-languageserver-protocol": { + "version": "3.17.5", + "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.5.tgz", + "integrity": "sha512-mb1bvRJN8SVznADSGWM9u/b07H7Ecg0I3OgXDuLdn307rl/J3A9YD6/eYOssqhecL27hK1IPZAsaqh00i/Jljg==", + "dependencies": { + "vscode-jsonrpc": "8.2.0", + "vscode-languageserver-types": "3.17.5" + } + }, + "node_modules/vscode-languageserver-textdocument": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.11.tgz", + "integrity": "sha512-X+8T3GoiwTVlJbicx/sIAF+yuJAqz8VvwJyoMVhwEMoEKE/fkDmrqUgDMyBECcM2A2frVZIUj5HI/ErRXCfOeA==" + }, + "node_modules/vscode-languageserver-types": { + "version": "3.17.5", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz", + "integrity": "sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg==" + }, + "node_modules/vscode-uri": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.0.8.tgz", + "integrity": "sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw==" + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/why-is-node-running": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.2.2.tgz", + "integrity": "sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==", + "dev": true, + "dependencies": { + "siginfo": "^2.0.0", + "stackback": "0.0.2" + }, + "bin": { + "why-is-node-running": "cli.js" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + } +} diff --git a/packages/langium-crmscript/package.json b/packages/langium-crmscript/package.json index 1fec1bf..de9c4f1 100644 --- a/packages/langium-crmscript/package.json +++ b/packages/langium-crmscript/package.json @@ -1,22 +1,80 @@ { - "name": "@superoffice/langium-crmscript", - "description": "Please enter a brief description here", - "version": "0.0.1", - "publisher": "SuperOffice", - "repository": { - "type": "git", - "url": "https://github.com/ejfasting/language-tools" - }, - "files": [ - "out", - "src" - ], - "type": "module", - "scripts": { - "build": "tsc -b tsconfig.json", - "watch": "tsc -b tsconfig.json --watch", - "lint": "eslint src --ext ts", - "langium:generate": "langium generate", - "langium:watch": "langium generate --watch" - } -} \ No newline at end of file + "name": "langium-crmscript", + "description": "Please enter a brief description here", + "version": "0.0.1", + "files": [ + "out", + "src" + ], + "type": "module", + "scripts": { + "build": "tsc -b tsconfig.src.json && node esbuild.mjs", + "watch": "concurrently -n tsc,esbuild -c blue,yellow \"tsc -b tsconfig.src.json --watch\" \"node esbuild.mjs --watch\"", + "lint": "eslint src --ext ts", + "langium:generate": "langium generate", + "langium:watch": "langium generate --watch", + "vscode:prepublish": "npm run build && npm run lint", + "test": "vitest run" + }, + "dependencies": { + "langium": "~3.0.0", + "vscode-languageclient": "~9.0.1", + "vscode-languageserver": "~9.0.1" + }, + "devDependencies": { + "@types/node": "^18.0.0", + "@typescript-eslint/parser": "~6.4.1", + "@typescript-eslint/eslint-plugin": "~6.4.1", + "eslint": "~8.47.0", + "langium-cli": "~3.0.0", + "typescript": "~5.1.6", + "@types/vscode": "~1.67.0", + "concurrently": "~8.2.1", + "esbuild": "~0.19.2", + "vitest": "~1.0.0" + }, + "displayName": "langium-crmscript", + "engines": { + "vscode": "^1.67.0" + }, + "categories": [ + "Programming Languages" + ], + "contributes": { + "languages": [ + { + "id": "crmscript-definition", + "aliases": [ + "crmscript Definition", + "crmscript-definition" + ], + "extensions": [".crmscript-definition"], + "configuration": "./language-configuration.json" + }, { + "id": "crmscript-implementation", + "aliases": [ + "crmscript Implementation", + "crmscript-implementation" + ], + "extensions": [".crmscript"], + "configuration": "./language-configuration.json" + } + ], + "grammars": [ + { + "language": "crmscript-definition", + "scopeName": "source.crmscript-definition", + "path": "./syntaxes/crmscript-definition.tmLanguage.json" + }, + { + "language": "crmscript-implementation", + "scopeName": "source.crmscript-implementation", + "path": "./syntaxes/crmscript-implementation.tmLanguage.json" + } + ] + }, + "activationEvents": [ + "onLanguage:crmscript" + ], + "main": "./out/extension/main.cjs" +} diff --git a/packages/langium-crmscript/src/backup.langium b/packages/langium-crmscript/src/backup.langium new file mode 100644 index 0000000..97a3d47 --- /dev/null +++ b/packages/langium-crmscript/src/backup.langium @@ -0,0 +1,189 @@ +grammar Crmscript + +entry CrmscriptProgram: + elements+=CrmscriptElement*; + +CrmscriptElement: + Class | + Struct ';' | + ExpressionBlock | + IfStatement | + WhileStatement | + ForStatement | + TryCatchStatement | + FunctionDeclaration | + VariableDeclaration ';' | + PrintStatement ';' | + ReturnStatement ';' | + Expression ';' +; + + +IfStatement: + 'if' '(' condition=Expression ')' block=ExpressionBlock + ('else' elseBlock=ExpressionBlock)? +; + +WhileStatement: + 'while' '(' condition=Expression ')' block=ExpressionBlock +; + +ForStatement: + 'for' '(' counter=VariableDeclaration? ';' condition=Expression ';' execution=Increment? ')' block=ExpressionBlock +; + +Increment: + var=ID '++' +; + +TryCatchStatement: + 'try' block=ExpressionBlock 'catch' '(' exception=ID ')' catchBlock=ExpressionBlock +; + +PrintStatement: 'print' '(' value=Expression ')' +; + +ReturnStatement: 'return' value=Expression? +; + +ExpressionBlock: '{' + elements+=CrmscriptElement* +'}' +; + +VariableDeclaration returns NamedElement: + {infer VariableDeclaration} type=TypeReference name=ID (assignment?='=' value=Expression)? +; + +Expression: + Assignment +; + +Assignment infers Expression: + Addition ({infer BinaryExpression.left=current} operator=('=') right=Addition)* +; + +Addition infers Expression: + Multiplication ({infer BinaryExpression.left=current} operator=('+' | '-') right=Multiplication)* +; + +Multiplication infers Expression: + Logical ({infer BinaryExpression.left=current} operator=('*' | '/') right=Logical)* +; + +Logical infers Expression: + Comparison ({infer BinaryExpression.left=current} operator=('and' | 'or') right=Comparison)* +; + +Comparison infers Expression: + MemberCall ({infer BinaryExpression.left=current} operator=('<' | '<=' | '>' | '>=' | '==' | '!=') right=MemberCall)* +; + +MemberCall infers Expression: + Primary + ({infer MemberCall.previous=current} + // Member call with function call + ("." element=[NamedElement:ID] ( + explicitOperationCall?='(' + ( + arguments+=Expression (',' arguments+=Expression)* + )? + ')')? + // Chained function call + | ( + explicitOperationCall?='(' + ( + arguments+=Expression (',' arguments+=Expression)* + )? + ')')) + )* +; + +Primary infers Expression: + '(' Expression ')' | + UnaryExpression | + StringExpression | + BooleanExpression | + IntegerExpression | + NilExpression | + FeatureCall +; + +FeatureCall infers Expression: + {infer MemberCall} + (element=[NamedElement:ID] | element=[NamedElement:'this'] | element=[NamedElement:'super']) + // Optional function call after referencing an element + (explicitOperationCall?='(' + ( + arguments+=Expression (',' arguments+=Expression)* + )? + ')')? +; + +UnaryExpression: + operator=('!' | '-' | '+') value=Expression +; + +IntegerExpression: value=NUMBER +; + +StringExpression: value=STRING +; + +BooleanExpression: value?='true' | 'false' +; + +NilExpression: value='nil' +; + +FunctionDeclaration: + returnType=TypeReference name=ID '(' (parameters+=Parameter (',' parameters+=Parameter)*)? ')' body=ExpressionBlock +; + +Parameter: type=TypeReference name=ID +; + +Struct: + 'struct' name=ID '{' + members+=StructMember* +'}' +; + +StructMember: MethodMember | FieldMember +; + +Class: 'class' name=ID '{' + members+=ClassMember* +'}' +; + +ClassMember: MethodMember | FieldMember +; + +MethodMember: + returnType=TypeReference name=ID '(' (parameters+=Parameter (',' parameters+=Parameter)*)? ')' body=ExpressionBlock +; + +FieldMember: + type=TypeReference name=ID ';' +; + +//TODO: Add primities for Float, Generic and DateTime(?) => https://docs.superoffice.com/en/automation/crmscript/fundamentals/variables.html +TypeReference: reference=[Class:ID] + | primitive=("String" | "Integer" | "Bool") + | '(' ( parameters+=LambdaParameter (',' parameters+=LambdaParameter)*)? ')' '=>' returnType=TypeReference +; + +LambdaParameter: (name=ID ':')? type=TypeReference +; + +type NamedElement = Parameter | FunctionDeclaration | VariableDeclaration | MethodMember | FieldMember | Class | Struct +; + +hidden terminal WS: /\s+/; +terminal ID: /[_a-zA-Z][\w_]*/; +terminal NUMBER returns number: /[0-9]+(\.[0-9]+)?/; +terminal STRING: /"[^"]*"/; + +hidden terminal ML_COMMENT: /\/\*[\s\S]*?\*\//; +hidden terminal SL_COMMENT: /\/\/[^\n\r]*/; \ No newline at end of file diff --git a/packages/langium-crmscript/src/extension/main.ts b/packages/langium-crmscript/src/extension/main.ts new file mode 100644 index 0000000..53951b4 --- /dev/null +++ b/packages/langium-crmscript/src/extension/main.ts @@ -0,0 +1,53 @@ +import type { LanguageClientOptions, ServerOptions} from 'vscode-languageclient/node.js'; +import type * as vscode from 'vscode'; +import * as path from 'node:path'; +import { LanguageClient, TransportKind } from 'vscode-languageclient/node.js'; + +let client: LanguageClient; + +// This function is called when the extension is activated. +export function activate(context: vscode.ExtensionContext): void { + client = startLanguageClient(context); +} + +// This function is called when the extension is deactivated. +export function deactivate(): Thenable | undefined { + if (client) { + return client.stop(); + } + return undefined; +} + +function startLanguageClient(context: vscode.ExtensionContext): LanguageClient { + const serverModule = context.asAbsolutePath(path.join('out', 'language', 'main.cjs')); + // The debug options for the server + // --inspect=6009: runs the server in Node's Inspector mode so VS Code can attach to the server for debugging. + // By setting `process.env.DEBUG_BREAK` to a truthy value, the language server will wait until a debugger is attached. + const debugOptions = { execArgv: ['--nolazy', `--inspect${process.env.DEBUG_BREAK ? '-brk' : ''}=${process.env.DEBUG_SOCKET || '6009'}`] }; + + // If the extension is launched in debug mode then the debug server options are used + // Otherwise the run options are used + const serverOptions: ServerOptions = { + run: { module: serverModule, transport: TransportKind.ipc }, + debug: { module: serverModule, transport: TransportKind.ipc, options: debugOptions } + }; + + // Options to control the language client + const clientOptions: LanguageClientOptions = { + documentSelector: [ + { scheme: 'file', language: 'crmscript-definition' }, + { scheme: 'file', language: 'crmscript-implementation' } + ]}; + + // Create the language client and start the client. + const client = new LanguageClient( + 'crmscript', + 'crmscript', + serverOptions, + clientOptions + ); + + // Start the client. This will also launch the server + client.start(); + return client; +} diff --git a/packages/langium-crmscript/src/language/builtin/builtin.ts b/packages/langium-crmscript/src/language/builtin/builtin.ts new file mode 100644 index 0000000..3977f44 --- /dev/null +++ b/packages/langium-crmscript/src/language/builtin/builtin.ts @@ -0,0 +1,6 @@ +export const builtin = ` +/** Balls*/ +class String { +} + +`; \ No newline at end of file diff --git a/packages/langium-crmscript/src/language/lib/workspaceManager.ts b/packages/langium-crmscript/src/language/builtin/workspaceManager.ts similarity index 83% rename from packages/langium-crmscript/src/language/lib/workspaceManager.ts rename to packages/langium-crmscript/src/language/builtin/workspaceManager.ts index d034f40..a513df5 100644 --- a/packages/langium-crmscript/src/language/lib/workspaceManager.ts +++ b/packages/langium-crmscript/src/language/builtin/workspaceManager.ts @@ -7,7 +7,7 @@ import { } from "langium"; import { WorkspaceFolder } from 'vscode-languageserver'; import { URI } from "vscode-uri"; -import { builtinCrmscript } from './builtinCrmscript.js'; +import { builtin } from './builtin.js'; export class CrmscriptWorkspaceManager extends DefaultWorkspaceManager { @@ -24,6 +24,6 @@ export class CrmscriptWorkspaceManager extends DefaultWorkspaceManager { ): Promise { await super.loadAdditionalDocuments(folders, collector); // Load our library using the `builtin` URI schema - collector(this.documentFactory.fromString(builtinCrmscript, URI.parse('builtin:///library.crmscript'))); + collector(this.documentFactory.fromString(builtin, URI.parse('builtin:///library.crmscript-definition'))); } } \ No newline at end of file diff --git a/packages/langium-crmscript/src/language/crmscript.langium b/packages/langium-crmscript/src/language/crmscript-definition.langium similarity index 61% rename from packages/langium-crmscript/src/language/crmscript.langium rename to packages/langium-crmscript/src/language/crmscript-definition.langium index 1c06821..8e0249a 100644 --- a/packages/langium-crmscript/src/language/crmscript.langium +++ b/packages/langium-crmscript/src/language/crmscript-definition.langium @@ -1,6 +1,6 @@ -grammar Crmscript +grammar CrmscriptDefinition -entry Model: +entry DefinitionUnit: elements+=Element*; Element: @@ -9,7 +9,6 @@ Element: IfStatement | WhileStatement | ForStatement | - TryCatchStatement | FunctionDeclaration | VariableDeclaration ';' | PrintStatement ';' | @@ -27,16 +26,9 @@ WhileStatement: ; ForStatement: - 'for' '(' counter=VariableDeclaration? ';' condition=Expression ';' increment=Increment? ')' block=ExpressionBlock + 'for' '(' counter=VariableDeclaration? ';' condition=Expression? ';' execution=Expression? ')' block=ExpressionBlock ; -TryCatchStatement: - 'try' block=ExpressionBlock 'catch' '(' exception=ID ')' catchBlock=ExpressionBlock -; - -Increment: - var=ID '++'; - PrintStatement: 'print' value=Expression; ReturnStatement: 'return' value=Expression?; @@ -46,7 +38,7 @@ ExpressionBlock: '{' '}'; VariableDeclaration returns NamedElement: - {infer VariableDeclaration} type=TypeReference name=ID (assignment?='=' value=Expression)? + {infer VariableDeclaration} type=[Class:ID] name=ID (assignment?='=' value=Expression)? ; Expression: @@ -69,21 +61,21 @@ Comparison infers Expression: MemberCall infers Expression: Primary - ({infer MemberCall.previous=current} + ({infer MemberCall.previous=current} // Member call with function call ("." element=[NamedElement:ID] ( - explicitOperationCall?='(' - ( - arguments+=Expression (',' arguments+=Expression)* - )? - ')')? + explicitOperationCall?='(' + ( + arguments+=Expression (',' arguments+=Expression)* + )? + ')')? // Chained function call | ( - explicitOperationCall?='(' - ( - arguments+=Expression (',' arguments+=Expression)* - )? - ')')) + explicitOperationCall?='(' + ( + arguments+=Expression (',' arguments+=Expression)* + )? + ')')) )*; Primary infers Expression: @@ -91,53 +83,48 @@ Primary infers Expression: UnaryExpression | StringExpression | BooleanExpression | - NumberExpression | + IntegerExpression | NilExpression | FeatureCall; FeatureCall infers Expression: - {infer MemberCall} - (element=[NamedElement:ID] | element=[NamedElement:'this'] | element=[NamedElement:'super']) + {infer MemberCall} + (element=[NamedElement:ID] | element=[NamedElement:'this'] | element=[NamedElement:'super']) // Optional function call after referencing an element (explicitOperationCall?='(' - ( - arguments+=Expression (',' arguments+=Expression)* - )? - ')')?; + ( + arguments+=Expression (',' arguments+=Expression)* + )? + ')')?; UnaryExpression: operator=('!' | '-' | '+') value=Expression ; -NumberExpression: value=NUMBER; +IntegerExpression: value=NUMBER; StringExpression: value=STRING; BooleanExpression: value?='true' | 'false'; NilExpression: value='nil'; FunctionDeclaration: - returnType=TypeReference name=ID '(' (parameters+=Parameter (',' parameters+=Parameter)*)? ')' body=ExpressionBlock; + 'fun' name=ID '(' (parameters+=Parameter (',' parameters+=Parameter)*)? ')' ':' returnType=[Class:ID] body=ExpressionBlock; -Parameter: name=ID ':' type=TypeReference; +Parameter: name=ID ':' type=[Class:ID]; -Class: 'class' name=ID '{' +Class returns NamedElement: + {infer Class} 'class' name=ID '{' members+=ClassMember* '}'; ClassMember: MethodMember | FieldMember; MethodMember: - name=ID '(' (parameters+=Parameter (',' parameters+=Parameter)*)? ')' ':' returnType=TypeReference body=ExpressionBlock; + name=ID '(' (parameters+=Parameter (',' parameters+=Parameter)*)? ')' ':' returnType=[Class:ID] body=ExpressionBlock; FieldMember: - type=TypeReference name=ID ';'; - -TypeReference: reference=[Class:ID] - | primitive=("String" | "Integer" | "Bool" | "DateTime") - | '(' ( parameters+=LambdaParameter (',' parameters+=LambdaParameter)*)? ')' '=>' returnType=TypeReference; - -LambdaParameter: (name=ID ':')? type=TypeReference; + type=[Class:ID] name=ID ';'; -type NamedElement = Parameter | FunctionDeclaration | VariableDeclaration | MethodMember | FieldMember | Class ; +type NamedElement = Parameter | FunctionDeclaration | VariableDeclaration | MethodMember | FieldMember | Class; hidden terminal WS: /\s+/; terminal ID: /[_a-zA-Z][\w_]*/; @@ -145,4 +132,4 @@ terminal NUMBER returns number: /[0-9]+(\.[0-9]+)?/; terminal STRING: /"[^"]*"/; hidden terminal ML_COMMENT: /\/\*[\s\S]*?\*\//; -hidden terminal SL_COMMENT: /\/\/[^\n\r]*/; +hidden terminal SL_COMMENT: /\/\/[^\n\r]*/; \ No newline at end of file diff --git a/packages/langium-crmscript/src/language/crmscript-implementation.langium b/packages/langium-crmscript/src/language/crmscript-implementation.langium new file mode 100644 index 0000000..b07efb7 --- /dev/null +++ b/packages/langium-crmscript/src/language/crmscript-implementation.langium @@ -0,0 +1,46 @@ +grammar CrmscriptImplementation + +import "crmscript-definition"; + +entry ImplementationUnit: + (elements+=CrmscriptElement)*; + +CrmscriptElement: + Builtin + // | IfStatement + // | WhileStatement + // | ForStatement + // | TryCatchStatement + // | FunctionDeclaration + | VariableDeclaration ';' + // | PrintStatement + // | Expression ';' +; + +Builtin: + class=([Class:ID]) name=ID; + +// IfStatement: +// 'if' '(' condition=Expression ')' block=ExpressionBlock +// ('else' elseBlock=ExpressionBlock)? +// ; + +// WhileStatement: +// 'while' '(' condition=Expression ')' block=ExpressionBlock +// ; + +// ForStatement: +// 'for' '(' counter=VariableDeclaration? ';' condition=Expression ';' execution=Increment? ')' block=ExpressionBlock +// ; + +// Increment: +// var=ID '++' +// ; + +// TryCatchStatement: +// 'try' block=ExpressionBlock 'catch' '(' exception=ID ')' catchBlock=ExpressionBlock +// ; + +// PrintStatement: +// 'print' '(' value=Expression ')' +// ; \ No newline at end of file diff --git a/packages/langium-crmscript/src/language/crmscript-module.ts b/packages/langium-crmscript/src/language/crmscript-module.ts index d2472e5..c545d52 100644 --- a/packages/langium-crmscript/src/language/crmscript-module.ts +++ b/packages/langium-crmscript/src/language/crmscript-module.ts @@ -1,41 +1,50 @@ import { type Module, inject, LangiumSharedCoreServices, DeepPartial } from 'langium'; import { createDefaultModule, createDefaultSharedModule, type DefaultSharedModuleContext, type LangiumServices, type LangiumSharedServices, type PartialLangiumServices } from 'langium/lsp'; -import { CrmscriptGeneratedModule, CrmscriptGeneratedSharedModule } from './generated/module.js'; +import { + CrmscriptDefinitionGeneratedModule, + CrmscriptImplementationGeneratedModule, + CrmscriptGeneratedSharedModule +} from './generated/module.js'; + import { CrmscriptValidator, registerValidationChecks } from './crmscript-validator.js'; -import { CrmscriptWorkspaceManager } from './lib/workspaceManager.js'; -import { CustomCompletionProvider } from './overrides/completionProvider.js'; +import { CrmscriptWorkspaceManager } from './builtin/workspaceManager.js'; +import { CrmscriptScopeProvider } from './crmscript-scope.js'; export type CrmscriptSharedServices = LangiumSharedServices; -export const crmscriptSharedModule: Module> = { +export const CrmscriptSharedModule: Module> = { workspace: { WorkspaceManager: (services: LangiumSharedCoreServices) => new CrmscriptWorkspaceManager(services) } }; + /** * Declaration of custom services - add your own service classes here. */ export type CrmscriptAddedServices = { validation: { - crmscriptValidator: CrmscriptValidator + CrmscriptValidator: CrmscriptValidator } -}; +} /** * Union of Langium default services and your custom services - use this as constructor parameter * of custom service classes. */ -export type CrmscriptServices = LangiumServices & CrmscriptAddedServices; +export type CrmscriptServices = LangiumServices & CrmscriptAddedServices /** * Dependency injection module that overrides Langium default services and contributes the * declared custom services. The Langium defaults can be partially specified to override only * selected services, while the custom services must be fully specified. */ -export const crmscriptModule: Module = { +export const CrmscriptModule: Module = { validation: { - crmscriptValidator: () => new CrmscriptValidator() + CrmscriptValidator: () => new CrmscriptValidator() + }, + references: { + ScopeProvider: (services) => new CrmscriptScopeProvider(services), } }; @@ -56,22 +65,27 @@ export const crmscriptModule: Module e.members); + return this.createScopeForNodes(allMembers); + } +} \ No newline at end of file diff --git a/packages/langium-crmscript/src/language/crmscript-validator.ts b/packages/langium-crmscript/src/language/crmscript-validator.ts index 7ec6f58..7d831a0 100644 --- a/packages/langium-crmscript/src/language/crmscript-validator.ts +++ b/packages/langium-crmscript/src/language/crmscript-validator.ts @@ -1,20 +1,25 @@ -import type { AstNode, ValidationAcceptor, ValidationChecks } from 'langium'; -import { BinaryExpression, NumberExpression, type CrmscriptAstType, type VariableDeclaration} from './generated/ast.js'; +import { AstNode, ValidationAcceptor, type ValidationChecks } from 'langium'; import type { CrmscriptServices } from './crmscript-module.js'; -import { inferType } from './type-system/infer.js'; -import { TypeDescription, typeToString } from './type-system/descriptions.js'; +import { BinaryExpression, Class, CrmscriptAstType, Expression, UnaryExpression, VariableDeclaration } from './generated/ast.js'; import { isAssignable } from './type-system/assignment.js'; +import { typeToString, TypeDescription } from './type-system/descriptions.js'; +import { inferType } from './type-system/infer.js'; import { isLegalOperation } from './type-system/operator.js'; + /** * Register custom validation checks. */ export function registerValidationChecks(services: CrmscriptServices) { const registry = services.validation.ValidationRegistry; - const validator = services.validation.crmscriptValidator; + const validator = services.validation.CrmscriptValidator; const checks: ValidationChecks = { - //BinaryExpression: validator.checkBinaryOperationAllowed, + BinaryExpression: validator.checkBinaryOperationAllowed, + UnaryExpression: validator.checkUnaryOperationAllowed, VariableDeclaration: validator.checkVariableDeclaration, - NumberExpression: validator.checkNumberExpression + //MethodMember: validator.checkMethodReturnType, + Class: validator.checkClassDeclaration, + //FunctionDeclaration: validator.checkFunctionReturnType, + Expression: validator.checkExpressionAllowed }; registry.register(checks, validator); } @@ -23,10 +28,54 @@ export function registerValidationChecks(services: CrmscriptServices) { * Implementation of custom validations. */ export class CrmscriptValidator { + checkExpressionAllowed(expression: Expression, accept: ValidationAcceptor): void { + // if(expression.$type === 'BinaryExpression'){ + // accept('error', 'Expressions are currently unsupported.', { + // node: expression + // }); + // } + } + + // checkFunctionReturnType(func: FunctionDeclaration, accept: ValidationAcceptor): void { + // this.checkFunctionReturnTypeInternal(func.body, func.returnType, accept); + // } + + // checkMethodReturnType(method: MethodMember, accept: ValidationAcceptor): void { + // this.checkFunctionReturnTypeInternal(method.body, method.returnType, accept); + // } + + // TODO: implement classes + checkClassDeclaration(declaration: Class, accept: ValidationAcceptor): void { + // accept('error', 'Classes are currently unsupported.', { + // node: declaration, + // property: 'name' + // }); + } + + // private checkFunctionReturnTypeInternal(body: ExpressionBlock, returnType: TypeReference, accept: ValidationAcceptor): void { + // const map = this.getTypeCache(); + // const returnStatements = AstUtils.streamAllContents(body).filter(isReturnStatement).toArray(); + // const expectedType = inferType(returnType, map); + // if (returnStatements.length === 0 && !isVoidType(expectedType)) { + // accept('error', "A function whose declared type is not 'void' must return a value.", { + // node: returnType + // }); + // return; + // } + // for (const returnStatement of returnStatements) { + // const returnValueType = inferType(returnStatement, map); + // if (!isAssignable(returnValueType, expectedType)) { + // accept('error', `Type '${typeToString(returnValueType)}' is not assignable to type '${typeToString(expectedType)}'.`, { + // node: returnStatement + // }); + // } + // } + // } + checkVariableDeclaration(decl: VariableDeclaration, accept: ValidationAcceptor): void { if (decl.type && decl.value) { const map = this.getTypeCache(); - const left = inferType(decl.type, map); + const left = inferType(decl.type.$nodeDescription?.node, map); const right = inferType(decl.value, map); if (!isAssignable(right, left)) { accept('error', `Type '${typeToString(right)}' is not assignable to type '${typeToString(left)}'.`, { @@ -34,7 +83,9 @@ export class CrmscriptValidator { property: 'value' }); } - } else if (!decl.type && !decl.value) { + } + //TODO: can probably just remove this, as all variables are strongly typed? + else if (!decl.type && !decl.value) { accept('error', 'Variables require a type hint or an assignment at creation', { node: decl, property: 'name' @@ -49,13 +100,13 @@ export class CrmscriptValidator { if (!isLegalOperation(binary.operator, left, right)) { accept('error', `Cannot perform operation '${binary.operator}' on values of type '${typeToString(left)}' and '${typeToString(right)}'.`, { node: binary - }); + }) } else if (binary.operator === '=') { if (!isAssignable(right, left)) { accept('error', `Type '${typeToString(right)}' is not assignable to type '${typeToString(left)}'.`, { node: binary, property: 'right' - }); + }) } } else if (['==', '!='].includes(binary.operator)) { if (!isAssignable(right, left)) { @@ -67,11 +118,15 @@ export class CrmscriptValidator { } } - checkNumberExpression(node: NumberExpression, accept: ValidationAcceptor): void { - if (typeof node.value !== 'number') { - accept('error', `Invalid number value`, { node }); + checkUnaryOperationAllowed(unary: UnaryExpression, accept: ValidationAcceptor): void { + const item = inferType(unary.value, this.getTypeCache()); + if (!isLegalOperation(unary.operator, item)) { + accept('error', `Cannot perform operation '${unary.operator}' on value of type '${typeToString(item)}'.`, { + node: unary + }); } } + private getTypeCache(): Map { return new Map(); } diff --git a/packages/langium-crmscript/src/language/generated/ast.ts b/packages/langium-crmscript/src/language/generated/ast.ts index 28a607d..37aca72 100644 --- a/packages/langium-crmscript/src/language/generated/ast.ts +++ b/packages/langium-crmscript/src/language/generated/ast.ts @@ -24,7 +24,15 @@ export function isClassMember(item: unknown): item is ClassMember { return reflection.isInstance(item, ClassMember); } -export type Element = Class | Expression | ExpressionBlock | ForStatement | FunctionDeclaration | IfStatement | NamedElement | PrintStatement | ReturnStatement | TryCatchStatement | WhileStatement; +export type CrmscriptElement = Builtin | NamedElement; + +export const CrmscriptElement = 'CrmscriptElement'; + +export function isCrmscriptElement(item: unknown): item is CrmscriptElement { + return reflection.isInstance(item, CrmscriptElement); +} + +export type Element = Expression | ExpressionBlock | ForStatement | FunctionDeclaration | IfStatement | NamedElement | PrintStatement | ReturnStatement | WhileStatement; export const Element = 'Element'; @@ -32,7 +40,7 @@ export function isElement(item: unknown): item is Element { return reflection.isInstance(item, Element); } -export type Expression = BinaryExpression | BooleanExpression | MemberCall | NilExpression | NumberExpression | StringExpression | UnaryExpression; +export type Expression = BinaryExpression | BooleanExpression | IntegerExpression | MemberCall | NilExpression | StringExpression | UnaryExpression; export const Expression = 'Expression'; @@ -49,7 +57,7 @@ export function isNamedElement(item: unknown): item is NamedElement { } export interface BinaryExpression extends AstNode { - readonly $container: BinaryExpression | ExpressionBlock | ForStatement | IfStatement | MemberCall | Model | PrintStatement | ReturnStatement | UnaryExpression | VariableDeclaration | WhileStatement; + readonly $container: BinaryExpression | DefinitionUnit | ExpressionBlock | ForStatement | IfStatement | MemberCall | PrintStatement | ReturnStatement | UnaryExpression | VariableDeclaration | WhileStatement; readonly $type: 'BinaryExpression'; left: Expression; operator: '!=' | '*' | '+' | '-' | '/' | '<' | '<=' | '=' | '==' | '>' | '>=' | 'and' | 'or'; @@ -63,7 +71,7 @@ export function isBinaryExpression(item: unknown): item is BinaryExpression { } export interface BooleanExpression extends AstNode { - readonly $container: BinaryExpression | ExpressionBlock | ForStatement | IfStatement | MemberCall | Model | PrintStatement | ReturnStatement | UnaryExpression | VariableDeclaration | WhileStatement; + readonly $container: BinaryExpression | DefinitionUnit | ExpressionBlock | ForStatement | IfStatement | MemberCall | PrintStatement | ReturnStatement | UnaryExpression | VariableDeclaration | WhileStatement; readonly $type: 'BooleanExpression'; value: boolean; } @@ -74,8 +82,21 @@ export function isBooleanExpression(item: unknown): item is BooleanExpression { return reflection.isInstance(item, BooleanExpression); } +export interface Builtin extends AstNode { + readonly $container: ImplementationUnit; + readonly $type: 'Builtin'; + class: Reference; + name: string; +} + +export const Builtin = 'Builtin'; + +export function isBuiltin(item: unknown): item is Builtin { + return reflection.isInstance(item, Builtin); +} + export interface Class extends AstNode { - readonly $container: ExpressionBlock | ForStatement | Model; + readonly $container: DefinitionUnit | ExpressionBlock | ForStatement | ImplementationUnit; readonly $type: 'Class'; members: Array; name: string; @@ -87,8 +108,19 @@ export function isClass(item: unknown): item is Class { return reflection.isInstance(item, Class); } +export interface DefinitionUnit extends AstNode { + readonly $type: 'DefinitionUnit'; + elements: Array; +} + +export const DefinitionUnit = 'DefinitionUnit'; + +export function isDefinitionUnit(item: unknown): item is DefinitionUnit { + return reflection.isInstance(item, DefinitionUnit); +} + export interface ExpressionBlock extends AstNode { - readonly $container: ExpressionBlock | ForStatement | FunctionDeclaration | IfStatement | MethodMember | Model | TryCatchStatement | WhileStatement; + readonly $container: DefinitionUnit | ExpressionBlock | ForStatement | FunctionDeclaration | IfStatement | MethodMember | WhileStatement; readonly $type: 'ExpressionBlock'; elements: Array; } @@ -100,10 +132,10 @@ export function isExpressionBlock(item: unknown): item is ExpressionBlock { } export interface FieldMember extends AstNode { - readonly $container: Class | ExpressionBlock | ForStatement | Model; + readonly $container: Class | DefinitionUnit | ExpressionBlock | ForStatement | ImplementationUnit; readonly $type: 'FieldMember'; name: string; - type: TypeReference; + type: Reference; } export const FieldMember = 'FieldMember'; @@ -113,12 +145,12 @@ export function isFieldMember(item: unknown): item is FieldMember { } export interface ForStatement extends AstNode { - readonly $container: ExpressionBlock | Model; + readonly $container: DefinitionUnit | ExpressionBlock; readonly $type: 'ForStatement'; block: ExpressionBlock; - condition: Expression; + condition?: Expression; counter?: NamedElement; - increment?: Increment; + execution?: Expression; } export const ForStatement = 'ForStatement'; @@ -128,12 +160,12 @@ export function isForStatement(item: unknown): item is ForStatement { } export interface FunctionDeclaration extends AstNode { - readonly $container: ExpressionBlock | ForStatement | Model; + readonly $container: DefinitionUnit | ExpressionBlock | ForStatement | ImplementationUnit; readonly $type: 'FunctionDeclaration'; body: ExpressionBlock; name: string; parameters: Array; - returnType: TypeReference; + returnType: Reference; } export const FunctionDeclaration = 'FunctionDeclaration'; @@ -143,7 +175,7 @@ export function isFunctionDeclaration(item: unknown): item is FunctionDeclaratio } export interface IfStatement extends AstNode { - readonly $container: ExpressionBlock | Model; + readonly $container: DefinitionUnit | ExpressionBlock; readonly $type: 'IfStatement'; block: ExpressionBlock; condition: Expression; @@ -156,33 +188,31 @@ export function isIfStatement(item: unknown): item is IfStatement { return reflection.isInstance(item, IfStatement); } -export interface Increment extends AstNode { - readonly $container: ForStatement; - readonly $type: 'Increment'; - var: string; +export interface ImplementationUnit extends AstNode { + readonly $type: 'ImplementationUnit'; + elements: Array; } -export const Increment = 'Increment'; +export const ImplementationUnit = 'ImplementationUnit'; -export function isIncrement(item: unknown): item is Increment { - return reflection.isInstance(item, Increment); +export function isImplementationUnit(item: unknown): item is ImplementationUnit { + return reflection.isInstance(item, ImplementationUnit); } -export interface LambdaParameter extends AstNode { - readonly $container: TypeReference; - readonly $type: 'LambdaParameter'; - name?: string; - type: TypeReference; +export interface IntegerExpression extends AstNode { + readonly $container: BinaryExpression | DefinitionUnit | ExpressionBlock | ForStatement | IfStatement | MemberCall | PrintStatement | ReturnStatement | UnaryExpression | VariableDeclaration | WhileStatement; + readonly $type: 'IntegerExpression'; + value: number; } -export const LambdaParameter = 'LambdaParameter'; +export const IntegerExpression = 'IntegerExpression'; -export function isLambdaParameter(item: unknown): item is LambdaParameter { - return reflection.isInstance(item, LambdaParameter); +export function isIntegerExpression(item: unknown): item is IntegerExpression { + return reflection.isInstance(item, IntegerExpression); } export interface MemberCall extends AstNode { - readonly $container: BinaryExpression | ExpressionBlock | ForStatement | IfStatement | MemberCall | Model | PrintStatement | ReturnStatement | UnaryExpression | VariableDeclaration | WhileStatement; + readonly $container: BinaryExpression | DefinitionUnit | ExpressionBlock | ForStatement | IfStatement | MemberCall | PrintStatement | ReturnStatement | UnaryExpression | VariableDeclaration | WhileStatement; readonly $type: 'MemberCall'; arguments: Array; element?: Reference; @@ -197,12 +227,12 @@ export function isMemberCall(item: unknown): item is MemberCall { } export interface MethodMember extends AstNode { - readonly $container: Class | ExpressionBlock | ForStatement | Model; + readonly $container: Class | DefinitionUnit | ExpressionBlock | ForStatement | ImplementationUnit; readonly $type: 'MethodMember'; body: ExpressionBlock; name: string; parameters: Array; - returnType: TypeReference; + returnType: Reference; } export const MethodMember = 'MethodMember'; @@ -211,19 +241,8 @@ export function isMethodMember(item: unknown): item is MethodMember { return reflection.isInstance(item, MethodMember); } -export interface Model extends AstNode { - readonly $type: 'Model'; - elements: Array; -} - -export const Model = 'Model'; - -export function isModel(item: unknown): item is Model { - return reflection.isInstance(item, Model); -} - export interface NilExpression extends AstNode { - readonly $container: BinaryExpression | ExpressionBlock | ForStatement | IfStatement | MemberCall | Model | PrintStatement | ReturnStatement | UnaryExpression | VariableDeclaration | WhileStatement; + readonly $container: BinaryExpression | DefinitionUnit | ExpressionBlock | ForStatement | IfStatement | MemberCall | PrintStatement | ReturnStatement | UnaryExpression | VariableDeclaration | WhileStatement; readonly $type: 'NilExpression'; value: 'nil'; } @@ -234,23 +253,11 @@ export function isNilExpression(item: unknown): item is NilExpression { return reflection.isInstance(item, NilExpression); } -export interface NumberExpression extends AstNode { - readonly $container: BinaryExpression | ExpressionBlock | ForStatement | IfStatement | MemberCall | Model | PrintStatement | ReturnStatement | UnaryExpression | VariableDeclaration | WhileStatement; - readonly $type: 'NumberExpression'; - value: number; -} - -export const NumberExpression = 'NumberExpression'; - -export function isNumberExpression(item: unknown): item is NumberExpression { - return reflection.isInstance(item, NumberExpression); -} - export interface Parameter extends AstNode { - readonly $container: ExpressionBlock | ForStatement | FunctionDeclaration | MethodMember | Model; + readonly $container: DefinitionUnit | ExpressionBlock | ForStatement | FunctionDeclaration | ImplementationUnit | MethodMember; readonly $type: 'Parameter'; name: string; - type: TypeReference; + type: Reference; } export const Parameter = 'Parameter'; @@ -260,7 +267,7 @@ export function isParameter(item: unknown): item is Parameter { } export interface PrintStatement extends AstNode { - readonly $container: ExpressionBlock | Model; + readonly $container: DefinitionUnit | ExpressionBlock; readonly $type: 'PrintStatement'; value: Expression; } @@ -272,7 +279,7 @@ export function isPrintStatement(item: unknown): item is PrintStatement { } export interface ReturnStatement extends AstNode { - readonly $container: ExpressionBlock | Model; + readonly $container: DefinitionUnit | ExpressionBlock; readonly $type: 'ReturnStatement'; value?: Expression; } @@ -284,7 +291,7 @@ export function isReturnStatement(item: unknown): item is ReturnStatement { } export interface StringExpression extends AstNode { - readonly $container: BinaryExpression | ExpressionBlock | ForStatement | IfStatement | MemberCall | Model | PrintStatement | ReturnStatement | UnaryExpression | VariableDeclaration | WhileStatement; + readonly $container: BinaryExpression | DefinitionUnit | ExpressionBlock | ForStatement | IfStatement | MemberCall | PrintStatement | ReturnStatement | UnaryExpression | VariableDeclaration | WhileStatement; readonly $type: 'StringExpression'; value: string; } @@ -295,37 +302,8 @@ export function isStringExpression(item: unknown): item is StringExpression { return reflection.isInstance(item, StringExpression); } -export interface TryCatchStatement extends AstNode { - readonly $container: ExpressionBlock | Model; - readonly $type: 'TryCatchStatement'; - block: ExpressionBlock; - catchBlock: ExpressionBlock; - exception: string; -} - -export const TryCatchStatement = 'TryCatchStatement'; - -export function isTryCatchStatement(item: unknown): item is TryCatchStatement { - return reflection.isInstance(item, TryCatchStatement); -} - -export interface TypeReference extends AstNode { - readonly $container: FieldMember | FunctionDeclaration | LambdaParameter | MethodMember | Parameter | TypeReference | VariableDeclaration; - readonly $type: 'TypeReference'; - parameters: Array; - primitive?: 'Bool' | 'DateTime' | 'Integer' | 'String'; - reference?: Reference; - returnType?: TypeReference; -} - -export const TypeReference = 'TypeReference'; - -export function isTypeReference(item: unknown): item is TypeReference { - return reflection.isInstance(item, TypeReference); -} - export interface UnaryExpression extends AstNode { - readonly $container: BinaryExpression | ExpressionBlock | ForStatement | IfStatement | MemberCall | Model | PrintStatement | ReturnStatement | UnaryExpression | VariableDeclaration | WhileStatement; + readonly $container: BinaryExpression | DefinitionUnit | ExpressionBlock | ForStatement | IfStatement | MemberCall | PrintStatement | ReturnStatement | UnaryExpression | VariableDeclaration | WhileStatement; readonly $type: 'UnaryExpression'; operator: '!' | '+' | '-'; value: Expression; @@ -338,11 +316,11 @@ export function isUnaryExpression(item: unknown): item is UnaryExpression { } export interface VariableDeclaration extends AstNode { - readonly $container: ExpressionBlock | ForStatement | Model; + readonly $container: DefinitionUnit | ExpressionBlock | ForStatement | ImplementationUnit; readonly $type: 'VariableDeclaration'; assignment: boolean; name: string; - type: TypeReference; + type: Reference; value?: Expression; } @@ -353,7 +331,7 @@ export function isVariableDeclaration(item: unknown): item is VariableDeclaratio } export interface WhileStatement extends AstNode { - readonly $container: ExpressionBlock | Model; + readonly $container: DefinitionUnit | ExpressionBlock; readonly $type: 'WhileStatement'; block: ExpressionBlock; condition: Expression; @@ -368,8 +346,11 @@ export function isWhileStatement(item: unknown): item is WhileStatement { export type CrmscriptAstType = { BinaryExpression: BinaryExpression BooleanExpression: BooleanExpression + Builtin: Builtin Class: Class ClassMember: ClassMember + CrmscriptElement: CrmscriptElement + DefinitionUnit: DefinitionUnit Element: Element Expression: Expression ExpressionBlock: ExpressionBlock @@ -377,20 +358,16 @@ export type CrmscriptAstType = { ForStatement: ForStatement FunctionDeclaration: FunctionDeclaration IfStatement: IfStatement - Increment: Increment - LambdaParameter: LambdaParameter + ImplementationUnit: ImplementationUnit + IntegerExpression: IntegerExpression MemberCall: MemberCall MethodMember: MethodMember - Model: Model NamedElement: NamedElement NilExpression: NilExpression - NumberExpression: NumberExpression Parameter: Parameter PrintStatement: PrintStatement ReturnStatement: ReturnStatement StringExpression: StringExpression - TryCatchStatement: TryCatchStatement - TypeReference: TypeReference UnaryExpression: UnaryExpression VariableDeclaration: VariableDeclaration WhileStatement: WhileStatement @@ -399,32 +376,34 @@ export type CrmscriptAstType = { export class CrmscriptAstReflection extends AbstractAstReflection { getAllTypes(): string[] { - return ['BinaryExpression', 'BooleanExpression', 'Class', 'ClassMember', 'Element', 'Expression', 'ExpressionBlock', 'FieldMember', 'ForStatement', 'FunctionDeclaration', 'IfStatement', 'Increment', 'LambdaParameter', 'MemberCall', 'MethodMember', 'Model', 'NamedElement', 'NilExpression', 'NumberExpression', 'Parameter', 'PrintStatement', 'ReturnStatement', 'StringExpression', 'TryCatchStatement', 'TypeReference', 'UnaryExpression', 'VariableDeclaration', 'WhileStatement']; + return ['BinaryExpression', 'BooleanExpression', 'Builtin', 'Class', 'ClassMember', 'CrmscriptElement', 'DefinitionUnit', 'Element', 'Expression', 'ExpressionBlock', 'FieldMember', 'ForStatement', 'FunctionDeclaration', 'IfStatement', 'ImplementationUnit', 'IntegerExpression', 'MemberCall', 'MethodMember', 'NamedElement', 'NilExpression', 'Parameter', 'PrintStatement', 'ReturnStatement', 'StringExpression', 'UnaryExpression', 'VariableDeclaration', 'WhileStatement']; } protected override computeIsSubtype(subtype: string, supertype: string): boolean { switch (subtype) { case BinaryExpression: case BooleanExpression: + case IntegerExpression: case MemberCall: case NilExpression: - case NumberExpression: case StringExpression: case UnaryExpression: { return this.isSubtype(Expression, supertype); } + case Builtin: { + return this.isSubtype(CrmscriptElement, supertype); + } case Class: - case FunctionDeclaration: { - return this.isSubtype(Element, supertype) || this.isSubtype(NamedElement, supertype); + case Parameter: + case VariableDeclaration: { + return this.isSubtype(NamedElement, supertype); } case Expression: case ExpressionBlock: case ForStatement: case IfStatement: - case NamedElement: case PrintStatement: case ReturnStatement: - case TryCatchStatement: case WhileStatement: { return this.isSubtype(Element, supertype); } @@ -432,9 +411,11 @@ export class CrmscriptAstReflection extends AbstractAstReflection { case MethodMember: { return this.isSubtype(ClassMember, supertype) || this.isSubtype(NamedElement, supertype); } - case Parameter: - case VariableDeclaration: { - return this.isSubtype(NamedElement, supertype); + case FunctionDeclaration: { + return this.isSubtype(Element, supertype) || this.isSubtype(NamedElement, supertype); + } + case NamedElement: { + return this.isSubtype(CrmscriptElement, supertype) || this.isSubtype(Element, supertype); } default: { return false; @@ -445,12 +426,17 @@ export class CrmscriptAstReflection extends AbstractAstReflection { getReferenceType(refInfo: ReferenceInfo): string { const referenceId = `${refInfo.container.$type}:${refInfo.property}`; switch (referenceId) { + case 'Builtin:class': + case 'FieldMember:type': + case 'FunctionDeclaration:returnType': + case 'MethodMember:returnType': + case 'Parameter:type': + case 'VariableDeclaration:type': { + return Class; + } case 'MemberCall:element': { return NamedElement; } - case 'TypeReference:reference': { - return Class; - } default: { throw new Error(`${referenceId} is not a valid reference id.`); } @@ -477,6 +463,15 @@ export class CrmscriptAstReflection extends AbstractAstReflection { ] }; } + case 'Builtin': { + return { + name: 'Builtin', + properties: [ + { name: 'class' }, + { name: 'name' } + ] + }; + } case 'Class': { return { name: 'Class', @@ -486,6 +481,14 @@ export class CrmscriptAstReflection extends AbstractAstReflection { ] }; } + case 'DefinitionUnit': { + return { + name: 'DefinitionUnit', + properties: [ + { name: 'elements', defaultValue: [] } + ] + }; + } case 'ExpressionBlock': { return { name: 'ExpressionBlock', @@ -510,7 +513,7 @@ export class CrmscriptAstReflection extends AbstractAstReflection { { name: 'block' }, { name: 'condition' }, { name: 'counter' }, - { name: 'increment' } + { name: 'execution' } ] }; } @@ -535,20 +538,19 @@ export class CrmscriptAstReflection extends AbstractAstReflection { ] }; } - case 'Increment': { + case 'ImplementationUnit': { return { - name: 'Increment', + name: 'ImplementationUnit', properties: [ - { name: 'var' } + { name: 'elements', defaultValue: [] } ] }; } - case 'LambdaParameter': { + case 'IntegerExpression': { return { - name: 'LambdaParameter', + name: 'IntegerExpression', properties: [ - { name: 'name' }, - { name: 'type' } + { name: 'value' } ] }; } @@ -574,14 +576,6 @@ export class CrmscriptAstReflection extends AbstractAstReflection { ] }; } - case 'Model': { - return { - name: 'Model', - properties: [ - { name: 'elements', defaultValue: [] } - ] - }; - } case 'NilExpression': { return { name: 'NilExpression', @@ -590,14 +584,6 @@ export class CrmscriptAstReflection extends AbstractAstReflection { ] }; } - case 'NumberExpression': { - return { - name: 'NumberExpression', - properties: [ - { name: 'value' } - ] - }; - } case 'Parameter': { return { name: 'Parameter', @@ -631,27 +617,6 @@ export class CrmscriptAstReflection extends AbstractAstReflection { ] }; } - case 'TryCatchStatement': { - return { - name: 'TryCatchStatement', - properties: [ - { name: 'block' }, - { name: 'catchBlock' }, - { name: 'exception' } - ] - }; - } - case 'TypeReference': { - return { - name: 'TypeReference', - properties: [ - { name: 'parameters', defaultValue: [] }, - { name: 'primitive' }, - { name: 'reference' }, - { name: 'returnType' } - ] - }; - } case 'UnaryExpression': { return { name: 'UnaryExpression', diff --git a/packages/langium-crmscript/src/language/generated/grammar.ts b/packages/langium-crmscript/src/language/generated/grammar.ts index 7e1663d..46e01b3 100644 --- a/packages/langium-crmscript/src/language/generated/grammar.ts +++ b/packages/langium-crmscript/src/language/generated/grammar.ts @@ -6,15 +6,15 @@ import type { Grammar } from 'langium'; import { loadGrammarFromJson } from 'langium'; -let loadedCrmscriptGrammar: Grammar | undefined; -export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loadedCrmscriptGrammar = loadGrammarFromJson(`{ +let loadedCrmscriptDefinitionGrammar: Grammar | undefined; +export const CrmscriptDefinitionGrammar = (): Grammar => loadedCrmscriptDefinitionGrammar ?? (loadedCrmscriptDefinitionGrammar = loadGrammarFromJson(`{ "$type": "Grammar", "isDeclared": true, - "name": "Crmscript", + "name": "CrmscriptDefinition", "rules": [ { "$type": "ParserRule", - "name": "Model", + "name": "DefinitionUnit", "entry": true, "definition": { "$type": "Assignment", @@ -44,14 +44,14 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded { "$type": "RuleCall", "rule": { - "$ref": "#/rules@27" + "$ref": "#/rules@25" }, "arguments": [] }, { "$type": "RuleCall", "rule": { - "$ref": "#/rules@9" + "$ref": "#/rules@7" }, "arguments": [] }, @@ -79,14 +79,7 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded { "$type": "RuleCall", "rule": { - "$ref": "#/rules@5" - }, - "arguments": [] - }, - { - "$type": "RuleCall", - "rule": { - "$ref": "#/rules@25" + "$ref": "#/rules@23" }, "arguments": [] }, @@ -96,7 +89,7 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded { "$type": "RuleCall", "rule": { - "$ref": "#/rules@10" + "$ref": "#/rules@8" }, "arguments": [] }, @@ -112,7 +105,7 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded { "$type": "RuleCall", "rule": { - "$ref": "#/rules@7" + "$ref": "#/rules@5" }, "arguments": [] }, @@ -128,7 +121,7 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded { "$type": "RuleCall", "rule": { - "$ref": "#/rules@8" + "$ref": "#/rules@6" }, "arguments": [] }, @@ -144,7 +137,7 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded { "$type": "RuleCall", "rule": { - "$ref": "#/rules@11" + "$ref": "#/rules@9" }, "arguments": [] }, @@ -184,7 +177,7 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded "terminal": { "$type": "RuleCall", "rule": { - "$ref": "#/rules@11" + "$ref": "#/rules@9" }, "arguments": [] } @@ -200,7 +193,7 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded "terminal": { "$type": "RuleCall", "rule": { - "$ref": "#/rules@9" + "$ref": "#/rules@7" }, "arguments": [] } @@ -219,7 +212,7 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded "terminal": { "$type": "RuleCall", "rule": { - "$ref": "#/rules@9" + "$ref": "#/rules@7" }, "arguments": [] } @@ -257,7 +250,7 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded "terminal": { "$type": "RuleCall", "rule": { - "$ref": "#/rules@11" + "$ref": "#/rules@9" }, "arguments": [] } @@ -273,7 +266,7 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded "terminal": { "$type": "RuleCall", "rule": { - "$ref": "#/rules@9" + "$ref": "#/rules@7" }, "arguments": [] } @@ -308,7 +301,7 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded "terminal": { "$type": "RuleCall", "rule": { - "$ref": "#/rules@10" + "$ref": "#/rules@8" }, "arguments": [] }, @@ -325,10 +318,11 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded "terminal": { "$type": "RuleCall", "rule": { - "$ref": "#/rules@11" + "$ref": "#/rules@9" }, "arguments": [] - } + }, + "cardinality": "?" }, { "$type": "Keyword", @@ -336,12 +330,12 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded }, { "$type": "Assignment", - "feature": "increment", + "feature": "execution", "operator": "=", "terminal": { "$type": "RuleCall", "rule": { - "$ref": "#/rules@6" + "$ref": "#/rules@9" }, "arguments": [] }, @@ -358,108 +352,10 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded "terminal": { "$type": "RuleCall", "rule": { - "$ref": "#/rules@9" - }, - "arguments": [] - } - } - ] - }, - "definesHiddenTokens": false, - "entry": false, - "fragment": false, - "hiddenTokens": [], - "parameters": [], - "wildcard": false - }, - { - "$type": "ParserRule", - "name": "TryCatchStatement", - "definition": { - "$type": "Group", - "elements": [ - { - "$type": "Keyword", - "value": "try" - }, - { - "$type": "Assignment", - "feature": "block", - "operator": "=", - "terminal": { - "$type": "RuleCall", - "rule": { - "$ref": "#/rules@9" - }, - "arguments": [] - } - }, - { - "$type": "Keyword", - "value": "catch" - }, - { - "$type": "Keyword", - "value": "(" - }, - { - "$type": "Assignment", - "feature": "exception", - "operator": "=", - "terminal": { - "$type": "RuleCall", - "rule": { - "$ref": "#/rules@34" - }, - "arguments": [] - } - }, - { - "$type": "Keyword", - "value": ")" - }, - { - "$type": "Assignment", - "feature": "catchBlock", - "operator": "=", - "terminal": { - "$type": "RuleCall", - "rule": { - "$ref": "#/rules@9" - }, - "arguments": [] - } - } - ] - }, - "definesHiddenTokens": false, - "entry": false, - "fragment": false, - "hiddenTokens": [], - "parameters": [], - "wildcard": false - }, - { - "$type": "ParserRule", - "name": "Increment", - "definition": { - "$type": "Group", - "elements": [ - { - "$type": "Assignment", - "feature": "var", - "operator": "=", - "terminal": { - "$type": "RuleCall", - "rule": { - "$ref": "#/rules@34" + "$ref": "#/rules@7" }, "arguments": [] } - }, - { - "$type": "Keyword", - "value": "++" } ] }, @@ -487,7 +383,7 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded "terminal": { "$type": "RuleCall", "rule": { - "$ref": "#/rules@11" + "$ref": "#/rules@9" }, "arguments": [] } @@ -518,7 +414,7 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded "terminal": { "$type": "RuleCall", "rule": { - "$ref": "#/rules@11" + "$ref": "#/rules@9" }, "arguments": [] }, @@ -590,11 +486,18 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded "feature": "type", "operator": "=", "terminal": { - "$type": "RuleCall", - "rule": { - "$ref": "#/rules@31" + "$type": "CrossReference", + "type": { + "$ref": "#/rules@25/definition/elements@0/inferredType" }, - "arguments": [] + "terminal": { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@30" + }, + "arguments": [] + }, + "deprecatedSyntax": false } }, { @@ -604,7 +507,7 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded "terminal": { "$type": "RuleCall", "rule": { - "$ref": "#/rules@34" + "$ref": "#/rules@30" }, "arguments": [] } @@ -628,7 +531,7 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded "terminal": { "$type": "RuleCall", "rule": { - "$ref": "#/rules@11" + "$ref": "#/rules@9" }, "arguments": [] } @@ -651,7 +554,7 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded "definition": { "$type": "RuleCall", "rule": { - "$ref": "#/rules@12" + "$ref": "#/rules@10" }, "arguments": [] }, @@ -675,7 +578,7 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded { "$type": "RuleCall", "rule": { - "$ref": "#/rules@13" + "$ref": "#/rules@11" }, "arguments": [] }, @@ -707,7 +610,7 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded "terminal": { "$type": "RuleCall", "rule": { - "$ref": "#/rules@13" + "$ref": "#/rules@11" }, "arguments": [] } @@ -737,7 +640,7 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded { "$type": "RuleCall", "rule": { - "$ref": "#/rules@14" + "$ref": "#/rules@12" }, "arguments": [] }, @@ -778,7 +681,7 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded "terminal": { "$type": "RuleCall", "rule": { - "$ref": "#/rules@14" + "$ref": "#/rules@12" }, "arguments": [] } @@ -808,7 +711,7 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded { "$type": "RuleCall", "rule": { - "$ref": "#/rules@15" + "$ref": "#/rules@13" }, "arguments": [] }, @@ -849,7 +752,7 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded "terminal": { "$type": "RuleCall", "rule": { - "$ref": "#/rules@15" + "$ref": "#/rules@13" }, "arguments": [] } @@ -879,7 +782,7 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded { "$type": "RuleCall", "rule": { - "$ref": "#/rules@16" + "$ref": "#/rules@14" }, "arguments": [] }, @@ -920,7 +823,7 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded "terminal": { "$type": "RuleCall", "rule": { - "$ref": "#/rules@16" + "$ref": "#/rules@14" }, "arguments": [] } @@ -950,7 +853,7 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded { "$type": "RuleCall", "rule": { - "$ref": "#/rules@17" + "$ref": "#/rules@15" }, "arguments": [] }, @@ -1007,7 +910,7 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded "terminal": { "$type": "RuleCall", "rule": { - "$ref": "#/rules@17" + "$ref": "#/rules@15" }, "arguments": [] } @@ -1037,7 +940,7 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded { "$type": "RuleCall", "rule": { - "$ref": "#/rules@18" + "$ref": "#/rules@16" }, "arguments": [] }, @@ -1075,7 +978,7 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded "terminal": { "$type": "RuleCall", "rule": { - "$ref": "#/rules@34" + "$ref": "#/rules@30" }, "arguments": [] }, @@ -1104,7 +1007,7 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded "terminal": { "$type": "RuleCall", "rule": { - "$ref": "#/rules@11" + "$ref": "#/rules@9" }, "arguments": [] } @@ -1123,7 +1026,7 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded "terminal": { "$type": "RuleCall", "rule": { - "$ref": "#/rules@11" + "$ref": "#/rules@9" }, "arguments": [] } @@ -1165,7 +1068,7 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded "terminal": { "$type": "RuleCall", "rule": { - "$ref": "#/rules@11" + "$ref": "#/rules@9" }, "arguments": [] } @@ -1184,7 +1087,7 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded "terminal": { "$type": "RuleCall", "rule": { - "$ref": "#/rules@11" + "$ref": "#/rules@9" }, "arguments": [] } @@ -1235,7 +1138,7 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded { "$type": "RuleCall", "rule": { - "$ref": "#/rules@11" + "$ref": "#/rules@9" }, "arguments": [] }, @@ -1248,42 +1151,42 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded { "$type": "RuleCall", "rule": { - "$ref": "#/rules@20" + "$ref": "#/rules@18" }, "arguments": [] }, { "$type": "RuleCall", "rule": { - "$ref": "#/rules@22" + "$ref": "#/rules@20" }, "arguments": [] }, { "$type": "RuleCall", "rule": { - "$ref": "#/rules@23" + "$ref": "#/rules@21" }, "arguments": [] }, { "$type": "RuleCall", "rule": { - "$ref": "#/rules@21" + "$ref": "#/rules@19" }, "arguments": [] }, { "$type": "RuleCall", "rule": { - "$ref": "#/rules@24" + "$ref": "#/rules@22" }, "arguments": [] }, { "$type": "RuleCall", "rule": { - "$ref": "#/rules@19" + "$ref": "#/rules@17" }, "arguments": [] } @@ -1328,7 +1231,7 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded "terminal": { "$type": "RuleCall", "rule": { - "$ref": "#/rules@34" + "$ref": "#/rules@30" }, "arguments": [] }, @@ -1391,7 +1294,7 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded "terminal": { "$type": "RuleCall", "rule": { - "$ref": "#/rules@11" + "$ref": "#/rules@9" }, "arguments": [] } @@ -1410,7 +1313,7 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded "terminal": { "$type": "RuleCall", "rule": { - "$ref": "#/rules@11" + "$ref": "#/rules@9" }, "arguments": [] } @@ -1472,7 +1375,7 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded "terminal": { "$type": "RuleCall", "rule": { - "$ref": "#/rules@11" + "$ref": "#/rules@9" }, "arguments": [] } @@ -1488,7 +1391,7 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded }, { "$type": "ParserRule", - "name": "NumberExpression", + "name": "IntegerExpression", "definition": { "$type": "Assignment", "feature": "value", @@ -1496,7 +1399,7 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded "terminal": { "$type": "RuleCall", "rule": { - "$ref": "#/rules@35" + "$ref": "#/rules@31" }, "arguments": [] } @@ -1518,7 +1421,7 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded "terminal": { "$type": "RuleCall", "rule": { - "$ref": "#/rules@36" + "$ref": "#/rules@32" }, "arguments": [] } @@ -1584,16 +1487,8 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded "$type": "Group", "elements": [ { - "$type": "Assignment", - "feature": "returnType", - "operator": "=", - "terminal": { - "$type": "RuleCall", - "rule": { - "$ref": "#/rules@31" - }, - "arguments": [] - } + "$type": "Keyword", + "value": "fun" }, { "$type": "Assignment", @@ -1602,7 +1497,7 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded "terminal": { "$type": "RuleCall", "rule": { - "$ref": "#/rules@34" + "$ref": "#/rules@30" }, "arguments": [] } @@ -1621,7 +1516,7 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded "terminal": { "$type": "RuleCall", "rule": { - "$ref": "#/rules@26" + "$ref": "#/rules@24" }, "arguments": [] } @@ -1640,7 +1535,7 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded "terminal": { "$type": "RuleCall", "rule": { - "$ref": "#/rules@26" + "$ref": "#/rules@24" }, "arguments": [] } @@ -1655,6 +1550,29 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded "$type": "Keyword", "value": ")" }, + { + "$type": "Keyword", + "value": ":" + }, + { + "$type": "Assignment", + "feature": "returnType", + "operator": "=", + "terminal": { + "$type": "CrossReference", + "type": { + "$ref": "#/rules@25/definition/elements@0/inferredType" + }, + "terminal": { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@30" + }, + "arguments": [] + }, + "deprecatedSyntax": false + } + }, { "$type": "Assignment", "feature": "body", @@ -1662,7 +1580,7 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded "terminal": { "$type": "RuleCall", "rule": { - "$ref": "#/rules@9" + "$ref": "#/rules@7" }, "arguments": [] } @@ -1689,7 +1607,7 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded "terminal": { "$type": "RuleCall", "rule": { - "$ref": "#/rules@34" + "$ref": "#/rules@30" }, "arguments": [] } @@ -1703,11 +1621,18 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded "feature": "type", "operator": "=", "terminal": { - "$type": "RuleCall", - "rule": { - "$ref": "#/rules@31" + "$type": "CrossReference", + "type": { + "$ref": "#/rules@25/definition/elements@0/inferredType" }, - "arguments": [] + "terminal": { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@30" + }, + "arguments": [] + }, + "deprecatedSyntax": false } } ] @@ -1722,9 +1647,19 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded { "$type": "ParserRule", "name": "Class", + "returnType": { + "$ref": "#/types@0" + }, "definition": { "$type": "Group", "elements": [ + { + "$type": "Action", + "inferredType": { + "$type": "InferredType", + "name": "Class" + } + }, { "$type": "Keyword", "value": "class" @@ -1736,7 +1671,7 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded "terminal": { "$type": "RuleCall", "rule": { - "$ref": "#/rules@34" + "$ref": "#/rules@30" }, "arguments": [] } @@ -1752,7 +1687,7 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded "terminal": { "$type": "RuleCall", "rule": { - "$ref": "#/rules@28" + "$ref": "#/rules@26" }, "arguments": [] }, @@ -1780,14 +1715,14 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded { "$type": "RuleCall", "rule": { - "$ref": "#/rules@29" + "$ref": "#/rules@27" }, "arguments": [] }, { "$type": "RuleCall", "rule": { - "$ref": "#/rules@30" + "$ref": "#/rules@28" }, "arguments": [] } @@ -1813,7 +1748,7 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded "terminal": { "$type": "RuleCall", "rule": { - "$ref": "#/rules@34" + "$ref": "#/rules@30" }, "arguments": [] } @@ -1832,7 +1767,7 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded "terminal": { "$type": "RuleCall", "rule": { - "$ref": "#/rules@26" + "$ref": "#/rules@24" }, "arguments": [] } @@ -1851,7 +1786,7 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded "terminal": { "$type": "RuleCall", "rule": { - "$ref": "#/rules@26" + "$ref": "#/rules@24" }, "arguments": [] } @@ -1875,11 +1810,18 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded "feature": "returnType", "operator": "=", "terminal": { - "$type": "RuleCall", - "rule": { - "$ref": "#/rules@31" + "$type": "CrossReference", + "type": { + "$ref": "#/rules@25/definition/elements@0/inferredType" }, - "arguments": [] + "terminal": { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@30" + }, + "arguments": [] + }, + "deprecatedSyntax": false } }, { @@ -1889,7 +1831,7 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded "terminal": { "$type": "RuleCall", "rule": { - "$ref": "#/rules@9" + "$ref": "#/rules@7" }, "arguments": [] } @@ -1914,11 +1856,18 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded "feature": "type", "operator": "=", "terminal": { - "$type": "RuleCall", - "rule": { - "$ref": "#/rules@31" + "$type": "CrossReference", + "type": { + "$ref": "#/rules@25/definition/elements@0/inferredType" }, - "arguments": [] + "terminal": { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@30" + }, + "arguments": [] + }, + "deprecatedSyntax": false } }, { @@ -1928,7 +1877,7 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded "terminal": { "$type": "RuleCall", "rule": { - "$ref": "#/rules@34" + "$ref": "#/rules@30" }, "arguments": [] } @@ -1947,66 +1896,2005 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded "wildcard": false }, { - "$type": "ParserRule", - "name": "TypeReference", + "$type": "TerminalRule", + "hidden": true, + "name": "WS", "definition": { - "$type": "Alternatives", - "elements": [ + "$type": "RegexToken", + "regex": "/\\\\s+/" + }, + "fragment": false + }, + { + "$type": "TerminalRule", + "name": "ID", + "definition": { + "$type": "RegexToken", + "regex": "/[_a-zA-Z][\\\\w_]*/" + }, + "fragment": false, + "hidden": false + }, + { + "$type": "TerminalRule", + "name": "NUMBER", + "type": { + "$type": "ReturnType", + "name": "number" + }, + "definition": { + "$type": "RegexToken", + "regex": "/[0-9]+(\\\\.[0-9]+)?/" + }, + "fragment": false, + "hidden": false + }, + { + "$type": "TerminalRule", + "name": "STRING", + "definition": { + "$type": "RegexToken", + "regex": "/\\"[^\\"]*\\"/" + }, + "fragment": false, + "hidden": false + }, + { + "$type": "TerminalRule", + "hidden": true, + "name": "ML_COMMENT", + "definition": { + "$type": "RegexToken", + "regex": "/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//" + }, + "fragment": false + }, + { + "$type": "TerminalRule", + "hidden": true, + "name": "SL_COMMENT", + "definition": { + "$type": "RegexToken", + "regex": "/\\\\/\\\\/[^\\\\n\\\\r]*/" + }, + "fragment": false + } + ], + "types": [ + { + "$type": "Type", + "name": "NamedElement", + "type": { + "$type": "UnionType", + "types": [ + { + "$type": "SimpleType", + "typeRef": { + "$ref": "#/rules@24" + } + }, + { + "$type": "SimpleType", + "typeRef": { + "$ref": "#/rules@23" + } + }, + { + "$type": "SimpleType", + "typeRef": { + "$ref": "#/rules@8/definition/elements@0/inferredType" + } + }, + { + "$type": "SimpleType", + "typeRef": { + "$ref": "#/rules@27" + } + }, + { + "$type": "SimpleType", + "typeRef": { + "$ref": "#/rules@28" + } + }, + { + "$type": "SimpleType", + "typeRef": { + "$ref": "#/rules@25/definition/elements@0/inferredType" + } + } + ] + } + } + ], + "definesHiddenTokens": false, + "hiddenTokens": [], + "imports": [], + "interfaces": [], + "usedGrammars": [] +}`)); + +let loadedCrmscriptImplementationGrammar: Grammar | undefined; +export const CrmscriptImplementationGrammar = (): Grammar => loadedCrmscriptImplementationGrammar ?? (loadedCrmscriptImplementationGrammar = loadGrammarFromJson(`{ + "$type": "Grammar", + "isDeclared": true, + "name": "CrmscriptImplementation", + "imports": [], + "rules": [ + { + "$type": "ParserRule", + "name": "ImplementationUnit", + "entry": true, + "definition": { + "$type": "Assignment", + "feature": "elements", + "operator": "+=", + "terminal": { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@1" + }, + "arguments": [] + }, + "cardinality": "*" + }, + "definesHiddenTokens": false, + "fragment": false, + "hiddenTokens": [], + "parameters": [], + "wildcard": false + }, + { + "$type": "ParserRule", + "name": "CrmscriptElement", + "definition": { + "$type": "Alternatives", + "elements": [ + { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@2" + }, + "arguments": [] + }, + { + "$type": "Group", + "elements": [ + { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@11" + }, + "arguments": [] + }, + { + "$type": "Keyword", + "value": ";" + } + ] + } + ] + }, + "definesHiddenTokens": false, + "entry": false, + "fragment": false, + "hiddenTokens": [], + "parameters": [], + "wildcard": false + }, + { + "$type": "ParserRule", + "name": "Builtin", + "definition": { + "$type": "Group", + "elements": [ + { + "$type": "Assignment", + "feature": "class", + "operator": "=", + "terminal": { + "$type": "CrossReference", + "type": { + "$ref": "#/rules@28/definition/elements@0/inferredType" + }, + "terminal": { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@33" + }, + "arguments": [] + }, + "deprecatedSyntax": false + } + }, + { + "$type": "Assignment", + "feature": "name", + "operator": "=", + "terminal": { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@33" + }, + "arguments": [] + } + } + ] + }, + "definesHiddenTokens": false, + "entry": false, + "fragment": false, + "hiddenTokens": [], + "parameters": [], + "wildcard": false + }, + { + "$type": "ParserRule", + "name": "DefinitionUnit", + "entry": false, + "definition": { + "$type": "Assignment", + "feature": "elements", + "operator": "+=", + "terminal": { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@4" + }, + "arguments": [] + }, + "cardinality": "*" + }, + "definesHiddenTokens": false, + "fragment": false, + "hiddenTokens": [], + "parameters": [], + "wildcard": false + }, + { + "$type": "ParserRule", + "name": "Element", + "definition": { + "$type": "Alternatives", + "elements": [ + { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@28" + }, + "arguments": [] + }, + { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@10" + }, + "arguments": [] + }, + { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@5" + }, + "arguments": [] + }, + { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@6" + }, + "arguments": [] + }, + { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@7" + }, + "arguments": [] + }, + { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@26" + }, + "arguments": [] + }, + { + "$type": "Group", + "elements": [ + { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@11" + }, + "arguments": [] + }, + { + "$type": "Keyword", + "value": ";" + } + ] + }, + { + "$type": "Group", + "elements": [ + { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@8" + }, + "arguments": [] + }, + { + "$type": "Keyword", + "value": ";" + } + ] + }, + { + "$type": "Group", + "elements": [ + { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@9" + }, + "arguments": [] + }, + { + "$type": "Keyword", + "value": ";" + } + ] + }, + { + "$type": "Group", + "elements": [ + { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@12" + }, + "arguments": [] + }, + { + "$type": "Keyword", + "value": ";" + } + ] + } + ] + }, + "definesHiddenTokens": false, + "entry": false, + "fragment": false, + "hiddenTokens": [], + "parameters": [], + "wildcard": false + }, + { + "$type": "ParserRule", + "name": "IfStatement", + "definition": { + "$type": "Group", + "elements": [ + { + "$type": "Keyword", + "value": "if" + }, + { + "$type": "Keyword", + "value": "(" + }, + { + "$type": "Assignment", + "feature": "condition", + "operator": "=", + "terminal": { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@12" + }, + "arguments": [] + } + }, + { + "$type": "Keyword", + "value": ")" + }, + { + "$type": "Assignment", + "feature": "block", + "operator": "=", + "terminal": { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@10" + }, + "arguments": [] + } + }, + { + "$type": "Group", + "elements": [ + { + "$type": "Keyword", + "value": "else" + }, + { + "$type": "Assignment", + "feature": "elseBlock", + "operator": "=", + "terminal": { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@10" + }, + "arguments": [] + } + } + ], + "cardinality": "?" + } + ] + }, + "definesHiddenTokens": false, + "entry": false, + "fragment": false, + "hiddenTokens": [], + "parameters": [], + "wildcard": false + }, + { + "$type": "ParserRule", + "name": "WhileStatement", + "definition": { + "$type": "Group", + "elements": [ + { + "$type": "Keyword", + "value": "while" + }, + { + "$type": "Keyword", + "value": "(" + }, + { + "$type": "Assignment", + "feature": "condition", + "operator": "=", + "terminal": { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@12" + }, + "arguments": [] + } + }, + { + "$type": "Keyword", + "value": ")" + }, + { + "$type": "Assignment", + "feature": "block", + "operator": "=", + "terminal": { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@10" + }, + "arguments": [] + } + } + ] + }, + "definesHiddenTokens": false, + "entry": false, + "fragment": false, + "hiddenTokens": [], + "parameters": [], + "wildcard": false + }, + { + "$type": "ParserRule", + "name": "ForStatement", + "definition": { + "$type": "Group", + "elements": [ + { + "$type": "Keyword", + "value": "for" + }, + { + "$type": "Keyword", + "value": "(" + }, + { + "$type": "Assignment", + "feature": "counter", + "operator": "=", + "terminal": { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@11" + }, + "arguments": [] + }, + "cardinality": "?" + }, + { + "$type": "Keyword", + "value": ";" + }, + { + "$type": "Assignment", + "feature": "condition", + "operator": "=", + "terminal": { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@12" + }, + "arguments": [] + }, + "cardinality": "?" + }, + { + "$type": "Keyword", + "value": ";" + }, + { + "$type": "Assignment", + "feature": "execution", + "operator": "=", + "terminal": { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@12" + }, + "arguments": [] + }, + "cardinality": "?" + }, + { + "$type": "Keyword", + "value": ")" + }, + { + "$type": "Assignment", + "feature": "block", + "operator": "=", + "terminal": { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@10" + }, + "arguments": [] + } + } + ] + }, + "definesHiddenTokens": false, + "entry": false, + "fragment": false, + "hiddenTokens": [], + "parameters": [], + "wildcard": false + }, + { + "$type": "ParserRule", + "name": "PrintStatement", + "definition": { + "$type": "Group", + "elements": [ + { + "$type": "Keyword", + "value": "print" + }, + { + "$type": "Assignment", + "feature": "value", + "operator": "=", + "terminal": { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@12" + }, + "arguments": [] + } + } + ] + }, + "definesHiddenTokens": false, + "entry": false, + "fragment": false, + "hiddenTokens": [], + "parameters": [], + "wildcard": false + }, + { + "$type": "ParserRule", + "name": "ReturnStatement", + "definition": { + "$type": "Group", + "elements": [ + { + "$type": "Keyword", + "value": "return" + }, + { + "$type": "Assignment", + "feature": "value", + "operator": "=", + "terminal": { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@12" + }, + "arguments": [] + }, + "cardinality": "?" + } + ] + }, + "definesHiddenTokens": false, + "entry": false, + "fragment": false, + "hiddenTokens": [], + "parameters": [], + "wildcard": false + }, + { + "$type": "ParserRule", + "name": "ExpressionBlock", + "definition": { + "$type": "Group", + "elements": [ + { + "$type": "Keyword", + "value": "{" + }, + { + "$type": "Assignment", + "feature": "elements", + "operator": "+=", + "terminal": { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@4" + }, + "arguments": [] + }, + "cardinality": "*" + }, + { + "$type": "Keyword", + "value": "}" + } + ] + }, + "definesHiddenTokens": false, + "entry": false, + "fragment": false, + "hiddenTokens": [], + "parameters": [], + "wildcard": false + }, + { + "$type": "ParserRule", + "name": "VariableDeclaration", + "returnType": { + "$ref": "#/types@0" + }, + "definition": { + "$type": "Group", + "elements": [ + { + "$type": "Action", + "inferredType": { + "$type": "InferredType", + "name": "VariableDeclaration" + } + }, + { + "$type": "Assignment", + "feature": "type", + "operator": "=", + "terminal": { + "$type": "CrossReference", + "type": { + "$ref": "#/rules@28/definition/elements@0/inferredType" + }, + "terminal": { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@33" + }, + "arguments": [] + }, + "deprecatedSyntax": false + } + }, + { + "$type": "Assignment", + "feature": "name", + "operator": "=", + "terminal": { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@33" + }, + "arguments": [] + } + }, + { + "$type": "Group", + "elements": [ + { + "$type": "Assignment", + "feature": "assignment", + "operator": "?=", + "terminal": { + "$type": "Keyword", + "value": "=" + } + }, + { + "$type": "Assignment", + "feature": "value", + "operator": "=", + "terminal": { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@12" + }, + "arguments": [] + } + } + ], + "cardinality": "?" + } + ] + }, + "definesHiddenTokens": false, + "entry": false, + "fragment": false, + "hiddenTokens": [], + "parameters": [], + "wildcard": false + }, + { + "$type": "ParserRule", + "name": "Expression", + "definition": { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@13" + }, + "arguments": [] + }, + "definesHiddenTokens": false, + "entry": false, + "fragment": false, + "hiddenTokens": [], + "parameters": [], + "wildcard": false + }, + { + "$type": "ParserRule", + "name": "Assignment", + "inferredType": { + "$type": "InferredType", + "name": "Expression" + }, + "definition": { + "$type": "Group", + "elements": [ + { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@14" + }, + "arguments": [] + }, + { + "$type": "Group", + "elements": [ + { + "$type": "Action", + "inferredType": { + "$type": "InferredType", + "name": "BinaryExpression" + }, + "feature": "left", + "operator": "=" + }, + { + "$type": "Assignment", + "feature": "operator", + "operator": "=", + "terminal": { + "$type": "Keyword", + "value": "=" + } + }, + { + "$type": "Assignment", + "feature": "right", + "operator": "=", + "terminal": { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@14" + }, + "arguments": [] + } + } + ], + "cardinality": "*" + } + ] + }, + "definesHiddenTokens": false, + "entry": false, + "fragment": false, + "hiddenTokens": [], + "parameters": [], + "wildcard": false + }, + { + "$type": "ParserRule", + "name": "Addition", + "inferredType": { + "$type": "InferredType", + "name": "Expression" + }, + "definition": { + "$type": "Group", + "elements": [ + { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@15" + }, + "arguments": [] + }, + { + "$type": "Group", + "elements": [ + { + "$type": "Action", + "inferredType": { + "$type": "InferredType", + "name": "BinaryExpression" + }, + "feature": "left", + "operator": "=" + }, + { + "$type": "Assignment", + "feature": "operator", + "operator": "=", + "terminal": { + "$type": "Alternatives", + "elements": [ + { + "$type": "Keyword", + "value": "+" + }, + { + "$type": "Keyword", + "value": "-" + } + ] + } + }, + { + "$type": "Assignment", + "feature": "right", + "operator": "=", + "terminal": { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@15" + }, + "arguments": [] + } + } + ], + "cardinality": "*" + } + ] + }, + "definesHiddenTokens": false, + "entry": false, + "fragment": false, + "hiddenTokens": [], + "parameters": [], + "wildcard": false + }, + { + "$type": "ParserRule", + "name": "Multiplication", + "inferredType": { + "$type": "InferredType", + "name": "Expression" + }, + "definition": { + "$type": "Group", + "elements": [ + { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@16" + }, + "arguments": [] + }, + { + "$type": "Group", + "elements": [ + { + "$type": "Action", + "inferredType": { + "$type": "InferredType", + "name": "BinaryExpression" + }, + "feature": "left", + "operator": "=" + }, + { + "$type": "Assignment", + "feature": "operator", + "operator": "=", + "terminal": { + "$type": "Alternatives", + "elements": [ + { + "$type": "Keyword", + "value": "*" + }, + { + "$type": "Keyword", + "value": "/" + } + ] + } + }, + { + "$type": "Assignment", + "feature": "right", + "operator": "=", + "terminal": { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@16" + }, + "arguments": [] + } + } + ], + "cardinality": "*" + } + ] + }, + "definesHiddenTokens": false, + "entry": false, + "fragment": false, + "hiddenTokens": [], + "parameters": [], + "wildcard": false + }, + { + "$type": "ParserRule", + "name": "Logical", + "inferredType": { + "$type": "InferredType", + "name": "Expression" + }, + "definition": { + "$type": "Group", + "elements": [ + { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@17" + }, + "arguments": [] + }, + { + "$type": "Group", + "elements": [ + { + "$type": "Action", + "inferredType": { + "$type": "InferredType", + "name": "BinaryExpression" + }, + "feature": "left", + "operator": "=" + }, + { + "$type": "Assignment", + "feature": "operator", + "operator": "=", + "terminal": { + "$type": "Alternatives", + "elements": [ + { + "$type": "Keyword", + "value": "and" + }, + { + "$type": "Keyword", + "value": "or" + } + ] + } + }, + { + "$type": "Assignment", + "feature": "right", + "operator": "=", + "terminal": { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@17" + }, + "arguments": [] + } + } + ], + "cardinality": "*" + } + ] + }, + "definesHiddenTokens": false, + "entry": false, + "fragment": false, + "hiddenTokens": [], + "parameters": [], + "wildcard": false + }, + { + "$type": "ParserRule", + "name": "Comparison", + "inferredType": { + "$type": "InferredType", + "name": "Expression" + }, + "definition": { + "$type": "Group", + "elements": [ + { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@18" + }, + "arguments": [] + }, + { + "$type": "Group", + "elements": [ + { + "$type": "Action", + "inferredType": { + "$type": "InferredType", + "name": "BinaryExpression" + }, + "feature": "left", + "operator": "=" + }, + { + "$type": "Assignment", + "feature": "operator", + "operator": "=", + "terminal": { + "$type": "Alternatives", + "elements": [ + { + "$type": "Keyword", + "value": "<" + }, + { + "$type": "Keyword", + "value": "<=" + }, + { + "$type": "Keyword", + "value": ">" + }, + { + "$type": "Keyword", + "value": ">=" + }, + { + "$type": "Keyword", + "value": "==" + }, + { + "$type": "Keyword", + "value": "!=" + } + ] + } + }, + { + "$type": "Assignment", + "feature": "right", + "operator": "=", + "terminal": { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@18" + }, + "arguments": [] + } + } + ], + "cardinality": "*" + } + ] + }, + "definesHiddenTokens": false, + "entry": false, + "fragment": false, + "hiddenTokens": [], + "parameters": [], + "wildcard": false + }, + { + "$type": "ParserRule", + "name": "MemberCall", + "inferredType": { + "$type": "InferredType", + "name": "Expression" + }, + "definition": { + "$type": "Group", + "elements": [ + { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@19" + }, + "arguments": [] + }, + { + "$type": "Group", + "elements": [ + { + "$type": "Action", + "inferredType": { + "$type": "InferredType", + "name": "MemberCall" + }, + "feature": "previous", + "operator": "=" + }, + { + "$type": "Alternatives", + "elements": [ + { + "$type": "Group", + "elements": [ + { + "$type": "Keyword", + "value": "." + }, + { + "$type": "Assignment", + "feature": "element", + "operator": "=", + "terminal": { + "$type": "CrossReference", + "type": { + "$ref": "#/types@0" + }, + "terminal": { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@33" + }, + "arguments": [] + }, + "deprecatedSyntax": false + } + }, + { + "$type": "Group", + "elements": [ + { + "$type": "Assignment", + "feature": "explicitOperationCall", + "operator": "?=", + "terminal": { + "$type": "Keyword", + "value": "(" + } + }, + { + "$type": "Group", + "elements": [ + { + "$type": "Assignment", + "feature": "arguments", + "operator": "+=", + "terminal": { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@12" + }, + "arguments": [] + } + }, + { + "$type": "Group", + "elements": [ + { + "$type": "Keyword", + "value": "," + }, + { + "$type": "Assignment", + "feature": "arguments", + "operator": "+=", + "terminal": { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@12" + }, + "arguments": [] + } + } + ], + "cardinality": "*" + } + ], + "cardinality": "?" + }, + { + "$type": "Keyword", + "value": ")" + } + ], + "cardinality": "?" + } + ] + }, + { + "$type": "Group", + "elements": [ + { + "$type": "Assignment", + "feature": "explicitOperationCall", + "operator": "?=", + "terminal": { + "$type": "Keyword", + "value": "(" + } + }, + { + "$type": "Group", + "elements": [ + { + "$type": "Assignment", + "feature": "arguments", + "operator": "+=", + "terminal": { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@12" + }, + "arguments": [] + } + }, + { + "$type": "Group", + "elements": [ + { + "$type": "Keyword", + "value": "," + }, + { + "$type": "Assignment", + "feature": "arguments", + "operator": "+=", + "terminal": { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@12" + }, + "arguments": [] + } + } + ], + "cardinality": "*" + } + ], + "cardinality": "?" + }, + { + "$type": "Keyword", + "value": ")" + } + ] + } + ] + } + ], + "cardinality": "*" + } + ] + }, + "definesHiddenTokens": false, + "entry": false, + "fragment": false, + "hiddenTokens": [], + "parameters": [], + "wildcard": false + }, + { + "$type": "ParserRule", + "name": "Primary", + "inferredType": { + "$type": "InferredType", + "name": "Expression" + }, + "definition": { + "$type": "Alternatives", + "elements": [ + { + "$type": "Group", + "elements": [ + { + "$type": "Keyword", + "value": "(" + }, + { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@12" + }, + "arguments": [] + }, + { + "$type": "Keyword", + "value": ")" + } + ] + }, + { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@21" + }, + "arguments": [] + }, + { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@23" + }, + "arguments": [] + }, + { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@24" + }, + "arguments": [] + }, + { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@22" + }, + "arguments": [] + }, + { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@25" + }, + "arguments": [] + }, + { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@20" + }, + "arguments": [] + } + ] + }, + "definesHiddenTokens": false, + "entry": false, + "fragment": false, + "hiddenTokens": [], + "parameters": [], + "wildcard": false + }, + { + "$type": "ParserRule", + "name": "FeatureCall", + "inferredType": { + "$type": "InferredType", + "name": "Expression" + }, + "definition": { + "$type": "Group", + "elements": [ + { + "$type": "Action", + "inferredType": { + "$type": "InferredType", + "name": "MemberCall" + } + }, + { + "$type": "Alternatives", + "elements": [ + { + "$type": "Assignment", + "feature": "element", + "operator": "=", + "terminal": { + "$type": "CrossReference", + "type": { + "$ref": "#/types@0" + }, + "terminal": { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@33" + }, + "arguments": [] + }, + "deprecatedSyntax": false + } + }, + { + "$type": "Assignment", + "feature": "element", + "operator": "=", + "terminal": { + "$type": "CrossReference", + "type": { + "$ref": "#/types@0" + }, + "terminal": { + "$type": "Keyword", + "value": "this" + }, + "deprecatedSyntax": false + } + }, + { + "$type": "Assignment", + "feature": "element", + "operator": "=", + "terminal": { + "$type": "CrossReference", + "type": { + "$ref": "#/types@0" + }, + "terminal": { + "$type": "Keyword", + "value": "super" + }, + "deprecatedSyntax": false + } + } + ] + }, + { + "$type": "Group", + "elements": [ + { + "$type": "Assignment", + "feature": "explicitOperationCall", + "operator": "?=", + "terminal": { + "$type": "Keyword", + "value": "(" + } + }, + { + "$type": "Group", + "elements": [ + { + "$type": "Assignment", + "feature": "arguments", + "operator": "+=", + "terminal": { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@12" + }, + "arguments": [] + } + }, + { + "$type": "Group", + "elements": [ + { + "$type": "Keyword", + "value": "," + }, + { + "$type": "Assignment", + "feature": "arguments", + "operator": "+=", + "terminal": { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@12" + }, + "arguments": [] + } + } + ], + "cardinality": "*" + } + ], + "cardinality": "?" + }, + { + "$type": "Keyword", + "value": ")" + } + ], + "cardinality": "?" + } + ] + }, + "definesHiddenTokens": false, + "entry": false, + "fragment": false, + "hiddenTokens": [], + "parameters": [], + "wildcard": false + }, + { + "$type": "ParserRule", + "name": "UnaryExpression", + "definition": { + "$type": "Group", + "elements": [ + { + "$type": "Assignment", + "feature": "operator", + "operator": "=", + "terminal": { + "$type": "Alternatives", + "elements": [ + { + "$type": "Keyword", + "value": "!" + }, + { + "$type": "Keyword", + "value": "-" + }, + { + "$type": "Keyword", + "value": "+" + } + ] + } + }, + { + "$type": "Assignment", + "feature": "value", + "operator": "=", + "terminal": { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@12" + }, + "arguments": [] + } + } + ] + }, + "definesHiddenTokens": false, + "entry": false, + "fragment": false, + "hiddenTokens": [], + "parameters": [], + "wildcard": false + }, + { + "$type": "ParserRule", + "name": "IntegerExpression", + "definition": { + "$type": "Assignment", + "feature": "value", + "operator": "=", + "terminal": { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@34" + }, + "arguments": [] + } + }, + "definesHiddenTokens": false, + "entry": false, + "fragment": false, + "hiddenTokens": [], + "parameters": [], + "wildcard": false + }, + { + "$type": "ParserRule", + "name": "StringExpression", + "definition": { + "$type": "Assignment", + "feature": "value", + "operator": "=", + "terminal": { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@35" + }, + "arguments": [] + } + }, + "definesHiddenTokens": false, + "entry": false, + "fragment": false, + "hiddenTokens": [], + "parameters": [], + "wildcard": false + }, + { + "$type": "ParserRule", + "name": "BooleanExpression", + "definition": { + "$type": "Alternatives", + "elements": [ + { + "$type": "Assignment", + "feature": "value", + "operator": "?=", + "terminal": { + "$type": "Keyword", + "value": "true" + } + }, + { + "$type": "Keyword", + "value": "false" + } + ] + }, + "definesHiddenTokens": false, + "entry": false, + "fragment": false, + "hiddenTokens": [], + "parameters": [], + "wildcard": false + }, + { + "$type": "ParserRule", + "name": "NilExpression", + "definition": { + "$type": "Assignment", + "feature": "value", + "operator": "=", + "terminal": { + "$type": "Keyword", + "value": "nil" + } + }, + "definesHiddenTokens": false, + "entry": false, + "fragment": false, + "hiddenTokens": [], + "parameters": [], + "wildcard": false + }, + { + "$type": "ParserRule", + "name": "FunctionDeclaration", + "definition": { + "$type": "Group", + "elements": [ + { + "$type": "Keyword", + "value": "fun" + }, + { + "$type": "Assignment", + "feature": "name", + "operator": "=", + "terminal": { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@33" + }, + "arguments": [] + } + }, + { + "$type": "Keyword", + "value": "(" + }, + { + "$type": "Group", + "elements": [ + { + "$type": "Assignment", + "feature": "parameters", + "operator": "+=", + "terminal": { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@27" + }, + "arguments": [] + } + }, + { + "$type": "Group", + "elements": [ + { + "$type": "Keyword", + "value": "," + }, + { + "$type": "Assignment", + "feature": "parameters", + "operator": "+=", + "terminal": { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@27" + }, + "arguments": [] + } + } + ], + "cardinality": "*" + } + ], + "cardinality": "?" + }, + { + "$type": "Keyword", + "value": ")" + }, + { + "$type": "Keyword", + "value": ":" + }, + { + "$type": "Assignment", + "feature": "returnType", + "operator": "=", + "terminal": { + "$type": "CrossReference", + "type": { + "$ref": "#/rules@28/definition/elements@0/inferredType" + }, + "terminal": { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@33" + }, + "arguments": [] + }, + "deprecatedSyntax": false + } + }, + { + "$type": "Assignment", + "feature": "body", + "operator": "=", + "terminal": { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@10" + }, + "arguments": [] + } + } + ] + }, + "definesHiddenTokens": false, + "entry": false, + "fragment": false, + "hiddenTokens": [], + "parameters": [], + "wildcard": false + }, + { + "$type": "ParserRule", + "name": "Parameter", + "definition": { + "$type": "Group", + "elements": [ + { + "$type": "Assignment", + "feature": "name", + "operator": "=", + "terminal": { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@33" + }, + "arguments": [] + } + }, + { + "$type": "Keyword", + "value": ":" + }, + { + "$type": "Assignment", + "feature": "type", + "operator": "=", + "terminal": { + "$type": "CrossReference", + "type": { + "$ref": "#/rules@28/definition/elements@0/inferredType" + }, + "terminal": { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@33" + }, + "arguments": [] + }, + "deprecatedSyntax": false + } + } + ] + }, + "definesHiddenTokens": false, + "entry": false, + "fragment": false, + "hiddenTokens": [], + "parameters": [], + "wildcard": false + }, + { + "$type": "ParserRule", + "name": "Class", + "returnType": { + "$ref": "#/types@0" + }, + "definition": { + "$type": "Group", + "elements": [ + { + "$type": "Action", + "inferredType": { + "$type": "InferredType", + "name": "Class" + } + }, + { + "$type": "Keyword", + "value": "class" + }, { "$type": "Assignment", - "feature": "reference", + "feature": "name", "operator": "=", "terminal": { - "$type": "CrossReference", - "type": { - "$ref": "#/rules@27" - }, - "terminal": { - "$type": "RuleCall", - "rule": { - "$ref": "#/rules@34" - }, - "arguments": [] + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@33" }, - "deprecatedSyntax": false + "arguments": [] } }, + { + "$type": "Keyword", + "value": "{" + }, + { + "$type": "Assignment", + "feature": "members", + "operator": "+=", + "terminal": { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@29" + }, + "arguments": [] + }, + "cardinality": "*" + }, + { + "$type": "Keyword", + "value": "}" + } + ] + }, + "definesHiddenTokens": false, + "entry": false, + "fragment": false, + "hiddenTokens": [], + "parameters": [], + "wildcard": false + }, + { + "$type": "ParserRule", + "name": "ClassMember", + "definition": { + "$type": "Alternatives", + "elements": [ + { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@30" + }, + "arguments": [] + }, + { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@31" + }, + "arguments": [] + } + ] + }, + "definesHiddenTokens": false, + "entry": false, + "fragment": false, + "hiddenTokens": [], + "parameters": [], + "wildcard": false + }, + { + "$type": "ParserRule", + "name": "MethodMember", + "definition": { + "$type": "Group", + "elements": [ { "$type": "Assignment", - "feature": "primitive", + "feature": "name", "operator": "=", "terminal": { - "$type": "Alternatives", - "elements": [ - { - "$type": "Keyword", - "value": "String" - }, - { - "$type": "Keyword", - "value": "Integer" - }, - { - "$type": "Keyword", - "value": "Bool" - }, - { - "$type": "Keyword", - "value": "DateTime" - } - ] + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@33" + }, + "arguments": [] } }, + { + "$type": "Keyword", + "value": "(" + }, { "$type": "Group", "elements": [ { - "$type": "Keyword", - "value": "(" + "$type": "Assignment", + "feature": "parameters", + "operator": "+=", + "terminal": { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@27" + }, + "arguments": [] + } }, { "$type": "Group", "elements": [ + { + "$type": "Keyword", + "value": "," + }, { "$type": "Assignment", "feature": "parameters", @@ -2014,57 +3902,55 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded "terminal": { "$type": "RuleCall", "rule": { - "$ref": "#/rules@32" + "$ref": "#/rules@27" }, "arguments": [] } - }, - { - "$type": "Group", - "elements": [ - { - "$type": "Keyword", - "value": "," - }, - { - "$type": "Assignment", - "feature": "parameters", - "operator": "+=", - "terminal": { - "$type": "RuleCall", - "rule": { - "$ref": "#/rules@32" - }, - "arguments": [] - } - } - ], - "cardinality": "*" } ], - "cardinality": "?" + "cardinality": "*" + } + ], + "cardinality": "?" + }, + { + "$type": "Keyword", + "value": ")" + }, + { + "$type": "Keyword", + "value": ":" + }, + { + "$type": "Assignment", + "feature": "returnType", + "operator": "=", + "terminal": { + "$type": "CrossReference", + "type": { + "$ref": "#/rules@28/definition/elements@0/inferredType" }, - { - "$type": "Keyword", - "value": ")" + "terminal": { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@33" + }, + "arguments": [] }, - { - "$type": "Keyword", - "value": "=>" + "deprecatedSyntax": false + } + }, + { + "$type": "Assignment", + "feature": "body", + "operator": "=", + "terminal": { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@10" }, - { - "$type": "Assignment", - "feature": "returnType", - "operator": "=", - "terminal": { - "$type": "RuleCall", - "rule": { - "$ref": "#/rules@31" - }, - "arguments": [] - } - } - ] + "arguments": [] + } } ] }, @@ -2077,43 +3963,44 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded }, { "$type": "ParserRule", - "name": "LambdaParameter", + "name": "FieldMember", "definition": { "$type": "Group", "elements": [ { - "$type": "Group", - "elements": [ - { - "$type": "Assignment", - "feature": "name", - "operator": "=", - "terminal": { - "$type": "RuleCall", - "rule": { - "$ref": "#/rules@34" - }, - "arguments": [] - } + "$type": "Assignment", + "feature": "type", + "operator": "=", + "terminal": { + "$type": "CrossReference", + "type": { + "$ref": "#/rules@28/definition/elements@0/inferredType" }, - { - "$type": "Keyword", - "value": ":" - } - ], - "cardinality": "?" + "terminal": { + "$type": "RuleCall", + "rule": { + "$ref": "#/rules@33" + }, + "arguments": [] + }, + "deprecatedSyntax": false + } }, { "$type": "Assignment", - "feature": "type", + "feature": "name", "operator": "=", "terminal": { "$type": "RuleCall", "rule": { - "$ref": "#/rules@31" + "$ref": "#/rules@33" }, "arguments": [] } + }, + { + "$type": "Keyword", + "value": ";" } ] }, @@ -2189,6 +4076,9 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded "fragment": false } ], + "definesHiddenTokens": false, + "hiddenTokens": [], + "interfaces": [], "types": [ { "$type": "Type", @@ -2199,46 +4089,42 @@ export const CrmscriptGrammar = (): Grammar => loadedCrmscriptGrammar ?? (loaded { "$type": "SimpleType", "typeRef": { - "$ref": "#/rules@26" + "$ref": "#/rules@27" } }, { "$type": "SimpleType", "typeRef": { - "$ref": "#/rules@25" + "$ref": "#/rules@26" } }, { "$type": "SimpleType", "typeRef": { - "$ref": "#/rules@10/definition/elements@0/inferredType" + "$ref": "#/rules@11/definition/elements@0/inferredType" } }, { "$type": "SimpleType", "typeRef": { - "$ref": "#/rules@29" + "$ref": "#/rules@30" } }, { "$type": "SimpleType", "typeRef": { - "$ref": "#/rules@30" + "$ref": "#/rules@31" } }, { "$type": "SimpleType", "typeRef": { - "$ref": "#/rules@27" + "$ref": "#/rules@28/definition/elements@0/inferredType" } } ] } } ], - "definesHiddenTokens": false, - "hiddenTokens": [], - "imports": [], - "interfaces": [], "usedGrammars": [] }`)); diff --git a/packages/langium-crmscript/src/language/generated/module.ts b/packages/langium-crmscript/src/language/generated/module.ts index f9b3095..283e3fe 100644 --- a/packages/langium-crmscript/src/language/generated/module.ts +++ b/packages/langium-crmscript/src/language/generated/module.ts @@ -5,10 +5,16 @@ import type { LangiumSharedCoreServices, LangiumCoreServices, LangiumGeneratedCoreServices, LangiumGeneratedSharedCoreServices, LanguageMetaData, Module } from 'langium'; import { CrmscriptAstReflection } from './ast.js'; -import { CrmscriptGrammar } from './grammar.js'; +import { CrmscriptDefinitionGrammar, CrmscriptImplementationGrammar } from './grammar.js'; -export const CrmscriptLanguageMetaData = { - languageId: 'crmscript', +export const CrmscriptDefinitionLanguageMetaData = { + languageId: 'crmscript-definition', + fileExtensions: ['.crmscript-definition'], + caseInsensitive: false +} as const satisfies LanguageMetaData; + +export const CrmscriptImplementationLanguageMetaData = { + languageId: 'crmscript-implementation', fileExtensions: ['.crmscript'], caseInsensitive: false } as const satisfies LanguageMetaData; @@ -17,8 +23,14 @@ export const CrmscriptGeneratedSharedModule: Module new CrmscriptAstReflection() }; -export const CrmscriptGeneratedModule: Module = { - Grammar: () => CrmscriptGrammar(), - LanguageMetaData: () => CrmscriptLanguageMetaData, +export const CrmscriptDefinitionGeneratedModule: Module = { + Grammar: () => CrmscriptDefinitionGrammar(), + LanguageMetaData: () => CrmscriptDefinitionLanguageMetaData, + parser: {} +}; + +export const CrmscriptImplementationGeneratedModule: Module = { + Grammar: () => CrmscriptImplementationGrammar(), + LanguageMetaData: () => CrmscriptImplementationLanguageMetaData, parser: {} }; diff --git a/packages/langium-crmscript/src/language/lib/builtinCrmscript.ts b/packages/langium-crmscript/src/language/lib/builtinCrmscript.ts deleted file mode 100644 index 8ade010..0000000 --- a/packages/langium-crmscript/src/language/lib/builtinCrmscript.ts +++ /dev/null @@ -1,13 +0,0 @@ -export const builtinCrmscript = ` - -/** This is a Hover-text */ -String myString = "007"; - -/** Maximum number of customers */ -class Customer { - String name; - Integer age; - Bool isVip; - DateTime lastVisit; -} -`; \ No newline at end of file diff --git a/packages/langium-crmscript/src/language/main.ts b/packages/langium-crmscript/src/language/main.ts new file mode 100644 index 0000000..d63b5b4 --- /dev/null +++ b/packages/langium-crmscript/src/language/main.ts @@ -0,0 +1,13 @@ +import { startLanguageServer } from 'langium/lsp'; +import { NodeFileSystem } from 'langium/node'; +import { createConnection, ProposedFeatures } from 'vscode-languageserver/node.js'; +import { createCrmscriptServices } from './crmscript-module.js'; + +// Create a connection to the client +const connection = createConnection(ProposedFeatures.all); + +// Inject the shared services and language-specific services +const { shared } = createCrmscriptServices({ connection, ...NodeFileSystem }); + +// Start the language server with the shared services +startLanguageServer(shared); diff --git a/packages/langium-crmscript/src/language/overrides/completionProvider.ts b/packages/langium-crmscript/src/language/overrides/completionProvider.ts deleted file mode 100644 index f497f18..0000000 --- a/packages/langium-crmscript/src/language/overrides/completionProvider.ts +++ /dev/null @@ -1,181 +0,0 @@ -import { AstNode, AstNodeDescription } from 'langium'; -import { CompletionContext, CompletionValueItem, DefaultCompletionProvider } from 'langium/lsp'; - -import { - CompletionItem, - MarkupKind, - MarkupContent -} from 'vscode-languageserver'; -import { TypeDescription } from '../type-system/descriptions.js'; -import { inferType } from '../type-system/infer.js'; -import { NilExpression } from '../generated/ast.js'; - -// Define the documentation object -const dataTypeDocs: { [key: string]: { description: string, example: string } } = { - string: { - description: `A text string is a sequence of characters written with quotes. -You can use single or double quotes, but they must always come in pairs. Quotes can also be nested, by alternating between single and double quotes.`, - example: `String myCompany = "SuperOffice"; -String myLocation = 'Oslo'; -String onion = "The 'onion' has many layers.";` - }, - integer: { - description: `An integer is a whole number without any decimal points. It can be positive or negative.`, - example: `Integer a = 5; -Integer b = -3; -Integer c = a + b;` - } - // Add other data types as needed -}; - -// Function to add a new data type -function addDataType( - type: string, - description: string, - example: string -) { - dataTypeDocs[type] = { description, example }; -} - -//Example of adding more data types -addDataType( - 'Bool', - `A boolean represents a logical value that can be either true or false.`, - `Boolean isActive = true; -Boolean isDone = false;` -); - - -export class CustomCompletionProvider extends DefaultCompletionProvider { - - protected createReferenceCompletionItem(nodeDescription: AstNodeDescription): CompletionValueItem { - return { - nodeDescription, - kind: this.nodeKindProvider.getCompletionItemKind(nodeDescription), - detail: nodeDescription.type, - sortText: '0', - documentation: createMarkdown(nodeDescription) - }; - } - // protected fillCompletionItem(context: CompletionContext, item: CompletionValueItem): CompletionItem | undefined { - // let label: string; - // console.log(item.detail); - // if (typeof item.label === 'string') { - // label = item.label; - // } else if ('node' in item) { - // const name = this.nameProvider.getName(item.node); - // if (!name) { - // return undefined; - // } - // label = name; - // } else if ('nodeDescription' in item) { - // label = item.nodeDescription.name; - // } else { - // return undefined; - // } - // let insertText: string; - // if (typeof item.textEdit?.newText === 'string') { - // insertText = item.textEdit.newText; - // } else if (typeof item.insertText === 'string') { - // insertText = item.insertText; - // } else { - // insertText = label; - // } - // const textEdit = item.textEdit ?? this.buildCompletionTextEdit(context, label, insertText); - // if (!textEdit) { - // return undefined; - // } - - // // Copy all valid properties of `CompletionItem` - // const completionItem: CompletionItem = { - // additionalTextEdits: item.additionalTextEdits, - // command: item.command, - // commitCharacters: item.commitCharacters, - // data: item.data, - // detail: item.detail, - // documentation: this.getDocumentation(item.label), - // filterText: item.filterText, - // insertText: item.insertText, - // insertTextFormat: item.insertTextFormat, - // insertTextMode: item.insertTextMode, - // kind: item.kind, - // labelDetails: item.labelDetails, - // preselect: item.preselect, - // sortText: item.sortText, - // tags: item.tags, - // textEditText: item.textEditText, - // textEdit, - // label - // }; - // return completionItem; - // } - -// protected getReferenceDocumentation(nodeDescription: AstNodeDescription): MarkupContent | string | undefined { -// if (!nodeDescription.node) { -// return undefined; -// } -// const documentationText = documentationProvider.getDocumentation(nodeDescription.node); -// if (!documentationText) { -// return undefined; -// } -// return { kind: 'markdown', value: documentationText }; -// } - - // getDocumentation(label: string | undefined) { - // console.log(label); - // if(!label) return 'Undefined'; - // const doc = dataTypeDocs[label]; - // if (doc) { - // return { - // kind: MarkupKind.Markdown, - // value: [ - // `# ${label}`, - // '', - // `${doc}`, - // '', - // '```crmscript', - // '', - // `${doc.example}`, - // '', - // '```', - // '', - // ].join('\n') - // }; - // //return doc.description; - // } - // else { - // return undefined; - // } - // } -} - -function createMarkdown(nodeDescription: AstNodeDescription): MarkupContent | undefined { - const customType = inferType(nodeDescription.node, getTypeCache()); - const label = customType.$type; - if (Object.prototype.hasOwnProperty.call(dataTypeDocs, label)) { - const doc = dataTypeDocs[label]; - return { - kind: MarkupKind.Markdown, - value: [ - `# ${label}`, - '', - `${doc}`, - '', - '```crmscript', - '', - `${doc.example}`, - '', - '```', - '', - ].join('\n') - }; - } else { - // Handle the case where the item.label is not in dataTypeDocs - console.log(`Documentation for ${label} not found.`); - return undefined; - } -} - -function getTypeCache(): Map { - return new Map(); -} \ No newline at end of file diff --git a/packages/langium-crmscript/src/language/type-system/assignment.ts b/packages/langium-crmscript/src/language/type-system/assignment.ts index 9f8478c..174ba7a 100644 --- a/packages/langium-crmscript/src/language/type-system/assignment.ts +++ b/packages/langium-crmscript/src/language/type-system/assignment.ts @@ -1,4 +1,4 @@ -import { isClassType, isFunctionType, isNilType, TypeDescription } from "./descriptions.js"; +import { isClassType, isFunctionType, isNilType, TypeDescription, typeToString } from "./descriptions.js"; import { getClassChain } from "./infer.js"; export function isAssignable(from: TypeDescription, to: TypeDescription): boolean { @@ -38,5 +38,8 @@ export function isAssignable(from: TypeDescription, to: TypeDescription): boolea } return true; } + if(isClassType(to)){ + return typeToString(from) === typeToString(to); + } return from.$type === to.$type; } \ No newline at end of file diff --git a/packages/langium-crmscript/src/language/type-system/descriptions.ts b/packages/langium-crmscript/src/language/type-system/descriptions.ts index 40ad3c1..dc8c1af 100644 --- a/packages/langium-crmscript/src/language/type-system/descriptions.ts +++ b/packages/langium-crmscript/src/language/type-system/descriptions.ts @@ -3,16 +3,16 @@ import { AstNode } from "langium"; import { BooleanExpression, Class, - NumberExpression, + IntegerExpression, StringExpression -} from "../generated/ast.js"; +} from "../generated/ast.js" export type TypeDescription = | NilTypeDescription | VoidTypeDescription | BooleanTypeDescription | StringTypeDescription - | NumberTypeDescription + | IntegerTypeDescription | FunctionTypeDescription | ClassTypeDescription | ErrorType; @@ -38,7 +38,7 @@ export interface VoidTypeDescription { export function createVoidType(): VoidTypeDescription { return { $type: "void" - }; + } } export function isVoidType(item: TypeDescription): item is VoidTypeDescription { @@ -62,35 +62,35 @@ export function isBooleanType(item: TypeDescription): item is BooleanTypeDescrip } export interface StringTypeDescription { - readonly $type: "string" + readonly $type: "String" readonly literal?: StringExpression } export function createStringType(literal?: StringExpression): StringTypeDescription { return { - $type: "string", + $type: "String", literal }; } export function isStringType(item: TypeDescription): item is StringTypeDescription { - return item.$type === "string"; + return item.$type === "String"; } -export interface NumberTypeDescription { - readonly $type: "number", - readonly literal?: NumberExpression +export interface IntegerTypeDescription { + readonly $type: "Integer", + readonly literal?: IntegerExpression } -export function createNumberType(literal?: NumberExpression): NumberTypeDescription { +export function createIntegerType(literal?: IntegerExpression): IntegerTypeDescription { return { - $type: "number", + $type: "Integer", literal }; } -export function isNumberType(item: TypeDescription): item is NumberTypeDescription { - return item.$type === "number"; +export function isIntegerType(item: TypeDescription): item is IntegerTypeDescription { + return item.$type === "Integer"; } export interface FunctionTypeDescription { diff --git a/packages/langium-crmscript/src/language/type-system/infer.ts b/packages/langium-crmscript/src/language/type-system/infer.ts index c05bd15..d7da853 100644 --- a/packages/langium-crmscript/src/language/type-system/infer.ts +++ b/packages/langium-crmscript/src/language/type-system/infer.ts @@ -1,6 +1,6 @@ import { AstNode } from "langium"; -import { BinaryExpression, Class, isBinaryExpression, isBooleanExpression, isClass, isFieldMember, isFunctionDeclaration, isMemberCall, isMethodMember, isNilExpression, isNumberExpression, isParameter, isPrintStatement, isReturnStatement, isStringExpression, isTypeReference, isUnaryExpression, isVariableDeclaration, MemberCall, TypeReference } from "../generated/ast.js"; -import { createBooleanType, createClassType, createErrorType, createFunctionType, createNilType, createNumberType, createStringType, createVoidType, isFunctionType, isStringType, TypeDescription } from "./descriptions.js"; +import { BinaryExpression, Class, isBinaryExpression, isBooleanExpression, isClass, isFieldMember, isIntegerExpression, isMemberCall, isNilExpression, isParameter, isPrintStatement, isReturnStatement, isStringExpression, isUnaryExpression, isVariableDeclaration, MemberCall } from "../generated/ast.js"; +import { createBooleanType, createClassType, createErrorType, createNilType, createIntegerType, createStringType, createVoidType, isFunctionType, isStringType, TypeDescription } from "./descriptions.js"; export function inferType(node: AstNode | undefined, cache: Map): TypeDescription { let type: TypeDescription | undefined; @@ -15,22 +15,22 @@ export function inferType(node: AstNode | undefined, cache: Map ({ - name: e.name, - type: inferType(e.type, cache) - })); - type = createFunctionType(returnType, parameters); - } else if (isTypeReference(node)) { - type = inferTypeRef(node, cache); - } else if (isMemberCall(node)) { + } + // else if (isFunctionDeclaration(node) || isMethodMember(node)) { + // const returnType = inferType(node.returnType, cache); + // const parameters = node.parameters.map(e => ({ + // name: e.name, + // type: inferType(e.type, cache) + // })); + // type = createFunctionType(returnType, parameters); + // } + else if (isMemberCall(node)) { type = inferMemberCall(node, cache); if (node.explicitOperationCall) { if (isFunctionType(type)) { @@ -38,17 +38,17 @@ export function inferType(node: AstNode | undefined, cache: Map): TypeDescription { - if (node.primitive) { - if (node.primitive === 'Integer') { - return createNumberType(); - } else if (node.primitive === 'String') { - return createStringType(); - } else if (node.primitive === 'Bool') { - return createBooleanType(); - } else if (node.primitive === 'DateTime') { - return createVoidType(); - } - } else if (node.reference) { - if (node.reference.ref) { - return createClassType(node.reference.ref); - } - } else if (node.returnType) { - const returnType = inferType(node.returnType, cache); - const parameters = node.parameters.map((e, i) => ({ - name: e.name ?? `$${i}`, - type: inferType(e.type, cache) - })); - return createFunctionType(returnType, parameters); - } - return createErrorType('Could not infer type for this reference', node); -} - function inferMemberCall(node: MemberCall, cache: Map): TypeDescription { const element = node.element?.ref; if (element) { + if(isVariableDeclaration(element)){ + return inferType(element.type.$nodeDescription?.node, cache); + } return inferType(element, cache); } else if (node.explicitOperationCall && node.previous) { const previousType = inferType(node.previous, cache); @@ -118,7 +95,7 @@ function inferMemberCall(node: MemberCall, cache: Map) function inferBinaryExpression(expr: BinaryExpression, cache: Map): TypeDescription { if (['-', '*', '/', '%'].includes(expr.operator)) { - return createNumberType(); + return createIntegerType(); } else if (['and', 'or', '<', '<=', '>', '>=', '==', '!='].includes(expr.operator)) { return createBooleanType(); } @@ -128,7 +105,7 @@ function inferBinaryExpression(expr: BinaryExpression, cache: Map', '>='].includes(operator)) { if (!right) { - return left.$type === 'number'; + return left.$type === 'Integer'; } - return left.$type === 'number' && right.$type === 'number'; + return left.$type === 'Integer' && right.$type === 'Integer'; } else if (['and', 'or'].includes(operator)) { return left.$type === 'boolean' && right?.$type === 'boolean'; } else if (operator === '!') { diff --git a/packages/langium-crmscript/syntaxes/crmscript.tmLanguage.json b/packages/langium-crmscript/syntaxes/crmscript.tmLanguage.json index 44d1b1d..b6a0095 100644 --- a/packages/langium-crmscript/syntaxes/crmscript.tmLanguage.json +++ b/packages/langium-crmscript/syntaxes/crmscript.tmLanguage.json @@ -10,7 +10,7 @@ }, { "name": "keyword.control.crmscript", - "match": "\\b(Bool|DateTime|Integer|String|and|catch|class|else|false|for|if|nil|or|print|return|super|this|true|try|while)\\b" + "match": "\\b(Bool|Integer|String|and|catch|class|else|false|for|if|nil|or|print|return|struct|super|this|true|try|while)\\b" }, { "name": "string.quoted.double.crmscript", diff --git a/packages/langium-crmscript/test/linking/linking.test.ts b/packages/langium-crmscript/test/linking/linking.test.ts new file mode 100644 index 0000000..beebfc5 --- /dev/null +++ b/packages/langium-crmscript/test/linking/linking.test.ts @@ -0,0 +1,53 @@ +import { afterEach, beforeAll, describe, expect, test } from "vitest"; +import { EmptyFileSystem, type LangiumDocument } from "langium"; +import { expandToString as s } from "langium/generate"; +import { clearDocuments, parseHelper } from "langium/test"; +import { createCrmscriptServices } from "../../src/language/crmscript-module.js"; +import { Model, isModel } from "../../src/language/generated/ast.js"; + +let services: ReturnType; +let parse: ReturnType>; +let document: LangiumDocument | undefined; + +beforeAll(async () => { + services = createCrmscriptServices(EmptyFileSystem); + parse = parseHelper(services.Crmscript); + + // activate the following if your linking test requires elements from a built-in library, for example + // await services.shared.workspace.WorkspaceManager.initializeWorkspace([]); +}); + +afterEach(async () => { + document && clearDocuments(services.shared, [ document ]); +}); + +describe('Linking tests', () => { + + test('linking of greetings', async () => { + document = await parse(` + person Langium + Hello Langium! + `); + + expect( + // here we first check for validity of the parsed document object by means of the reusable function + // 'checkDocumentValid()' to sort out (critical) typos first, + // and then evaluate the cross references we're interested in by checking + // the referenced AST element as well as for a potential error message; + checkDocumentValid(document) + || document.parseResult.value.greetings.map(g => g.person.ref?.name || g.person.error?.message).join('\n') + ).toBe(s` + Langium + `); + }); +}); + +function checkDocumentValid(document: LangiumDocument): string | undefined { + return document.parseResult.parserErrors.length && s` + Parser errors: + ${document.parseResult.parserErrors.map(e => e.message).join('\n ')} + ` + || document.parseResult.value === undefined && `ParseResult is 'undefined'.` + || !isModel(document.parseResult.value) && `Root AST object is a ${document.parseResult.value.$type}, expected a '${Model}'.` + || undefined; +} diff --git a/packages/langium-crmscript/test/parsing/parsing.test.ts b/packages/langium-crmscript/test/parsing/parsing.test.ts new file mode 100644 index 0000000..435910f --- /dev/null +++ b/packages/langium-crmscript/test/parsing/parsing.test.ts @@ -0,0 +1,60 @@ +import { beforeAll, describe, expect, test } from "vitest"; +import { EmptyFileSystem, type LangiumDocument } from "langium"; +import { expandToString as s } from "langium/generate"; +import { parseHelper } from "langium/test"; +import { createCrmscriptServices } from "../../src/language/crmscript-module.js"; +import { Model, isModel } from "../../src/language/generated/ast.js"; + +let services: ReturnType; +let parse: ReturnType>; +let document: LangiumDocument | undefined; + +beforeAll(async () => { + services = createCrmscriptServices(EmptyFileSystem); + parse = parseHelper(services.Crmscript); + + // activate the following if your linking test requires elements from a built-in library, for example + // await services.shared.workspace.WorkspaceManager.initializeWorkspace([]); +}); + +describe('Parsing tests', () => { + + test('parse simple model', async () => { + document = await parse(` + person Langium + Hello Langium! + `); + + // check for absensce of parser errors the classic way: + // deacivated, find a much more human readable way below! + // expect(document.parseResult.parserErrors).toHaveLength(0); + + expect( + // here we use a (tagged) template expression to create a human readable representation + // of the AST part we are interested in and that is to be compared to our expectation; + // prior to the tagged template expression we check for validity of the parsed document object + // by means of the reusable function 'checkDocumentValid()' to sort out (critical) typos first; + checkDocumentValid(document) || s` + Persons: + ${document.parseResult.value?.persons?.map(p => p.name)?.join('\n ')} + Greetings to: + ${document.parseResult.value?.greetings?.map(g => g.person.$refText)?.join('\n ')} + ` + ).toBe(s` + Persons: + Langium + Greetings to: + Langium + `); + }); +}); + +function checkDocumentValid(document: LangiumDocument): string | undefined { + return document.parseResult.parserErrors.length && s` + Parser errors: + ${document.parseResult.parserErrors.map(e => e.message).join('\n ')} + ` + || document.parseResult.value === undefined && `ParseResult is 'undefined'.` + || !isModel(document.parseResult.value) && `Root AST object is a ${document.parseResult.value.$type}, expected a '${Model}'.` + || undefined; +} diff --git a/packages/langium-crmscript/test/validating/validating.test.ts b/packages/langium-crmscript/test/validating/validating.test.ts new file mode 100644 index 0000000..3bfae4b --- /dev/null +++ b/packages/langium-crmscript/test/validating/validating.test.ts @@ -0,0 +1,66 @@ +import { beforeAll, describe, expect, test } from "vitest"; +import { EmptyFileSystem, type LangiumDocument } from "langium"; +import { expandToString as s } from "langium/generate"; +import { parseHelper } from "langium/test"; +import type { Diagnostic } from "vscode-languageserver-types"; +import { createCrmscriptServices } from "../../src/language/crmscript-module.js"; +import { Model, isModel } from "../../src/language/generated/ast.js"; + +let services: ReturnType; +let parse: ReturnType>; +let document: LangiumDocument | undefined; + +beforeAll(async () => { + services = createCrmscriptServices(EmptyFileSystem); + const doParse = parseHelper(services.Crmscript); + parse = (input: string) => doParse(input, { validation: true }); + + // activate the following if your linking test requires elements from a built-in library, for example + // await services.shared.workspace.WorkspaceManager.initializeWorkspace([]); +}); + +describe('Validating', () => { + + test('check no errors', async () => { + document = await parse(` + person Langium + `); + + expect( + // here we first check for validity of the parsed document object by means of the reusable function + // 'checkDocumentValid()' to sort out (critical) typos first, + // and then evaluate the diagnostics by converting them into human readable strings; + // note that 'toHaveLength()' works for arrays and strings alike ;-) + checkDocumentValid(document) || document?.diagnostics?.map(diagnosticToString)?.join('\n') + ).toHaveLength(0); + }); + + test('check capital letter validation', async () => { + document = await parse(` + person langium + `); + + expect( + checkDocumentValid(document) || document?.diagnostics?.map(diagnosticToString)?.join('\n') + ).toEqual( + // 'expect.stringContaining()' makes our test robust against future additions of further validation rules + expect.stringContaining(s` + [1:19..1:26]: Person name should start with a capital. + `) + ); + }); +}); + +function checkDocumentValid(document: LangiumDocument): string | undefined { + return document.parseResult.parserErrors.length && s` + Parser errors: + ${document.parseResult.parserErrors.map(e => e.message).join('\n ')} + ` + || document.parseResult.value === undefined && `ParseResult is 'undefined'.` + || !isModel(document.parseResult.value) && `Root AST object is a ${document.parseResult.value.$type}, expected a '${Model}'.` + || undefined; +} + +function diagnosticToString(d: Diagnostic) { + return `[${d.range.start.line}:${d.range.start.character}..${d.range.end.line}:${d.range.end.character}]: ${d.message}`; +} diff --git a/packages/langium-crmscript/tsconfig.json b/packages/langium-crmscript/tsconfig.json index afa6a8f..840966b 100644 --- a/packages/langium-crmscript/tsconfig.json +++ b/packages/langium-crmscript/tsconfig.json @@ -1,6 +1,29 @@ { - "extends": "../../tsconfig.base.json", - "include": [ - "src/**/*.ts", - ] -} \ No newline at end of file + "compilerOptions": { + "target": "ES2017", + "module": "Node16", + "lib": [ + "ESNext" + ], + "sourceMap": true, + "outDir": "out", + "strict": true, + "noUnusedLocals": true, + "noImplicitReturns": true, + "noImplicitOverride": true, + "moduleResolution": "Node16", + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "rootDir": ".", + "noEmit": true + }, + "include": [ + "src/**/*.ts", + "test/**/*.ts" + ], + "exclude": [ + "out", + "node_modules" + ] +} diff --git a/packages/langium-crmscript/tsconfig.src.json b/packages/langium-crmscript/tsconfig.src.json new file mode 100644 index 0000000..928fe6d --- /dev/null +++ b/packages/langium-crmscript/tsconfig.src.json @@ -0,0 +1,11 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "noEmit": false, + "rootDir": "src", + }, + "include": [ + "src/**/*.ts" + ] + } + \ No newline at end of file diff --git a/packages/langium-crmscript/vitest.config.ts b/packages/langium-crmscript/vitest.config.ts new file mode 100644 index 0000000..47173bf --- /dev/null +++ b/packages/langium-crmscript/vitest.config.ts @@ -0,0 +1,20 @@ +/* + * For a detailed explanation regarding each configuration property and type check, visit: + * https://vitest.dev/config/ + */ +import { defineConfig } from 'vitest/config'; + +export default defineConfig({ + test: { + // coverage: { + // provider: 'v8', + // reporter: ['text', 'html'], + // include: ['src'], + // exclude: ['**/generated'], + // }, + deps: { + interopDefault: true + }, + include: ['**/*.test.ts'] + } +}); diff --git a/packages/language-server/src/core/superoffice.ts b/packages/language-server/src/core/superoffice.ts index cecb09d..6fba2d9 100644 --- a/packages/language-server/src/core/superoffice.ts +++ b/packages/language-server/src/core/superoffice.ts @@ -36,13 +36,13 @@ export function getSuperOfficeLanguageModule(): LanguagePlugin generated.slice(start, end), getLength: () => generated.length, diff --git a/packages/language-server/src/plugins/crmscript-definition.ts b/packages/language-server/src/plugins/crmscript-definition.ts new file mode 100644 index 0000000..a9e8cb2 --- /dev/null +++ b/packages/language-server/src/plugins/crmscript-definition.ts @@ -0,0 +1,98 @@ +import { CrmscriptServices } from '@superoffice/langium-crmscript/src/language/crmscript-module.js'; +import { AstNode, LangiumDocument, TextDocument, URI, ValidationOptions } from 'langium'; +import { CancellationToken, CompletionContext, DocumentSelector, LanguageServicePlugin, LanguageServicePluginInstance, Position } from '@volar/language-server'; +import { LangiumSharedServices } from 'langium/lsp'; + +export function create({ + crmscriptDocumentSelector = ['crmscript-definition'], + sharedService, + definitionService +}: { + crmscriptDocumentSelector?: DocumentSelector, + sharedService: LangiumSharedServices, + definitionService: CrmscriptServices +}): LanguageServicePlugin { + return { + name: 'crmscript', + create(): LanguageServicePluginInstance { + return { + async provideCompletionItems(document: TextDocument, position: Position, _: CompletionContext, token: CancellationToken) { + if (matchDocument(crmscriptDocumentSelector, document)) { + //const langiumDocument = sharedService.workspace.LangiumDocumentFactory.fromTextDocument(document); + + const langiumDocument = createOrUpdateLangiumDocument(sharedService, document, token); + + const params = { textDocument: document, position: position }; + return await definitionService.lsp.CompletionProvider?.getCompletion(langiumDocument, params, token); + } + return undefined; + }, + async provideHover(document: TextDocument, position: Position, token: CancellationToken) { + if (matchDocument(crmscriptDocumentSelector, document)) { + const langiumDocument = sharedService.workspace.LangiumDocumentFactory.fromTextDocument(document); + + //const langiumDocument = createOrUpdateLangiumDocument(sharedService, document, token); + + const params = { textDocument: document, position: position }; + return await definitionService.lsp.HoverProvider?.getHoverContent(langiumDocument, params, token); + } + return undefined; + }, + async provideDiagnostics(document, token) { + if (matchDocument(crmscriptDocumentSelector, document)) { + const langiumDocument = createOrUpdateLangiumDocument(sharedService, document, token); + + const options: ValidationOptions = {}; + return await definitionService.validation.DocumentValidator.validateDocument(langiumDocument, options, token); + } + return undefined; + }, + }; + } + }; +} + +function matchDocument(selector: DocumentSelector, document: TextDocument) { + for (const sel of selector) { + if (sel === document.languageId || (typeof sel === 'object' && sel.language === document.languageId)) { + return true; + } + } + return false; +} + +//TODO: Make it use DocumentBuilder#update instead +export function createOrUpdateLangiumDocument(sharedService: LangiumSharedServices, document: TextDocument, token?: CancellationToken): LangiumDocument{ + const langiumDocument = sharedService.workspace.LangiumDocumentFactory.fromTextDocument(document); + // console.log("langiumDocument uri: " + langiumDocument.uri); + console.log("document uri: " + document.uri); + console.log("document exists: " + sharedService.workspace.LangiumDocuments.hasDocument(langiumDocument.uri)); + + //TODO: Figure out the correct approach to checking if the document already is built/registered or not + if(!sharedService.workspace.LangiumDocuments.hasDocument(langiumDocument.uri)){ + return buildLangiumDocument(sharedService, document, token); + } + else{ + return updateLangiumDocument(sharedService, document, token); + } +} + +function buildLangiumDocument(sharedService: LangiumSharedServices, document: TextDocument, token?: CancellationToken): LangiumDocument{ + console.log("Building document: " + document.uri); + const langiumDocument = sharedService.workspace.LangiumDocumentFactory.fromTextDocument(document); + const langiumDocuments: LangiumDocument[] = []; + langiumDocuments.push(langiumDocument); + sharedService.workspace.DocumentBuilder.build(langiumDocuments, {}, token); + sharedService.workspace.LangiumDocuments.addDocument(langiumDocument); + return langiumDocument; +} + +function updateLangiumDocument(sharedService: LangiumSharedServices, document: TextDocument, token?: CancellationToken): LangiumDocument{ + console.log("Updating document: " + document.uri); + const langiumDocument = sharedService.workspace.LangiumDocumentFactory.fromTextDocument(document); + const changedDocuments: URI[] = []; + const deletedDocuments: URI[] = []; + changedDocuments.push(langiumDocument.uri); + sharedService.workspace.DocumentBuilder.update(changedDocuments, deletedDocuments, token); + return langiumDocument; +} \ No newline at end of file diff --git a/packages/language-server/src/plugins/crmscript.ts b/packages/language-server/src/plugins/crmscript.ts deleted file mode 100644 index efe7d8a..0000000 --- a/packages/language-server/src/plugins/crmscript.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { CrmscriptServices } from '@superoffice/langium-crmscript/src/language/crmscript-module.js'; -import { TextDocument, ValidationOptions } from 'langium'; -import { CancellationToken, CompletionContext, DocumentSelector, LanguageServicePlugin, LanguageServicePluginInstance, Position } from '@volar/language-server'; -import { LangiumSharedServices } from 'langium/lsp'; - -export function create({ - crmscriptDocumentSelector = ['crmscript'], - sharedService, - crmscriptService -}: { - crmscriptDocumentSelector?: DocumentSelector, - sharedService: LangiumSharedServices, - crmscriptService: CrmscriptServices -}): LanguageServicePlugin { - return { - name: 'crmscript', - create(): LanguageServicePluginInstance { - return { - async provideCompletionItems(document: TextDocument, position: Position, _: CompletionContext, token: CancellationToken) { - if (matchDocument(crmscriptDocumentSelector, document)) { - const langiumDocument = sharedService.workspace.LangiumDocumentFactory.fromTextDocument(document); - const params = { textDocument: document, position: position }; - const result = await crmscriptService.lsp.CompletionProvider?.getCompletion(langiumDocument, params, token); - - return result; - } - return undefined; - }, - async provideHover(document: TextDocument, position: Position, token: CancellationToken) { - if (matchDocument(crmscriptDocumentSelector, document)) { - const langiumDocument = sharedService.workspace.LangiumDocumentFactory.fromTextDocument(document); - const params = { textDocument: document, position: position }; - const result = await crmscriptService.lsp.HoverProvider?.getHoverContent(langiumDocument, params, token); - return result; - } - return undefined; - }, - async provideDiagnostics(document, token) { - if (matchDocument(crmscriptDocumentSelector, document)) { - const langiumDocument = sharedService.workspace.LangiumDocumentFactory.fromTextDocument(document); - const options: ValidationOptions = {}; - return await crmscriptService.validation.DocumentValidator.validateDocument(langiumDocument, options, token); - } - return undefined; - }, - }; - } - }; -} - -function matchDocument(selector: DocumentSelector, document: TextDocument) { - for (const sel of selector) { - if (sel === document.languageId || (typeof sel === 'object' && sel.language === document.languageId)) { - return true; - } - } - return false; -} \ No newline at end of file diff --git a/packages/language-server/src/server.ts b/packages/language-server/src/server.ts index fecbaaa..8ca7546 100644 --- a/packages/language-server/src/server.ts +++ b/packages/language-server/src/server.ts @@ -4,19 +4,35 @@ import { create as createCssService } from 'volar-service-css'; import { create as createTypeScriptServices } from 'volar-service-typescript'; import { createServer, createConnection, createTypeScriptProjectProvider, loadTsdkByPath } from '@volar/language-server/node.js'; -import { create as createCrmscriptService } from './plugins/crmscript.js'; +import { create as createCrmscriptService, createOrUpdateLangiumDocument } from './plugins/crmscript-definition.js'; import { getSuperOfficeLanguageModule } from './core/superoffice.js'; import { createCrmscriptServices } from '@superoffice/langium-crmscript/src/language/crmscript-module.js'; import { NodeFileSystem } from 'langium/node'; - -// Inject the shared services and language-specific services -const { shared, crmscript } = createCrmscriptServices({ ...NodeFileSystem }); +import { URI } from 'langium'; const connection = createConnection(); + const server = createServer(connection); connection.listen(); + +// Inject the shared services and language-specific services +const { shared, Definition } = createCrmscriptServices({ connection, ...NodeFileSystem }); + +//TODO: Figure out if this is correct. it seems very inefficient +server.documents.onDidChangeContent(change => { + if(change.document.uri.endsWith('.crmscript-definition')) { + //createOrUpdateLangiumDocument(shared, change.document); + } +}); + +server.documents.onDidOpen(change => { + if(change.document.uri.endsWith('.crmscript-definition')) { + //createOrUpdateLangiumDocument(shared, change.document); + } +}); + connection.onInitialize(params => { const tsdk = loadTsdkByPath(params.initializationOptions.typescript.tsdk, params.locale); return server.initialize( @@ -26,7 +42,7 @@ connection.onInitialize(params => { createCssService(), createEmmetService({}), ...createTypeScriptServices(tsdk.typescript, {}), - createCrmscriptService({ sharedService: shared, crmscriptService: crmscript }), + createCrmscriptService({ sharedService: shared, definitionService: Definition }), ], createTypeScriptProjectProvider(tsdk.typescript, tsdk.diagnosticMessages, () => [getSuperOfficeLanguageModule()]), ); @@ -34,10 +50,7 @@ connection.onInitialize(params => { connection.onInitialized(params => { shared.workspace.WorkspaceManager.initialized(params); - console.log('initialized'); return server.initialized; -}) - +}); -;/**/ connection.onShutdown(server.shutdown); \ No newline at end of file diff --git a/packages/vscode/crmscript-language-configuration.json b/packages/vscode/crmscript-language-configuration.json index 425268b..8f162a0 100644 --- a/packages/vscode/crmscript-language-configuration.json +++ b/packages/vscode/crmscript-language-configuration.json @@ -1,40 +1,30 @@ { "comments": { - "lineComment": "//", - "blockComment": ["/*", "*/"] + // 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": [ - { "open": "{", "close": "}" }, - { "open": "[", "close": "]" }, - { "open": "(", "close": ")" }, - { "open": "'", "close": "'", "notIn": ["string", "comment"] }, - { "open": "\"", "close": "\"", "notIn": ["string"] }, - { "open": "`", "close": "`", "notIn": ["string", "comment"] }, - { "open": "/**", "close": " */", "notIn": ["string"] } + ["{", "}"], + ["[", "]"], + ["(", ")"], + ["\"", "\""], + ["'", "'"] ], - "autoCloseBefore": ";:.,=}])>` \n\t", + // symbols that can be used to surround a selection "surroundingPairs": [ - ["{", "}"], - ["[", "]"], - ["(", ")"], - ["'", "'"], - ["\"", "\""], - ["`", "`"] - ], - "folding": { - "markers": { - "start": "^\\s*//\\s*#?region\\b", - "end": "^\\s*//\\s*#?endregion\\b" - } - }, - "wordPattern": "(-?\\d*\\.\\d\\w*)|([^\\`\\~\\!\\@\\#\\%\\^\\&\\*\\(\\)\\-\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>\\/\\?\\s]+)", - "indentationRules": { - "increaseIndentPattern": "^((?!\\/\\/).)*(\\{[^}\"'`]*|\\([^)\"'`]*|\\[[^\\]\"'`]*)$", - "decreaseIndentPattern": "^((?!.*?\\/\\*).*\\*/)?\\s*[\\)\\}\\]].*$" - } - } \ No newline at end of file + ["{", "}"], + ["[", "]"], + ["(", ")"], + ["\"", "\""], + ["'", "'"] + ] +} \ No newline at end of file diff --git a/packages/vscode/package.json b/packages/vscode/package.json index 1944222..95bf078 100644 --- a/packages/vscode/package.json +++ b/packages/vscode/package.json @@ -1,5 +1,5 @@ { - "name": "@superoffice/vscode", + "name": "vscode-superoffice", "description": "", "author": "Eivind Fasting", "version": "0.0.1", @@ -26,12 +26,22 @@ "configuration": "./jsfso-language-configuration.json" }, { - "id": "crmscript", - "extensions": [ - ".crmscript" + "id": "crmscript-definition", + "aliases": [ + "crmscript Definition", + "crmscript-definition" ], + "extensions": [".crmscript-definition"], "configuration": "./crmscript-language-configuration.json" - } + }, { + "id": "crmscript-implementation", + "aliases": [ + "crmscript Implementation", + "crmscript-implementation" + ], + "extensions": [".crmscript"], + "configuration": "./crmscript-language-configuration.json" + } ], "grammars": [ { @@ -40,36 +50,41 @@ "path": "./syntaxes/jsfso.tmLanguage.json" }, { - "language": "crmscript", - "scopeName": "source.crmscript", - "path": "./syntaxes/crmscript.tmLanguage.json" - } + "language": "crmscript-definition", + "scopeName": "source.crmscript-definition", + "path": "./syntaxes/crmscript-definition.tmLanguage.json" + }, + { + "language": "crmscript-implementation", + "scopeName": "source.crmscript-implementation", + "path": "./syntaxes/crmscript-implementation.tmLanguage.json" + } ], "commands": [ { - "command": "@superoffice/vscode.signIn", + "command": "signIn", "title": "Sign In", "icon": "$(log-in)", "category": "SuperOffice" }, { - "command": "@superoffice/vscode.showScriptInfo", + "command": "showScriptInfo", "title": "ShowScriptInfo" }, { - "command": "@superoffice/vscode.previewScript", + "command": "previewScript", "title": "PreviewScript" }, { - "command": "@superoffice/vscode.downloadScript", + "command": "downloadScript", "title": "DownloadScript" }, { - "command": "@superoffice/vscode.downloadScriptFolder", + "command": "downloadScriptFolder", "title": "DownloadScriptFolder" }, { - "command": "@superoffice/vscode.executeScript", + "command": "executeScript", "title": "ExecuteScript", "category": "SuperOffice", "enablement": "resourceScheme == file" @@ -95,24 +110,24 @@ "viewsWelcome": [ { "view": "superoffice.views.treeview", - "contents": "You are not logged in to SuperOffice [learn more](https://docs.superoffice.com/).\n[Login](command:@superoffice/vscode.signIn)" + "contents": "You are not logged in to SuperOffice [learn more](https://docs.superoffice.com/).\n[Login](command:signIn)" } ], "menus": { "view/title": [], "view/item/context": [ { - "command": "@superoffice/vscode.previewScript", + "command": "previewScript", "group": "0_script", "when": "view == superoffice.views.treeview && viewItem == script" }, { - "command": "@superoffice/vscode.downloadScript", + "command": "downloadScript", "group": "0_script", "when": "view == superoffice.views.treeview && viewItem == script" }, { - "command": "@superoffice/vscode.downloadScriptFolder", + "command": "downloadScriptFolder", "group": "0_script", "when": "view == superoffice.views.treeview && viewItem == folder" } @@ -126,7 +141,7 @@ ], "superoffice.submenu": [ { - "command": "@superoffice/vscode.executeScript" + "command": "executeScript" } ] }, @@ -137,24 +152,6 @@ } ], "configuration": [ - { - "order": 22, - "id": "superoffice", - "title": "superoffice", - "properties": { - "superoffice.trace.server": { - "type": "string", - "scope": "window", - "enum": [ - "off", - "messages", - "verbose" - ], - "default": "verbose", - "description": "Traces the communication between VS Code and the languageserver." - } - } - } ] }, "scripts": { diff --git a/packages/vscode/src/commands.ts b/packages/vscode/src/commands.ts index b00fa2d..3c1a1a9 100644 --- a/packages/vscode/src/commands.ts +++ b/packages/vscode/src/commands.ts @@ -1,15 +1,11 @@ import * as vscode from 'vscode'; import { ScriptInfo } from './types'; -import { downloadScriptAsync, downloadScriptFolderAsync, executeScriptAsync, getScriptEntityAsync } from './services/scriptService'; -import { Node } from './providers/treeViewDataProvider'; -import { vfsProvider } from './extension'; +//import { downloadScriptAsync, downloadScriptFolderAsync, executeScriptAsync, getScriptEntityAsync } from './services/scriptService'; import { CONFIG_COMMANDS } from './config'; -//import { executeScriptLocallyAsync } from './services/nodeService'; const openedScripts: Map = new Map(); export async function registerCommands(context: vscode.ExtensionContext): Promise { - const signInCommand = vscode.commands.registerCommand(CONFIG_COMMANDS.CMD_SIGN_IN, async () => { const session = await vscode.authentication.getSession("superoffice", [], { createIfNone: true }); console.log(JSON.stringify(session)); @@ -27,74 +23,75 @@ export async function registerCommands(context: vscode.ExtensionContext): Promis }); // Register Command to Preview Script. This version uses the Virtual File System Provider - const previewScriptCommand = vscode.commands.registerCommand(CONFIG_COMMANDS.CMD_PREVIEW_SCRIPT, async (node: Node) => { - if (node?.scriptInfo) { - const scriptInfo: ScriptInfo = node.scriptInfo; - try { - const scriptEntity = await getScriptEntityAsync(scriptInfo.uniqueIdentifier); + // const previewScriptCommand = vscode.commands.registerCommand(CONFIG_COMMANDS.CMD_PREVIEW_SCRIPT, async (node: Node) => { + // if (node?.scriptInfo) { + // const scriptInfo: ScriptInfo = node.scriptInfo; + // try { + // const scriptEntity = await getScriptEntityAsync(scriptInfo.uniqueIdentifier); - // Create a virtual URI for the file based on the desired filename - const filename = `${scriptInfo.name}.jsfso`; - const virtualUri = vscode.Uri.parse(`${CONFIG_COMMANDS.VFS_SCHEME}:/scripts/${filename}`); + // // Create a virtual URI for the file based on the desired filename + // const filename = `${scriptInfo.name}.jsfso`; + // const virtualUri = vscode.Uri.parse(`${CONFIG_COMMANDS.VFS_SCHEME}:/scripts/${filename}`); - // "Write" the content to the virtual file - vfsProvider.writeFile(virtualUri, Buffer.from(scriptEntity.Source, 'utf8'), { create: true, overwrite: true }); + // // "Write" the content to the virtual file + // vfsProvider.writeFile(virtualUri, Buffer.from(scriptEntity.Source, 'utf8'), { create: true, overwrite: true }); - // Open the virtual file in VSCode - const document = await vscode.workspace.openTextDocument(virtualUri); - vscode.window.showTextDocument(document); - } catch (err) { - vscode.window.showErrorMessage(`Failed to preview script: ${err}`); - } - } - }); + // // Open the virtual file in VSCode + // const document = await vscode.workspace.openTextDocument(virtualUri); + // vscode.window.showTextDocument(document); + // } catch (err) { + // vscode.window.showErrorMessage(`Failed to preview script: ${err}`); + // } + // } + // }); // Register command to download the script and store it into workspace - const downloadScriptCommand = vscode.commands.registerCommand(CONFIG_COMMANDS.CMD_DOWNLOAD_SCRIPT, async (node: Node) => { - if (node?.scriptInfo) { - const scriptInfo: ScriptInfo = node.scriptInfo; - if (vscode.workspace.workspaceFolders !== undefined) { - try { - const fullPath = await downloadScriptAsync(scriptInfo.uniqueIdentifier); - const document = await vscode.workspace.openTextDocument(fullPath); - vscode.window.showTextDocument(document); - } catch (err) { - throw new Error(`Failed to download script: ${err}`); - } - } - else { - vscode.window.showErrorMessage("superoffice-vscode: Working folder not found, open a folder an try again"); - } - } - }); + // const downloadScriptCommand = vscode.commands.registerCommand(CONFIG_COMMANDS.CMD_DOWNLOAD_SCRIPT, async (node: Node) => { + // if (node?.scriptInfo) { + // const scriptInfo: ScriptInfo = node.scriptInfo; + // if (vscode.workspace.workspaceFolders !== undefined) { + // try { + // const fullPath = await downloadScriptAsync(scriptInfo.uniqueIdentifier); + // const document = await vscode.workspace.openTextDocument(fullPath); + // vscode.window.showTextDocument(document); + // } catch (err) { + // throw new Error(`Failed to download script: ${err}`); + // } + // } + // else { + // vscode.window.showErrorMessage("superoffice-vscode: Working folder not found, open a folder an try again"); + // } + // } + // }); // Register command to download the script and store it into workspace - const downloadScriptFolderCommand = vscode.commands.registerCommand(CONFIG_COMMANDS.CMD_DOWNLOAD_SCRIPTFOLDER, async (node: Node) => { - try { - await downloadScriptFolderAsync(node); - } - catch (err) { - throw new Error(`Failed to download scriptFolder: ${err}`); - } - }); + // const downloadScriptFolderCommand = vscode.commands.registerCommand(CONFIG_COMMANDS.CMD_DOWNLOAD_SCRIPTFOLDER, async (node: Node) => { + // try { + // await downloadScriptFolderAsync(node); + // } + // catch (err) { + // throw new Error(`Failed to download scriptFolder: ${err}`); + // } + // }); - const executeScriptCommand = vscode.commands.registerCommand(CONFIG_COMMANDS.CMD_EXECUTE_SCRIPT, async (fileUri: vscode.Uri) => { - if (fileUri && fileUri.fsPath) { - try { - const fileContent = await vscode.workspace.fs.readFile(fileUri); - const decodedContent = new TextDecoder().decode(fileContent); + // const executeScriptCommand = vscode.commands.registerCommand(CONFIG_COMMANDS.CMD_EXECUTE_SCRIPT, async (fileUri: vscode.Uri) => { + // if (fileUri && fileUri.fsPath) { + // try { + // const fileContent = await vscode.workspace.fs.readFile(fileUri); + // const decodedContent = new TextDecoder().decode(fileContent); - // Send the script content to the server for execution - const result = await executeScriptAsync(decodedContent); - vscode.window.showInformationMessage(result.Output); - } catch (err) { - vscode.window.showErrorMessage(`Failed to execute script: ${err}`); - //throw new Error(`Failed to download script: ${err}`); - } - } else { - vscode.window.showInformationMessage('No file selected!'); - } - }); + // // Send the script content to the server for execution + // const result = await executeScriptAsync(decodedContent); + // vscode.window.showInformationMessage(result.Output); + // } catch (err) { + // vscode.window.showErrorMessage(`Failed to execute script: ${err}`); + // //throw new Error(`Failed to download script: ${err}`); + // } + // } else { + // vscode.window.showInformationMessage('No file selected!'); + // } + // }); + // const executeScriptLocallyCommand = vscode.commands.registerCommand(CONFIG_COMMANDS.CMD_EXECUTE_SCRIPT_LOCALLY, async (fileUri: vscode.Uri) => { // if (fileUri && fileUri.fsPath) { @@ -114,5 +111,5 @@ export async function registerCommands(context: vscode.ExtensionContext): Promis // } // }); - context.subscriptions.push(signInCommand, showScriptInfoCommand, previewScriptCommand, downloadScriptCommand, downloadScriptFolderCommand, executeScriptCommand); + context.subscriptions.push(signInCommand, showScriptInfoCommand, /*previewScriptCommand, downloadScriptCommand, downloadScriptFolderCommand, executeScriptCommand*/); } \ No newline at end of file diff --git a/packages/vscode/src/config.ts b/packages/vscode/src/config.ts index 153afe2..f5bb370 100644 --- a/packages/vscode/src/config.ts +++ b/packages/vscode/src/config.ts @@ -8,20 +8,19 @@ export const CONFIG_SCRIPTSERVICE = { }; export const CONFIG_COMMANDS = { - CMD_SIGN_IN: '@superoffice/vscode.signIn', - CMD_SIGN_OUT: '@superoffice/vscode.signOut', - CMD_SHOW_SCRIPT_INFO: '@superoffice/vscode.showScriptInfo', - CMD_PREVIEW_SCRIPT: '@superoffice/vscode.previewScript', - CMD_DOWNLOAD_SCRIPT: '@superoffice/vscode.downloadScript', - CMD_DOWNLOAD_SCRIPTFOLDER: '@superoffice/vscode.downloadScriptFolder', - CMD_EXECUTE_SCRIPT: '@superoffice/vscode.executeScript', + CMD_SIGN_IN: 'signIn', + CMD_SIGN_OUT: 'signOut', + CMD_SHOW_SCRIPT_INFO: 'vscode-superoffice.showScriptInfo', + CMD_PREVIEW_SCRIPT: 'previewScript', + CMD_DOWNLOAD_SCRIPT: 'downloadScript', + CMD_DOWNLOAD_SCRIPTFOLDER: 'downloadScriptFolder', + CMD_EXECUTE_SCRIPT: 'executeScript', VFS_SCHEME: 'vfs', - CMD_EXECUTE_SCRIPT_LOCALLY: '@superoffice/vscode.executeScriptLocally' + CMD_EXECUTE_SCRIPT_LOCALLY: 'executeScriptLocally' }; export const CONFIG_AUTHSERVICE = { REDIRECT_URI: 'http://127.0.0.1:8000', - CLIENT_ID: '1a5764a8090f136cc9d30f381626d5fa' }; export const CONFIG_SYSTEMSERVICE = { @@ -29,6 +28,6 @@ export const CONFIG_SYSTEMSERVICE = { `https://${environment}.superoffice.com/api/state/${contextIdentifier}` }; -export const CONFIG_FILESYSTEMHANDLER = { +export const CONFIG = { SUOFILE_PATH: `./.superoffice/.suo`, }; diff --git a/packages/vscode/src/container.ts b/packages/vscode/src/container.ts new file mode 100644 index 0000000..1044553 --- /dev/null +++ b/packages/vscode/src/container.ts @@ -0,0 +1,35 @@ +// container.ts + +import * as vscode from 'vscode'; +import { Issuer, generators } from 'openid-client'; +import { createServer } from 'http'; +import { AuthenticationService, IAuthenticationService } from './services/authenticationService'; +import { parse } from 'url'; +import { FileSystemHandler, IFileSystemHandler } from './workspace/fileSystemHandler'; +import { IScriptService, ScriptService } from './services/scriptService'; +import { TreeViewDataProvider } from './providers/treeViewDataProvider'; +import { VirtualFileSystemProvider } from './workspace/virtualWorkspaceFileManager'; + +export async function initializeServices(): Promise<{ + authenticationService: IAuthenticationService, + fileSystemHandler: IFileSystemHandler, + scriptService: IScriptService, + treeViewDataProvider: TreeViewDataProvider, + vfsProvider: VirtualFileSystemProvider +}> { + const fileSystemHandler: IFileSystemHandler = new FileSystemHandler(); + + const authenticationService: IAuthenticationService = new AuthenticationService({ + Issuer, + generators, + parse, + createServer, + vscode + }, fileSystemHandler); + + const scriptService: IScriptService = new ScriptService(); + const treeViewDataProvider = new TreeViewDataProvider(scriptService); + const vfsProvider = new VirtualFileSystemProvider(); + + return { authenticationService, fileSystemHandler, scriptService, treeViewDataProvider, vfsProvider }; +} \ No newline at end of file diff --git a/packages/vscode/src/extension.ts b/packages/vscode/src/extension.ts index be95737..7c73268 100644 --- a/packages/vscode/src/extension.ts +++ b/packages/vscode/src/extension.ts @@ -10,21 +10,19 @@ import { CONFIG_COMMANDS } from './config'; import { SuperofficeAuthenticationProvider } from './providers/authenticationProvider'; import { registerCommands } from './commands'; import { DslLibraryFileSystemProvider } from './providers/dslLibraryFileSystemProvider'; +import { superOfficeUriHandler } from './services/uriHandler'; +import { initializeServices } from './container'; let client: lsp.BaseLanguageClient; - -export const treeViewDataProvider = new TreeViewDataProvider(); -export const vfsProvider = new VirtualFileSystemProvider(); export let logoUri: vscode.Uri; // This method is called when your extension is activated // Your extension is activated the very first time the command is executed export async function activate(context: vscode.ExtensionContext): Promise { logoUri = vscode.Uri.joinPath(context.extensionUri, 'resources', 'logo.svg'); - const serverModule = vscode.Uri.joinPath(context.extensionUri, 'dist', 'server.js'); const runOptions = { execArgv: [] }; - + const debugOptions = { execArgv: ['--nolazy', `--inspect${process.env.DEBUG_BREAK ? '-brk' : ''}=${process.env.DEBUG_SOCKET || '6009'}`] }; //const debugOptions = { execArgv: ['--nolazy', '--inspect=' + 6009] }; const serverOptions: lsp.ServerOptions = { @@ -42,7 +40,7 @@ export async function activate(context: vscode.ExtensionContext): Promise(); private _disposable: Disposable; - - constructor(private readonly context: ExtensionContext) { + private authenticationService: IAuthenticationService; + private fileSystemHandler: IFileSystemHandler; + private treeViewDataProvider: TreeViewDataProvider; + + constructor(private readonly context: ExtensionContext, authenticationService: IAuthenticationService, fileSystemHandler: IFileSystemHandler, treeViewDataProvider: TreeViewDataProvider) { + this.authenticationService = authenticationService; + this.fileSystemHandler = fileSystemHandler; + this.treeViewDataProvider = treeViewDataProvider; this._disposable = Disposable.from( authentication.registerAuthenticationProvider(AUTH_TYPE, AUTH_NAME, this, { supportsMultipleAccounts: false }) ); @@ -43,7 +48,7 @@ export class SuperofficeAuthenticationProvider implements AuthenticationProvider const sessionArray = JSON.parse(allSessions) as SuperOfficeAuthenticationSession[]; try { - const suoFile = await getSuoFile(); + const suoFile = await this.fileSystemHandler.readSuoFileAsync(); const session = sessionArray.find(obj => obj.contextIdentifier === suoFile.contextIdentifier); if (session) { @@ -73,10 +78,9 @@ export class SuperofficeAuthenticationProvider implements AuthenticationProvider */ public async createSession(_scopes: string[]): Promise { try { - const environment = await this.selectEnvironment(); - - // //Run Authorization Code Flow with PKCE - const tokenSet = await authenticate(environment) as TokenSet; + //const environment = await this.selectEnvironment(); + await this.authenticationService.initializeAsync(); + const tokenSet = await this.authenticationService.authenticateAsync(); if (!tokenSet.access_token) { throw new Error('Access token is missing from the authentication response.'); @@ -86,7 +90,7 @@ export class SuperofficeAuthenticationProvider implements AuthenticationProvider const claims: UserClaims = tokenSet.claims() as UserClaims; contextIdentifier = `${claims['http://schemes.superoffice.net/identity/ctx']}`; - const state = await getTenantStateAsync(environment, contextIdentifier); + const state = await getTenantStateAsync(this.authenticationService.getEnvironment(), contextIdentifier); if(!state.IsRunning){ throw new Error('The tenant is not running'); } @@ -107,7 +111,7 @@ export class SuperofficeAuthenticationProvider implements AuthenticationProvider }; await this.context.secrets.store(SESSIONS_SECRET_KEY, JSON.stringify([session])); - await writeSuoFile(JSON.stringify({ contextIdentifier: contextIdentifier })); + await this.fileSystemHandler.writeSuoFileAsync(JSON.stringify({ contextIdentifier: contextIdentifier, environment: this.authenticationService.getEnvironment(), clientId: this.authenticationService.getClientId()})); this._sessionChangeEmitter.fire({ added: [session], removed: [], changed: [] }); @@ -159,7 +163,7 @@ export class SuperofficeAuthenticationProvider implements AuthenticationProvider currentSession = session; //Needed to help the package.json figure out if you are logged inn or not commands.executeCommand('setContext', 'authenticated', currentSession ?? false); - treeViewDataProvider.refresh(); + this.treeViewDataProvider.refresh(); } // This method is used to update the login status and refresh the tree @@ -167,7 +171,7 @@ export class SuperofficeAuthenticationProvider implements AuthenticationProvider currentSession = null; //Needed to help the package.json figure out if you are logged inn or not commands.executeCommand('setContext', 'authenticated', false); - treeViewDataProvider.refresh(); + this.treeViewDataProvider.refresh(); } /** diff --git a/packages/vscode/src/providers/dslLibraryFileSystemProvider.ts b/packages/vscode/src/providers/dslLibraryFileSystemProvider.ts index 45d06c8..12e23fc 100644 --- a/packages/vscode/src/providers/dslLibraryFileSystemProvider.ts +++ b/packages/vscode/src/providers/dslLibraryFileSystemProvider.ts @@ -11,7 +11,7 @@ String mySecondString = "007"; export class DslLibraryFileSystemProvider implements vscode.FileSystemProvider { - static register(context: vscode.ExtensionContext) { + static register(context: vscode.ExtensionContext): void { context.subscriptions.push( vscode.workspace.registerFileSystemProvider('builtin', new DslLibraryFileSystemProvider(), { isReadonly: true, diff --git a/packages/vscode/src/providers/treeViewDataProvider.ts b/packages/vscode/src/providers/treeViewDataProvider.ts index 3ff6a4b..46897e2 100644 --- a/packages/vscode/src/providers/treeViewDataProvider.ts +++ b/packages/vscode/src/providers/treeViewDataProvider.ts @@ -1,8 +1,9 @@ import * as vscode from 'vscode'; import { ScriptInfo } from '../types'; -import { getAllScriptInfoAsync } from '../services/scriptService'; +import { IScriptService } from '../services/scriptService'; import { currentSession } from './authenticationProvider'; import { logoUri } from '../extension'; +import { CONFIG_COMMANDS } from '../config'; ///const logoUri = vscode.Uri.joinPath(vscode.extensions.getExtension('superoffice.@superoffice/vscode')!.extensionUri, 'resources', 'logo.svg'); const iconPath = { @@ -19,11 +20,11 @@ export class Node implements vscode.TreeItem { contextValue: string; collapsibleState: vscode.TreeItemCollapsibleState; constructor( - public readonly label: string, + public readonly label: string, public readonly children?: Node[], public readonly iconPath?: vscode.ThemeIcon | { light: vscode.Uri; dark: vscode.Uri }, public readonly command?: vscode.Command, - public readonly scriptInfo?: ScriptInfo + public readonly scriptInfo?: ScriptInfo, ) { this.contextValue = scriptInfo ? 'script' : 'folder'; this.collapsibleState = (this.children?.length ?? 0) > 0 @@ -36,8 +37,8 @@ function convertTreeDataToNode(data: TreeDataItem): Node { return new Node( data.label, data.children.map(convertTreeDataToNode), - data.scriptInfo ? iconPath : new vscode.ThemeIcon('folder'), - data.scriptInfo ? { command: '@superoffice/vscode.showScriptInfo', title: 'Show Script Info', arguments: [data.scriptInfo] } : undefined, + data.scriptInfo ? new vscode.ThemeIcon('code') : new vscode.ThemeIcon('folder'), + data.scriptInfo ? { command: CONFIG_COMMANDS.CMD_SHOW_SCRIPT_INFO, title: 'Show Script Info', arguments: [data.scriptInfo] } : undefined, data.scriptInfo ); } @@ -71,6 +72,11 @@ function addToTreeData(root: TreeDataItem, scriptPath: string, scriptInfo: Scrip export class TreeViewDataProvider implements vscode.TreeDataProvider { private _onDidChangeTreeData: vscode.EventEmitter = new vscode.EventEmitter(); readonly onDidChangeTreeData: vscode.Event = this._onDidChangeTreeData.event; + scriptService: IScriptService; + + constructor(scriptService: IScriptService){ + this.scriptService = scriptService; + } public static readonly viewId = 'superoffice.views.treeview'; @@ -91,9 +97,10 @@ export class TreeViewDataProvider implements vscode.TreeDataProvider { //Check if user is logged in if (currentSession) { try { - const scriptResponseData = await getAllScriptInfoAsync(); + const scriptResponseData = await this.scriptService.getAllScriptInfoAsync(); const root: TreeDataItem = { label: 'Root', children: [] }; scriptResponseData.value.forEach(script => addToTreeData(root, script.path, script)); + console.log("something: " + iconPath); return root.children.map(convertTreeDataToNode); } catch (err) { if (err instanceof Error) { diff --git a/packages/vscode/src/services/authenticationService.ts b/packages/vscode/src/services/authenticationService.ts index d10f07e..4472a9a 100644 --- a/packages/vscode/src/services/authenticationService.ts +++ b/packages/vscode/src/services/authenticationService.ts @@ -1,166 +1,332 @@ -import { BaseClient, ClientMetadata, Issuer, TokenSet, generators } from "openid-client"; +import { ClientMetadata, Issuer, TokenSet, generators } from "openid-client"; import { createServer, Server } from 'http'; import { parse } from 'url'; -import { parse as parseQuery } from 'querystring'; import * as vscode from 'vscode'; import { CONFIG_AUTHSERVICE } from "../config"; -import { SuperOfficeAuthenticationSession, UserClaims } from '../types'; +import { IFileSystemHandler } from "../workspace/fileSystemHandler"; + // Configuration variables const redirectUri = process.env.REDIRECT_URI || CONFIG_AUTHSERVICE.REDIRECT_URI; const parsedUri = new URL(redirectUri); -const clientId = process.env.CLIENT_ID || CONFIG_AUTHSERVICE.CLIENT_ID; -let superOfficeIssuer: Issuer; let server: Server | null = null; let codeVerifier: string; -/* eslint-disable @typescript-eslint/naming-convention */ -const clientMetadata: ClientMetadata = { - client_id: clientId, - redirect_uri: redirectUri, - response_types: ['code'], - token_endpoint_auth_method: 'none' -}; +interface AuthServiceDependencies { + Issuer: typeof Issuer; + generators: typeof generators; + parse: typeof parse; + createServer: typeof createServer; + vscode: typeof vscode; +} -/* eslint-enable @typescript-eslint/naming-convention */ +export interface IAuthenticationService { + initializeAsync(): Promise; + authenticateAsync(): Promise; + getEnvironment(): string; + getClientId(): string +} -export const authenticate = async (environment: string): Promise => { - try { - const url = await generateAuthorizeUrl(environment); - await vscode.env.openExternal(vscode.Uri.parse(url)); - return await startServer(); - } catch (error) { - handleAuthorizeRequestError(error); - throw error; +export class AuthenticationService implements IAuthenticationService { + environment!: string; + clientId!: string; + private clientMetadata!: ClientMetadata; // Use definite assignment assertion + private dependencies: AuthServiceDependencies; + private fileSystemHandler: IFileSystemHandler; + + constructor(dependencies: AuthServiceDependencies, fileSystemHandler: IFileSystemHandler) { + this.dependencies = dependencies; + this.fileSystemHandler = fileSystemHandler; } -}; -async function generateAuthorizeUrl(environment: string): Promise { - if (!['sod', 'online'].includes(environment)) { - throw new Error(`Invalid environment: ${environment}`); + public async initializeAsync(): Promise { + try { + const suoFile = await this.fileSystemHandler.readSuoFileAsync(); + this.clientMetadata = { + client_id: suoFile.clientId, + redirect_uri: CONFIG_AUTHSERVICE.REDIRECT_URI, + response_types: ['code'], + token_endpoint_auth_method: 'none' + }; + this.clientId = suoFile.clientId; + this.environment = suoFile.environment; + } catch (error) { + throw new Error(`Error initializing AuthenticationService: ${error}`); + } } - superOfficeIssuer = await Issuer.discover(`https://${environment}.superoffice.com/login/.well-known/openid-configuration`); + public async authenticateAsync(): Promise { + try { + const url = await this.generateAuthorizeUrlAsync(); + await this.dependencies.vscode.env.openExternal(this.dependencies.vscode.Uri.parse(url)); + const temp = await this.startServerAsync(); + console.log('temp', temp.id_token); + return temp; + } catch (error) { + this.handleAuthorizeRequestError(error); + throw error; + } + } - const client = new superOfficeIssuer.Client(clientMetadata); - const state = generators.state(); + private async generateAuthorizeUrlAsync(): Promise { + const { Issuer, generators } = this.dependencies; + const superOfficeIssuer = await Issuer.discover(`https://${this.environment}.superoffice.com/login/.well-known/openid-configuration`); - codeVerifier = generators.codeVerifier(); - const codeChallenge = generators.codeChallenge(codeVerifier); + const client = new superOfficeIssuer.Client(this.clientMetadata); + const state = generators.state(); - /* eslint-disable @typescript-eslint/naming-convention */ - const url = client.authorizationUrl({ - scope: 'openid', - state, - code_challenge: codeChallenge, - code_challenge_method: 'S256' - }); - /* eslint-enable @typescript-eslint/naming-convention */ - return url; -} + codeVerifier = generators.codeVerifier(); + const codeChallenge = generators.codeChallenge(codeVerifier); -function startServer(): Promise { - return new Promise((resolve, reject) => { - if (server) { reject(new Error('Server already started')); } + const url = client.authorizationUrl({ + scope: 'openid', + state, + code_challenge: codeChallenge, + code_challenge_method: 'S256' + }); + return url; + } - server = createServer(async (req, res) => { - if (!req.url) { - reject(new Error('Request URL not provided during authentication callback.')); - return res.end('Request URL not provided during authentication callback.'); - } + private async startServerAsync(): Promise { + const { parse, createServer } = this.dependencies; + return new Promise((resolve, reject) => { + if (server) { reject(new Error('Server already started')); } - // Check for favicon.ico and do nothing. - if (req.url.includes('/favicon.ico')) { - // eslint-disable-next-line @typescript-eslint/naming-convention - res.writeHead(200, {'Content-Type': 'image/x-icon'}); - res.end(); - return; - } + server = createServer(async (req, res) => { + if (!req.url) { + reject(new Error('Request URL not provided during authentication callback.')); + return res.end('Request URL not provided during authentication callback.'); + } - const parsedUrl = parse(req.url); - const parsedQuery = parseQuery(parsedUrl.query || ''); + // Check for favicon.ico and do nothing. + if (req.url.includes('/favicon.ico')) { + res.writeHead(200, { 'Content-Type': 'image/x-icon' }); + res.end(); + return; + } - if (!parsedQuery.code) { - reject(new Error('Callback does not contain a code.')); - return res.end('Callback does not contain a code.'); - } + const parsedUrl = parse(req.url, true); + const parsedQuery = parsedUrl.query; - const authorizationCode = Array.isArray(parsedQuery.code) ? parsedQuery.code[0] : parsedQuery.code; - res.end('Received the callback. You may close this page.'); + if (!parsedQuery.code) { + reject(new Error('Callback does not contain a code.')); + return res.end('Callback does not contain a code.'); + } - server?.close(); - server = null; + const authorizationCode = Array.isArray(parsedQuery.code) ? parsedQuery.code[0] : parsedQuery.code; + res.end('Received the callback. You may close this page.'); - try { - const token = await exchangeAuthorizationCode(authorizationCode); - resolve(token); - } catch (error) { - reject(error); - } - return; - }); + server?.close(); + server = null; - server.on('error', err => { - console.error(`Server error: ${err.message}`); - reject(err); - }); + try { + const token = await this.exchangeAuthorizationCodeAsync(authorizationCode); + resolve(token); + } catch (error) { + reject(error); + } + return; + }); + + server.on('error', err => { + console.error(`Server error: ${err.message}`); + reject(err); + }); + + // Start server + server.listen(parseInt(parsedUri.port, 10), parsedUri.hostname, () => { + // Server is now listening + }); - // Start server - server.listen(parseInt(parsedUri.port, 10), parsedUri.hostname, () => { - // Server is now listening + // Optionally add a timeout to reject the promise if it takes too long + setTimeout(() => { + reject(new Error('Authorization timed out')); + server?.close(); + server = null; + }, 60000); // e.g., 60 seconds }); + } + private async exchangeAuthorizationCodeAsync(authorizationCode: string): Promise { + if (!this.clientMetadata) { + throw new Error("Client metadata not initialized"); + } - // Optionally add a timeout to reject the promise if it takes too long - setTimeout(() => { - reject(new Error('Authorization timed out')); - server?.close(); - server = null; - }, 60000); // e.g., 60 seconds - }); -} + const { Issuer } = this.dependencies; + const superOfficeIssuer = await Issuer.discover(`https://${this.environment}.superoffice.com/login/.well-known/openid-configuration`); -async function exchangeAuthorizationCode(authorizationCode: string): Promise { - if (!superOfficeIssuer) { - throw new Error("Issuer not initialized"); + const client = new superOfficeIssuer.Client(this.clientMetadata); + try { + return await client.callback(this.clientMetadata.redirect_uri as string, { code: authorizationCode }, { code_verifier: codeVerifier }) as TokenSet; + } catch (error) { + if (error instanceof Error) { + throw new Error("Error obtaining token: " + error.message); + } else { + throw new Error("Error obtaining token: " + String(error)); + } + } } - - const client = new superOfficeIssuer.Client(clientMetadata); - try { - // eslint-disable-next-line @typescript-eslint/naming-convention - return await client.callback(redirectUri, { code: authorizationCode }, { code_verifier: codeVerifier }) as TokenSet; - } - catch (error) { + + private handleAuthorizeRequestError(error: unknown): void { if (error instanceof Error) { - throw new Error("Error obtaining token: " + error.message); + this.dependencies.vscode.window.showErrorMessage('Failed to open URL: ' + error.message); } else { - throw new Error("Error obtaining token: " + String(error)); + console.error(error); } } -} -export async function exchangeRefreshToken(session: SuperOfficeAuthenticationSession): Promise { - const url = new URL(`${(session.claims as UserClaims)['http://schemes.superoffice.net/identity/webapi_url']}`); - if(!superOfficeIssuer){ - superOfficeIssuer = await Issuer.discover(`${url.hostname}/login/.well-known/openid-configuration`); + public getEnvironment(): string { + return this.environment; } - const client = new superOfficeIssuer.Client(clientMetadata); - try { - if(session.refreshToken !== undefined){ - return await client.refresh(session.refreshToken); - } - } catch (err) { - if (err instanceof Error) { - throw new Error("Error refreshing token: " + err.message); - } else { - throw new Error("Error refreshing token: " + String(err)); - } + + public getClientId(): string { + return this.clientId; } } -function handleAuthorizeRequestError(error: unknown): void { - if (error instanceof Error) { - vscode.window.showErrorMessage('Failed to open URL: ' + error.message); - } else { - console.error(error); - } -} \ No newline at end of file +/* eslint-enable @typescript-eslint/naming-convention */ + +// export const authenticate = async (environment: string): Promise => { +// try { +// const suoFile = await readFile(CONFIG_AUTHSERVICE.REDIRECT_URI); +// if (!suoFile) { +// throw new Error('No suo file found'); +// } + +// const url = await generateAuthorizeUrl(environment); +// await vscode.env.openExternal(vscode.Uri.parse(url)); +// return await startServer(); +// } catch (error) { +// handleAuthorizeRequestError(error); +// throw error; +// } +// }; + +// async function generateAuthorizeUrl(environment: string): Promise { +// if (!['sod', 'online'].includes(environment)) { +// throw new Error(`Invalid environment: ${environment}`); +// } + +// superOfficeIssuer = await Issuer.discover(`https://${environment}.superoffice.com/login/.well-known/openid-configuration`); + +// const client = new superOfficeIssuer.Client(this.clientMetadata); +// const state = generators.state(); + +// codeVerifier = generators.codeVerifier(); +// const codeChallenge = generators.codeChallenge(codeVerifier); + +// /* eslint-disable @typescript-eslint/naming-convention */ +// const url = client.authorizationUrl({ +// scope: 'openid', +// state, +// code_challenge: codeChallenge, +// code_challenge_method: 'S256' +// }); +// /* eslint-enable @typescript-eslint/naming-convention */ +// return url; +// } + +// function startServer(): Promise { +// return new Promise((resolve, reject) => { +// if (server) { reject(new Error('Server already started')); } + +// server = createServer(async (req, res) => { +// if (!req.url) { +// reject(new Error('Request URL not provided during authentication callback.')); +// return res.end('Request URL not provided during authentication callback.'); +// } + +// // Check for favicon.ico and do nothing. +// if (req.url.includes('/favicon.ico')) { +// // eslint-disable-next-line @typescript-eslint/naming-convention +// res.writeHead(200, { 'Content-Type': 'image/x-icon' }); +// res.end(); +// return; +// } + +// const parsedUrl = parse(req.url); +// const parsedQuery = parseQuery(parsedUrl.query || ''); + +// if (!parsedQuery.code) { +// reject(new Error('Callback does not contain a code.')); +// return res.end('Callback does not contain a code.'); +// } + +// const authorizationCode = Array.isArray(parsedQuery.code) ? parsedQuery.code[0] : parsedQuery.code; +// res.end('Received the callback. You may close this page.'); + +// server?.close(); +// server = null; + +// try { +// const token = await exchangeAuthorizationCode(authorizationCode); +// resolve(token); +// } catch (error) { +// reject(error); +// } +// return; +// }); + +// server.on('error', err => { +// console.error(`Server error: ${err.message}`); +// reject(err); +// }); + +// // Start server +// server.listen(parseInt(parsedUri.port, 10), parsedUri.hostname, () => { +// // Server is now listening +// }); + +// // Optionally add a timeout to reject the promise if it takes too long +// setTimeout(() => { +// reject(new Error('Authorization timed out')); +// server?.close(); +// server = null; +// }, 60000); // e.g., 60 seconds +// }); +// } + +// export async function exchangeAuthorizationCode(authorizationCode: string): Promise { +// if (!superOfficeIssuer) { +// throw new Error("Issuer not initialized"); +// } + +// const client = new superOfficeIssuer.Client(clientMetadata); +// try { +// // eslint-disable-next-line @typescript-eslint/naming-convention +// return await client.callback(redirectUri, { code: authorizationCode }, { code_verifier: codeVerifier }) as TokenSet; +// } +// catch (error) { +// if (error instanceof Error) { +// throw new Error("Error obtaining token: " + error.message); +// } else { +// throw new Error("Error obtaining token: " + String(error)); +// } +// } +// } + +// export async function exchangeRefreshToken(session: SuperOfficeAuthenticationSession): Promise { +// const url = new URL(`${(session.claims as UserClaims)['http://schemes.superoffice.net/identity/webapi_url']}`); +// if (!superOfficeIssuer) { +// superOfficeIssuer = await Issuer.discover(`${url.hostname}/login/.well-known/openid-configuration`); +// } +// const client = new superOfficeIssuer.Client(clientMetadata); +// try { +// if (session.refreshToken !== undefined) { +// return await client.refresh(session.refreshToken); +// } +// } catch (err) { +// if (err instanceof Error) { +// throw new Error("Error refreshing token: " + err.message); +// } else { +// throw new Error("Error refreshing token: " + String(err)); +// } +// } +// } + +// function handleAuthorizeRequestError(error: unknown): void { +// if (error instanceof Error) { +// vscode.window.showErrorMessage('Failed to open URL: ' + error.message); +// } else { +// console.error(error); +// } +// } \ No newline at end of file diff --git a/packages/vscode/src/services/httpService.ts b/packages/vscode/src/services/httpService.ts index cf5ea35..4f7661f 100644 --- a/packages/vscode/src/services/httpService.ts +++ b/packages/vscode/src/services/httpService.ts @@ -2,7 +2,7 @@ import { HttpRequestResponse } from "../types"; import * as https from 'https'; import * as http from 'http'; import { currentSession as session } from "../providers/authenticationProvider"; - +//TODO: Refactor httpService to be a class, like the others export async function httpAuthenticatedRequestAsync(path: string, method: https.RequestOptions["method"], body?: object): Promise> { if (!session) { throw new Error("No session found"); diff --git a/packages/vscode/src/services/scriptService.ts b/packages/vscode/src/services/scriptService.ts index d37a386..05aaee2 100644 --- a/packages/vscode/src/services/scriptService.ts +++ b/packages/vscode/src/services/scriptService.ts @@ -1,71 +1,93 @@ import { httpAuthenticatedRequestAsync } from "./httpService"; -import { ExecuteScriptResponse, ScriptEntity, ScriptInfoArray } from "../types"; +import { ScriptEntity, ScriptInfoArray } from "../types"; import { CONFIG_SCRIPTSERVICE } from '../config'; import * as https from 'https'; -import { joinPaths, writeFile } from "../workspace/fileSystemHandler"; -import { Uri } from "vscode"; -import { Node } from "../providers/treeViewDataProvider"; -// Helper function for error checking and response extraction -const fetchAndCheckAsync = async (endpoint: string, method: https.RequestOptions["method"], errorMessagePrefix: string, body?: object): Promise => { - const response = await httpAuthenticatedRequestAsync(endpoint, method, body); - if (!response.ok) { - throw new Error(`${errorMessagePrefix}: ${response.statusText}`); +export interface IScriptService { + getAllScriptInfoAsync(): Promise; +} + +export class ScriptService implements IScriptService { + constructor() {} + + // Helper function for error checking and response extraction + private async fetchAndCheckAsync(endpoint: string, method: https.RequestOptions["method"], errorMessagePrefix: string, body?: object): Promise { + const response = await httpAuthenticatedRequestAsync(endpoint, method, body); + if (!response.ok) { + throw new Error(`${errorMessagePrefix}: ${response.statusText}`); + } + return response.body; } - return response.body; -}; -export const getAllScriptInfoAsync = async (): Promise => { - return fetchAndCheckAsync(CONFIG_SCRIPTSERVICE.SCRIPT_ENDPOINT_URI, 'GET', 'Failed to get script info'); -}; + public async getAllScriptInfoAsync(): Promise { + return await this.fetchAndCheckAsync(CONFIG_SCRIPTSERVICE.SCRIPT_ENDPOINT_URI, 'GET', 'Failed to get script info'); + } -export const getScriptEntityAsync = async (uniqueIdentifier: string): Promise => { - return fetchAndCheckAsync(`${CONFIG_SCRIPTSERVICE.SCRIPT_ENDPOINT_URI}${uniqueIdentifier}`, 'GET', 'Failed to get script entity'); -}; + public async getScriptEntityAsync(uniqueIdentifier: string): Promise { + return await this.fetchAndCheckAsync(`${CONFIG_SCRIPTSERVICE.SCRIPT_ENDPOINT_URI}${uniqueIdentifier}`, 'GET', 'Failed to get script entity'); + } +} -export const executeScriptAsync = async (script: string): Promise => { - const payload = { - script: script, - parameters: { - "parameters1": "mandatory" - } - }; - return fetchAndCheckAsync(CONFIG_SCRIPTSERVICE.EXECUTESCRIPT_ENDPOINT_URI, 'POST', 'Failed to execute script', payload); -}; +// // Helper function for error checking and response extraction +// const fetchAndCheckAsync = async (endpoint: string, method: https.RequestOptions["method"], errorMessagePrefix: string, body?: object): Promise => { +// const response = await httpAuthenticatedRequestAsync(endpoint, method, body); +// if (!response.ok) { +// throw new Error(`${errorMessagePrefix}: ${response.statusText}`); +// } +// return response.body; +// }; -// export const executeScriptLocallyAsync = async (script: string): Promise => { +// export const getAllScriptInfoAsync = async (): Promise => { +// return fetchAndCheckAsync(CONFIG_SCRIPTSERVICE.SCRIPT_ENDPOINT_URI, 'GET', 'Failed to get script info'); +// }; + +// export const getScriptEntityAsync = async (uniqueIdentifier: string): Promise => { +// return fetchAndCheckAsync(`${CONFIG_SCRIPTSERVICE.SCRIPT_ENDPOINT_URI}${uniqueIdentifier}`, 'GET', 'Failed to get script entity'); +// }; + +// export const executeScriptAsync = async (script: string): Promise => { // const payload = { -// scriptbody: script, -// parameters: "", -// eventData: "" +// script: script, +// parameters: { +// "parameters1": "mandatory" +// } // }; -// return fetchAndCheckAsync(CONFIG_SCRIPTSERVICE.EXECUTESCRIPT_ENDPOINT_URI, 'POST', 'Failed to execute script', payload); +// return fetchAndCheckAsync(CONFIG_SCRIPTSERVICE.EXECUTESCRIPT_ENDPOINT_URI, 'POST', 'Failed to execute script', payload); // }; +// // export const executeScriptLocallyAsync = async (script: string): Promise => { +// // const payload = { +// // scriptbody: script, +// // parameters: "", +// // eventData: "" +// // }; +// // return fetchAndCheckAsync(CONFIG_SCRIPTSERVICE.EXECUTESCRIPT_ENDPOINT_URI, 'POST', 'Failed to execute script', payload); +// // }; -export const downloadScriptAsync = async (uniqueIdentifier: string): Promise => { - const scriptEntity = await getScriptEntityAsync(uniqueIdentifier); - const filePath = joinPaths(scriptEntity.Path, scriptEntity.Name + ".jsfso"); - return await writeFile(filePath, scriptEntity.Source); -}; -export const downloadScriptFolderAsync = async (folder: Node): Promise => { - try{ - folder.children?.forEach(async (childNode) => { - if(childNode.contextValue === 'folder') { - await downloadScriptFolderAsync(childNode); - } - else if(childNode.contextValue === 'script') { - if(childNode.scriptInfo === undefined) { - console.log(`superoffice-vscode: Could not find scriptInfo for ${childNode.label}`); - return; - } - await downloadScriptAsync(childNode.scriptInfo.uniqueIdentifier); - console.log(`superoffice-vscode: Downloaded script: ${childNode.scriptInfo.name}`); - } - }); - } - catch (err) { - throw new Error(`Failed to download scriptFolder: ${err}`); - } -}; \ No newline at end of file +// export const downloadScriptAsync = async (uniqueIdentifier: string): Promise => { +// const scriptEntity = await getScriptEntityAsync(uniqueIdentifier); +// const filePath = joinPaths(scriptEntity.Path, scriptEntity.Name + ".jsfso"); +// return await writeFile(filePath, scriptEntity.Source); +// }; + +// export const downloadScriptFolderAsync = async (folder: Node): Promise => { +// try { +// folder.children?.forEach(async (childNode) => { +// if (childNode.contextValue === 'folder') { +// await downloadScriptFolderAsync(childNode); +// } +// else if (childNode.contextValue === 'script') { +// if (childNode.scriptInfo === undefined) { +// console.log(`superoffice-vscode: Could not find scriptInfo for ${childNode.label}`); +// return; +// } +// await downloadScriptAsync(childNode.scriptInfo.uniqueIdentifier); +// console.log(`superoffice-vscode: Downloaded script: ${childNode.scriptInfo.name}`); +// } +// }); +// } +// catch (err) { +// throw new Error(`Failed to download scriptFolder: ${err}`); +// } +// }; \ No newline at end of file diff --git a/packages/vscode/src/services/systemService.ts b/packages/vscode/src/services/systemService.ts index 6cd7930..4e31d30 100644 --- a/packages/vscode/src/services/systemService.ts +++ b/packages/vscode/src/services/systemService.ts @@ -1,7 +1,7 @@ import { StateResponse } from "../types"; import { httpPublicRequestAsync } from "./httpService"; import { CONFIG_SYSTEMSERVICE } from '../config'; - +//TODO: Refactor this to be a class, like the others export const getTenantStateAsync = async (environment: string, contextIdentifier: string): Promise => { const response = await httpPublicRequestAsync('GET', CONFIG_SYSTEMSERVICE.STATE_URI_TEMPLATE(environment, contextIdentifier)); diff --git a/packages/vscode/src/services/uriHandler.ts b/packages/vscode/src/services/uriHandler.ts new file mode 100644 index 0000000..a6c310a --- /dev/null +++ b/packages/vscode/src/services/uriHandler.ts @@ -0,0 +1,12 @@ +import * as vscode from 'vscode'; +// Our implementation of a UriHandler. +export class SuperOfficeUriHandler implements vscode.UriHandler { + private _emitter = new vscode.EventEmitter(); + public readonly onDidReceiveUri: vscode.Event = this._emitter.event; + async handleUri(uri: vscode.Uri): Promise { + this._emitter.fire(uri); + } +} + +// Instantiate and export the handler +export const superOfficeUriHandler = new SuperOfficeUriHandler(); \ No newline at end of file diff --git a/packages/vscode/src/types.ts b/packages/vscode/src/types.ts index 3e52dc0..843b1e4 100644 --- a/packages/vscode/src/types.ts +++ b/packages/vscode/src/types.ts @@ -101,6 +101,8 @@ export interface SuperOfficeAuthenticationSession extends AuthenticationSession export type SuoFile = { contextIdentifier: string; + clientId: string; + environment: string; }; export type NodeRequest = { diff --git a/packages/vscode/src/workspace/fileSystemHandler.ts b/packages/vscode/src/workspace/fileSystemHandler.ts index c60fd49..ecff0bc 100644 --- a/packages/vscode/src/workspace/fileSystemHandler.ts +++ b/packages/vscode/src/workspace/fileSystemHandler.ts @@ -1,86 +1,114 @@ import * as vscode from 'vscode'; import { SuoFile } from '../types'; -import { CONFIG_FILESYSTEMHANDLER } from '../config'; - -export function joinPaths(part1: string, part2: string): string { - return `${part1.replace(/\/$/, '')}/${part2.replace(/^\//, '')}`; +import { CONFIG } from '../config'; +//TODO: Move this to a service instead? +export interface IFileSystemHandler { + writeFileAsync(relativePath: string, content: string): Promise; + createFolderAsync(folderPath: vscode.Uri): Promise; + readSuoFileAsync(): Promise; + writeSuoFileAsync(content: string): Promise; } -/** - * Get the full URI for a file located within the current workspace. - * - * @param relativePath The relative path to the desired file within the workspace. - * @returns The full URI pointing to the file in the current workspace. - * @throws {Error} If there's no workspace currently opened in VSCode. - */ -export function getFileUriInWorkspace(relativePath: string): vscode.Uri { - const workspaceFolder = vscode.workspace.workspaceFolders?.[0]; +export class FileSystemHandler implements IFileSystemHandler { + constructor() { } + + /** + * Get the full URI for a file located within the current workspace. + * + * @param relativePath The relative path to the desired file within the workspace. + * @returns The full URI pointing to the file in the current workspace. + * @throws {Error} If there's no workspace currently opened in VSCode. + */ + private getFileUriInWorkspace(relativePath: string): vscode.Uri { + const workspaceFolder = vscode.workspace.workspaceFolders?.[0]; - if (!workspaceFolder) { - throw new Error("No workspace is currently open."); + if (!workspaceFolder) { + throw new Error("No workspace is currently open."); + } + + return vscode.Uri.joinPath(workspaceFolder.uri, relativePath); } - return vscode.Uri.joinPath(workspaceFolder.uri, relativePath); -} + public async readFileAsync(relativePath: string): Promise { + try { + const data = await vscode.workspace.fs.readFile(this.getFileUriInWorkspace(relativePath)); + return data; + } catch (error) { + if (error instanceof vscode.FileSystemError) { + throw new Error(`Failed to read file: ${relativePath}. Reason: ${error.message}`); + } + throw new Error(`An unexpected error occurred while reading file: ${relativePath}`); + } + } + + // Write file to relativePath + public async writeFileAsync(relativePath: string, content: string): Promise { + const fileUri = this.getFileUriInWorkspace(relativePath); + const dirUri = fileUri.with({ path: fileUri.path.replace(/\/[^/]+$/, '') }); // remove the last segment of the path to get the directory -// Ensure directory exists -async function ensureDirectoryExists(uri: vscode.Uri): Promise { - try { - await vscode.workspace.fs.stat(uri); - } catch (error) { - if (error instanceof vscode.FileSystemError && error.code === 'FileNotFound') { - const parentUri = vscode.Uri.joinPath(uri, '..'); - await ensureDirectoryExists(parentUri); - await vscode.workspace.fs.createDirectory(uri); - } else { - throw error; + // Ensure directory structure exists + await this.ensureDirectoryExistsAsync(dirUri); + + try { + const data = Buffer.from(content); + await vscode.workspace.fs.writeFile(fileUri, data); + return fileUri; + } catch (error) { + if (error instanceof vscode.FileSystemError) { + throw new Error(`Failed to write to file: ${relativePath}. Reason: ${error.message}`); + } + throw new Error(`An unexpected error occurred while writing to file: ${relativePath}`); } } -} -// Read file from relativePath -export async function readFile(relativePath: string): Promise { - try { - const data = await vscode.workspace.fs.readFile(getFileUriInWorkspace(relativePath)); - return data.toString(); - } catch (error) { - if (error instanceof vscode.FileSystemError) { - throw new Error(`Failed to read file: ${relativePath}. Reason: ${error.message}`); + public async createFolderAsync(folderPath: vscode.Uri): Promise { + try { + await vscode.workspace.fs.createDirectory(folderPath); + } catch (error) { + throw new Error(`Error creating folder ${folderPath}: ${error}`); } - throw new Error(`An unexpected error occurred while reading file: ${relativePath}`); } -} -// Write file to relativePath -export async function writeFile(relativePath: string, content: string): Promise { - const fileUri = getFileUriInWorkspace(relativePath); - const dirUri = fileUri.with({ path: fileUri.path.replace(/\/[^/]+$/, '') }); // remove the last segment of the path to get the directory + private async ensureDirectoryExistsAsync(folderPath: vscode.Uri): Promise { + try { + await vscode.workspace.fs.stat(folderPath); + } catch (error) { + if (error instanceof vscode.FileSystemError && error.code === 'FileNotFound') { + const parentUri = vscode.Uri.joinPath(folderPath, '..'); + await this.ensureDirectoryExistsAsync(parentUri); + await vscode.workspace.fs.createDirectory(folderPath); + } else { + throw error; + } + } + } - // Ensure directory structure exists - await ensureDirectoryExists(dirUri); + public async readSuoFileAsync(): Promise { + try { + const suoFileContent = await this.readFileAsync(CONFIG.SUOFILE_PATH); + const suoFile = JSON.parse(suoFileContent.toString()); + // Validate manually + this.validateSuoFile(suoFile); - try { - const data = Buffer.from(content); - await vscode.workspace.fs.writeFile(fileUri, data); - return fileUri; - } catch (error) { - if (error instanceof vscode.FileSystemError) { - throw new Error(`Failed to write to file: ${relativePath}. Reason: ${error.message}`); + return JSON.parse(suoFileContent.toString()) as SuoFile; + } catch (error) { + throw new Error(`Error reading or parsing suoFile ${CONFIG.SUOFILE_PATH}: ${error}`); } - throw new Error(`An unexpected error occurred while writing to file: ${relativePath}`); } -} -export async function getSuoFile() : Promise { - try { - const suoFile = await readFile(CONFIG_FILESYSTEMHANDLER.SUOFILE_PATH); - return JSON.parse(suoFile); - } - catch(error){ - throw new Error('No suo file found: ' + error); + public async writeSuoFileAsync(content: string): Promise { + return await this.writeFileAsync(CONFIG.SUOFILE_PATH, content); } -} -export async function writeSuoFile(content: string) : Promise { - return await writeFile(CONFIG_FILESYSTEMHANDLER.SUOFILE_PATH, content); + private validateSuoFile(suoFile: SuoFile): void { + if (typeof suoFile.clientId !== 'string') { + throw new Error("Invalid suoFile: 'clientId' is required and must be a string."); + } + if (typeof suoFile.contextIdentifier !== 'string') { + throw new Error("Invalid suoFile: 'contextIdentifier' is required and must be a string."); + } + if (typeof suoFile.environment !== 'string') { + throw new Error("Invalid suoFile: 'environment' is required and must be a string."); + } + } } \ No newline at end of file diff --git a/packages/vscode/src/workspace/virtualWorkspaceFileManager.ts b/packages/vscode/src/workspace/virtualWorkspaceFileManager.ts index 15674b7..0e294d3 100644 --- a/packages/vscode/src/workspace/virtualWorkspaceFileManager.ts +++ b/packages/vscode/src/workspace/virtualWorkspaceFileManager.ts @@ -1,5 +1,5 @@ import * as vscode from 'vscode'; - +//TODO: Refactor this to be a class, like the others export class VirtualFileSystemProvider implements vscode.FileSystemProvider { private _onDidChangeFile: vscode.EventEmitter = new vscode.EventEmitter(); readonly onDidChangeFile: vscode.Event = this._onDidChangeFile.event; diff --git a/packages/vscode/syntaxes/crmscript-definition.tmLanguage.json b/packages/vscode/syntaxes/crmscript-definition.tmLanguage.json new file mode 100644 index 0000000..22a5b5e --- /dev/null +++ b/packages/vscode/syntaxes/crmscript-definition.tmLanguage.json @@ -0,0 +1,61 @@ +{ + "name": "crmscript-definition", + "scopeName": "source.crmscript-definition", + "fileTypes": [ + ".crmscript-definition" + ], + "patterns": [ + { + "include": "#comments" + }, + { + "name": "keyword.control.crmscript-definition", + "match": "\\b(and|class|else|false|for|fun|if|nil|or|print|return|super|this|true|while)\\b" + }, + { + "name": "string.quoted.double.crmscript-definition", + "begin": "\"", + "end": "\"", + "patterns": [ + { + "include": "#string-character-escape" + } + ] + } + ], + "repository": { + "comments": { + "patterns": [ + { + "name": "comment.block.crmscript-definition", + "begin": "/\\*", + "beginCaptures": { + "0": { + "name": "punctuation.definition.comment.crmscript-definition" + } + }, + "end": "\\*/", + "endCaptures": { + "0": { + "name": "punctuation.definition.comment.crmscript-definition" + } + } + }, + { + "begin": "//", + "beginCaptures": { + "1": { + "name": "punctuation.whitespace.comment.leading.crmscript-definition" + } + }, + "end": "(?=$)", + "name": "comment.line.crmscript-definition" + } + ] + }, + "string-character-escape": { + "name": "constant.character.escape.crmscript-definition", + "match": "\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|u\\{[0-9A-Fa-f]+\\}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.|$)" + } + } +} diff --git a/packages/vscode/syntaxes/crmscript.tmLanguage.json b/packages/vscode/syntaxes/crmscript-implementation.tmLanguage.json similarity index 58% rename from packages/vscode/syntaxes/crmscript.tmLanguage.json rename to packages/vscode/syntaxes/crmscript-implementation.tmLanguage.json index b7a0a5c..48594d7 100644 --- a/packages/vscode/syntaxes/crmscript.tmLanguage.json +++ b/packages/vscode/syntaxes/crmscript-implementation.tmLanguage.json @@ -1,6 +1,6 @@ { - "name": "crmscript", - "scopeName": "source.crmscript", + "name": "crmscript-implementation", + "scopeName": "source.crmscript-implementation", "fileTypes": [ ".crmscript" ], @@ -9,11 +9,11 @@ "include": "#comments" }, { - "name": "keyword.control.crmscript", - "match": "\\b(Integer|String|for|to)\\b" + "name": "keyword.control.crmscript-implementation", + "match": "\\b(and|false|nil|or|super|this|true)\\b" }, { - "name": "string.quoted.double.crmscript", + "name": "string.quoted.double.crmscript-implementation", "begin": "\"", "end": "\"", "patterns": [ @@ -21,33 +21,23 @@ "include": "#string-character-escape" } ] - }, - { - "name": "string.quoted.single.crmscript", - "begin": "'", - "end": "'", - "patterns": [ - { - "include": "#string-character-escape" - } - ] } ], "repository": { "comments": { "patterns": [ { - "name": "comment.block.crmscript", + "name": "comment.block.crmscript-implementation", "begin": "/\\*", "beginCaptures": { "0": { - "name": "punctuation.definition.comment.crmscript" + "name": "punctuation.definition.comment.crmscript-implementation" } }, "end": "\\*/", "endCaptures": { "0": { - "name": "punctuation.definition.comment.crmscript" + "name": "punctuation.definition.comment.crmscript-implementation" } } }, @@ -55,16 +45,16 @@ "begin": "//", "beginCaptures": { "1": { - "name": "punctuation.whitespace.comment.leading.crmscript" + "name": "punctuation.whitespace.comment.leading.crmscript-implementation" } }, "end": "(?=$)", - "name": "comment.line.crmscript" + "name": "comment.line.crmscript-implementation" } ] }, "string-character-escape": { - "name": "constant.character.escape.crmscript", + "name": "constant.character.escape.crmscript-implementation", "match": "\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|u\\{[0-9A-Fa-f]+\\}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.|$)" } } diff --git a/test/.superoffice/.suo b/test/.superoffice/.suo index 9e26dfe..f56800c 100644 --- a/test/.superoffice/.suo +++ b/test/.superoffice/.suo @@ -1 +1 @@ -{} \ No newline at end of file +{"contextIdentifier":"Cust31038","environment":"sod","clientId":"1a5764a8090f136cc9d30f381626d5fa"} \ No newline at end of file diff --git a/test/.vscode/settings.json b/test/.vscode/settings.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/test/.vscode/settings.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/test/basic-sample.crmscript b/test/basic-sample.crmscript index 535fa8e..43fd899 100644 --- a/test/basic-sample.crmscript +++ b/test/basic-sample.crmscript @@ -25,17 +25,10 @@ Integer i = 213213; for(Integer i = 0; i > 20; i++){ Integer j = i + 20; - String bla = "123"; + String bla = "123" + 20; } -class Customer { - String name; - Integer age; - Bool isVip; - DateTime lastVisit; -} - try{ } @@ -44,3 +37,26 @@ catch(exception){ } +/** Hover*/ +class CustomClass { + String customerString; + Integer customerInteger; + Integer myFunction(){ + + return 123; + } +} + +struct myStruct { + String structString; + Integer structInt; + Customer cust; + + String myFunction(){ + this. + return "123"; + } +}; + +Customer c; + diff --git a/test/embedded-sample.crmscript b/test/embedded-sample.crmscript-definition similarity index 100% rename from test/embedded-sample.crmscript rename to test/embedded-sample.crmscript-definition diff --git a/test/test.crmscript b/test/test.crmscript deleted file mode 100644 index e69de29..0000000 diff --git a/test/test.crmscript-definition b/test/test.crmscript-definition new file mode 100644 index 0000000..7339f1d --- /dev/null +++ b/test/test.crmscript-definition @@ -0,0 +1,25 @@ +/** +# String + +Summary goes here. + +I just love **bold text**. + +```crmscript + +String something = "Hello"; + +``` + +*/ +class String { + /** innerHover*/ + String firstName; +} + +/** IntHover*/ +class Integer { + +} +String temp = ""; +temp.firstName = 123; \ No newline at end of file