diff --git a/.eslintrc.json b/.eslintrc.json index a1baa27..34be4a3 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -19,7 +19,7 @@ ], "rules": { "indent": "off", - "@typescript-eslint/indent": ["error"], + "@typescript-eslint/indent": ["off", {}], "linebreak-style": [ "error", "unix" diff --git a/.gitignore b/.gitignore index 5599811..1616b97 100644 --- a/.gitignore +++ b/.gitignore @@ -15,4 +15,16 @@ coverage packages/tonto-vscode/data/tonto-tmLanguage.json -**/tonto_dependencies \ No newline at end of file +**/tonto_dependencies + +.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/.vscode/launch.json b/.vscode/launch.json index 528cac3..8e8eba9 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -116,12 +116,7 @@ "skipFiles": [ "/**" ], - "sourceMaps": true, - "outFiles": [ - "${workspaceFolder}/packages/tonto/lib/**/*.js", - "${workspaceFolder}/packages/tonto/lib/cli/**/*.js", - "${workspaceFolder}/packages/tonto-vscode/out/**/*.js" - ] + "sourceMaps": true }, { "name": "Attach to CLI", diff --git a/examples/newGeneration/tokens.tonto b/examples/newGeneration/tokens.tonto new file mode 100644 index 0000000..aeed8e0 --- /dev/null +++ b/examples/newGeneration/tokens.tonto @@ -0,0 +1,10 @@ + package CheckGeneralizationConsistency + kind Person + role Doctor specializes Person + + relation Doctor -- treats -- Person + + genset GeneralizationSet { + general Person + specifics Doctor.treats + } \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 89c4f52..ad2adaa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "tonto-workspaces", - "version": "0.3.0", + "version": "0.3.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "tonto-workspaces", - "version": "0.3.0", + "version": "0.3.3", "license": "MIT", "workspaces": [ "packages/tonto", @@ -253,6 +253,137 @@ "resolved": "https://registry.npmjs.org/@chevrotain/utils/-/utils-10.4.2.tgz", "integrity": "sha512-V34dacxWLwKcvcy32dx96ADJVdB7kOJLm7LyBkBQw5u5HC9WdEFw2G17zml+U3ivavGTrGPJHl8o9/UJm0PlUw==" }, + "node_modules/@codingame/monaco-vscode-base-service-override": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/@codingame/monaco-vscode-base-service-override/-/monaco-vscode-base-service-override-3.2.3.tgz", + "integrity": "sha512-OHVtyMIbcFPC68Fv6jEg7p7MYIK9UzymnbwPRetuOHFj1xMALI7qkl9DH0czBBOZAk+4BttXqZLlJ9Ph3B4HHg==", + "dependencies": { + "vscode": "npm:@codingame/monaco-vscode-api@3.2.3" + } + }, + "node_modules/@codingame/monaco-vscode-configuration-service-override": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/@codingame/monaco-vscode-configuration-service-override/-/monaco-vscode-configuration-service-override-3.2.3.tgz", + "integrity": "sha512-IaJSGp7fIdPkk0apzlwx7QqjglhojsX2ej6Byd6TTWAI9mRxGJVWXnN9OJfuK3BjwNFTqd8QM9UMxJbt9Elutw==", + "dependencies": { + "@codingame/monaco-vscode-base-service-override": "3.2.3", + "@codingame/monaco-vscode-environment-service-override": "3.2.3", + "@codingame/monaco-vscode-extensions-service-override": "3.2.3", + "@codingame/monaco-vscode-files-service-override": "3.2.3", + "@codingame/monaco-vscode-host-service-override": "3.2.3", + "@codingame/monaco-vscode-layout-service-override": "3.2.3", + "@codingame/monaco-vscode-quickaccess-service-override": "3.2.3", + "vscode": "npm:@codingame/monaco-vscode-api@3.2.3" + } + }, + "node_modules/@codingame/monaco-vscode-editor-service-override": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/@codingame/monaco-vscode-editor-service-override/-/monaco-vscode-editor-service-override-3.2.3.tgz", + "integrity": "sha512-/h9lZbgXaui1GlRTkxehrbkTBFX/zOv+ywAb38liZUsmjqGjBfegATOHlzTmS48SkiokF1vvAZCBGmQCXHK6aQ==", + "dependencies": { + "vscode": "npm:@codingame/monaco-vscode-api@3.2.3" + } + }, + "node_modules/@codingame/monaco-vscode-environment-service-override": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/@codingame/monaco-vscode-environment-service-override/-/monaco-vscode-environment-service-override-3.2.3.tgz", + "integrity": "sha512-7YVJhS0RuKkrjwzz2ZKJeU98t29Yc2U/NfQfpTTbLfnZVBxPnC4Gbm59bRWswjtbBrIVpO5Dil+00o32HwXzyw==", + "dependencies": { + "vscode": "npm:@codingame/monaco-vscode-api@3.2.3" + } + }, + "node_modules/@codingame/monaco-vscode-extensions-service-override": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/@codingame/monaco-vscode-extensions-service-override/-/monaco-vscode-extensions-service-override-3.2.3.tgz", + "integrity": "sha512-YZfEmKaXyXh54rIJ/c9k+D1JeWfHiryW5UfuVgscmLS3QoiLsPRurfVBY4zIBN88rTQknOViqqW7llpnmaiFYQ==", + "dependencies": { + "@codingame/monaco-vscode-base-service-override": "3.2.3", + "@codingame/monaco-vscode-environment-service-override": "3.2.3", + "@codingame/monaco-vscode-extensions-service-override": "3.2.3", + "@codingame/monaco-vscode-files-service-override": "3.2.3", + "@codingame/monaco-vscode-host-service-override": "3.2.3", + "@codingame/monaco-vscode-layout-service-override": "3.2.3", + "@codingame/monaco-vscode-quickaccess-service-override": "3.2.3", + "vscode": "npm:@codingame/monaco-vscode-api@3.2.3" + } + }, + "node_modules/@codingame/monaco-vscode-files-service-override": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/@codingame/monaco-vscode-files-service-override/-/monaco-vscode-files-service-override-3.2.3.tgz", + "integrity": "sha512-M/yEyD4zSYt7eQISeH/OSUELxx7nXtmXIHjC9mQXBo0VD47nAgjy9Yo3vS1al3+Sz3j1Uj2je96x/6Q9zGwg4A==", + "dependencies": { + "vscode": "npm:@codingame/monaco-vscode-api@3.2.3" + } + }, + "node_modules/@codingame/monaco-vscode-host-service-override": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/@codingame/monaco-vscode-host-service-override/-/monaco-vscode-host-service-override-3.2.3.tgz", + "integrity": "sha512-zY54k4czioGczMOmWPF6aHx7jrHSnkU1D36MYyY3wrvFgI5diJCrCSz35VPf0WTlLh4OT1jJ+D9ufmJ1cn1moQ==", + "dependencies": { + "vscode": "npm:@codingame/monaco-vscode-api@3.2.3" + } + }, + "node_modules/@codingame/monaco-vscode-languages-service-override": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/@codingame/monaco-vscode-languages-service-override/-/monaco-vscode-languages-service-override-3.2.3.tgz", + "integrity": "sha512-EO3JDyqY1wNe/2NN1S8TmdHGr+H53UvvC+LWD/sUXyz21LqO1cK/bA7ZRNo0yTizYz080RYxBEzmVZ5UtPqkcg==", + "dependencies": { + "@codingame/monaco-vscode-files-service-override": "3.2.3", + "vscode": "npm:@codingame/monaco-vscode-api@3.2.3" + } + }, + "node_modules/@codingame/monaco-vscode-layout-service-override": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/@codingame/monaco-vscode-layout-service-override/-/monaco-vscode-layout-service-override-3.2.3.tgz", + "integrity": "sha512-ZMSjElmJdvMb4C7TJe71QJXvn4EZ8YvDGCNChuUHmbGfaX2MEmtMBvMjZH+z5RF5IA1Mtx6RztSBJHDhhYgjBA==", + "dependencies": { + "vscode": "npm:@codingame/monaco-vscode-api@3.2.3" + } + }, + "node_modules/@codingame/monaco-vscode-model-service-override": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/@codingame/monaco-vscode-model-service-override/-/monaco-vscode-model-service-override-3.2.3.tgz", + "integrity": "sha512-rpLIBbl5LL4bx8YooiosL+LbDpLO8S+Vs6EFW9n2yzTn1CA6BOY5I0ANNyBsfQ+Bw4jEzzSWnjVDgxfyRFVqZQ==", + "dependencies": { + "vscode": "npm:@codingame/monaco-vscode-api@3.2.3" + } + }, + "node_modules/@codingame/monaco-vscode-quickaccess-service-override": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/@codingame/monaco-vscode-quickaccess-service-override/-/monaco-vscode-quickaccess-service-override-3.2.3.tgz", + "integrity": "sha512-vr6l1tvA81yOfYKG5zdCaMoGeE7ruWXfISeQv8XcHpr1/VvxCdeBOi22GhRaomEKg9ioAqxzAe0WK8cS96ftIA==", + "dependencies": { + "vscode": "npm:@codingame/monaco-vscode-api@3.2.3" + } + }, + "node_modules/@codingame/monaco-vscode-textmate-service-override": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/@codingame/monaco-vscode-textmate-service-override/-/monaco-vscode-textmate-service-override-3.2.3.tgz", + "integrity": "sha512-7aPoDjjl/DWaiTN7YI9Sy9BPSCC0bWJgmFHJYuLIifrXGenP0iwnBTE+LpvDsAZdhFNRFapiEieW4ZjBYVU+VA==", + "dependencies": { + "@codingame/monaco-vscode-files-service-override": "3.2.3", + "vscode": "npm:@codingame/monaco-vscode-api@3.2.3", + "vscode-oniguruma": "1.7.0", + "vscode-textmate": "9.0.0" + } + }, + "node_modules/@codingame/monaco-vscode-theme-defaults-default-extension": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/@codingame/monaco-vscode-theme-defaults-default-extension/-/monaco-vscode-theme-defaults-default-extension-3.2.3.tgz", + "integrity": "sha512-kRAGOmV0Gn8juHL6CoLHJk/zep3KXsyiSakvj1gmuD1Q8pXNcvn2mI5BYURrVLDKpp/CFqkL3JWZYEI+MDgQDQ==", + "dependencies": { + "vscode": "npm:@codingame/monaco-vscode-api@3.2.3" + } + }, + "node_modules/@codingame/monaco-vscode-theme-service-override": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/@codingame/monaco-vscode-theme-service-override/-/monaco-vscode-theme-service-override-3.2.3.tgz", + "integrity": "sha512-ZxiHZh38ZgBRHzVDfdGJWzAbn1lLFgRBKSoQ3YxKI1DfHNK8vKdIXxORZVtN++8dPvXX5gDYcBrtO4vCPOWDpg==", + "dependencies": { + "@codingame/monaco-vscode-files-service-override": "3.2.3", + "vscode": "npm:@codingame/monaco-vscode-api@3.2.3" + } + }, "node_modules/@esbuild/aix-ppc64": { "version": "0.20.1", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.20.1.tgz", @@ -1481,9 +1612,9 @@ } }, "node_modules/@vitest/coverage-c8/node_modules/vite": { - "version": "3.2.8", - "resolved": "https://registry.npmjs.org/vite/-/vite-3.2.8.tgz", - "integrity": "sha512-EtQU16PLIJpAZol2cTLttNP1mX6L0SyI0pgQB1VOoWeQnMSvtiwovV3D6NcjN8CZQWWyESD2v5NGnpz5RvgOZA==", + "version": "3.2.10", + "resolved": "https://registry.npmjs.org/vite/-/vite-3.2.10.tgz", + "integrity": "sha512-Dx3olBo/ODNiMVk/cA5Yft9Ws+snLOXrhLtrI3F4XLt4syz2Yg8fayZMWScPKoz12v5BUv7VEmQHnsfpY80fYw==", "dev": true, "dependencies": { "esbuild": "^0.15.9", @@ -4391,34 +4522,6 @@ "chevrotain": "^11.0.0" } }, - "node_modules/langium/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/langium/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/langium/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/language-subtag-registry": { "version": "0.3.22", "resolved": "https://registry.npmjs.org/language-subtag-registry/-/language-subtag-registry-0.3.22.tgz", @@ -4703,136 +4806,615 @@ "ufo": "^1.3.2" } }, - "node_modules/mrmime": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/mrmime/-/mrmime-2.0.0.tgz", - "integrity": "sha512-eu38+hdgojoyq63s+yTpN4XMBdt5l8HhMhc4VKLO9KM5caLIBvUm4thi7fFaxyTmCKeNnXZ5pAlBwCUnhA09uw==", - "dev": true, - "engines": { - "node": ">=10" - } - }, - "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/monaco-editor": { + "version": "0.45.0", + "resolved": "https://registry.npmjs.org/monaco-editor/-/monaco-editor-0.45.0.tgz", + "integrity": "sha512-mjv1G1ZzfEE3k9HZN0dQ2olMdwIfaeAAjFiwNprLfYNRSz7ctv9XuCT7gPtBGrMUeV1/iZzYKj17Khu1hxoHOA==" }, - "node_modules/n3": { - "version": "1.17.2", - "resolved": "https://registry.npmjs.org/n3/-/n3-1.17.2.tgz", - "integrity": "sha512-BxSM52wYFqXrbQQT5WUEzKUn6qpYV+2L4XZLfn3Gblz2kwZ09S+QxC33WNdVEQy2djenFL8SNkrjejEKlvI6+Q==", + "node_modules/monaco-editor-workers": { + "version": "0.45.0", + "resolved": "https://registry.npmjs.org/monaco-editor-workers/-/monaco-editor-workers-0.45.0.tgz", + "integrity": "sha512-KSN7FXdehjwnu1JbpfERVP8KGqioXabNmpDfmh1P5RcG2k6OTAyh5cmLg55AsI/upzUqbEuq1F4NUh7mASsY9w==", "dependencies": { - "queue-microtask": "^1.1.2", - "readable-stream": "^4.0.0" + "monaco-editor": "~0.45.0" }, - "engines": { - "node": ">=12.0" + "peerDependencies": { + "monaco-editor": "~0.45.0" + } + }, + "node_modules/monaco-editor-wrapper": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/monaco-editor-wrapper/-/monaco-editor-wrapper-4.0.2.tgz", + "integrity": "sha512-T62aY/vQ9oqQoI7UiPHXsbUnhr4YBYTePoXUOvOaeJu0yeX8Vgbi1lfl5q3XNb8SLxCKLvEjsMYNvG/x6saF3w==", + "dependencies": { + "@codingame/monaco-vscode-configuration-service-override": "~3.2.3", + "@codingame/monaco-vscode-editor-service-override": "~3.2.3", + "@codingame/monaco-vscode-textmate-service-override": "~3.2.3", + "@codingame/monaco-vscode-theme-defaults-default-extension": "~3.2.3", + "@codingame/monaco-vscode-theme-service-override": "~3.2.3", + "esbuild": "~0.20.2", + "monaco-editor": "npm:@codingame/monaco-vscode-editor-api@~3.2.3", + "vscode": "npm:@codingame/monaco-vscode-api@~3.2.3", + "vscode-languageclient": "~9.0.1", + "vscode-languageserver-protocol": "~3.17.5", + "vscode-ws-jsonrpc": "~3.3.0" + }, + "peerDependencies": { + "monaco-editor": "npm:@codingame/monaco-vscode-editor-api@~3.2.3", + "monaco-languageclient": "~8.1.1", + "vscode": "npm:@codingame/monaco-vscode-api@~3.2.3" + }, + "peerDependenciesMeta": { + "monaco-editor": { + "optional": false + }, + "monaco-languageclient": { + "optional": false + }, + "vscode": { + "optional": false + } } }, - "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" - } + "node_modules/monaco-editor-wrapper/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" + ], + "optional": true, + "os": [ + "aix" ], - "bin": { - "nanoid": "bin/nanoid.cjs" - }, "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + "node": ">=12" } }, - "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/node-fetch-native": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/node-fetch-native/-/node-fetch-native-1.6.2.tgz", - "integrity": "sha512-69mtXOFZ6hSkYiXAVB5SqaRvrbITC/NPyqv7yuu/qw0nmgPyYbIMYYNIDhNtwPrzk0ptrimrLz/hhjvm4w5Z+w==" + "node_modules/monaco-editor-wrapper/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" + ], + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } }, - "node_modules/nomnoml": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/nomnoml/-/nomnoml-1.6.2.tgz", - "integrity": "sha512-R3dA3FS8txilobpd2ZdnCuEwmXYYljxza2wR41YE/cIHMbt0eXsjlXHlAsD+F/fVe536f0WkAQ+VQFRC3hPZCA==", - "dependencies": { - "graphre": "^0.1.3", - "nomnoml": "^1.5.3" - }, - "bin": { - "nomnoml": "dist/nomnoml-cli.js" + "node_modules/monaco-editor-wrapper/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" + ], + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" } }, - "node_modules/normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "node_modules/monaco-editor-wrapper/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" + ], + "optional": true, + "os": [ + "android" + ], "engines": { - "node": ">=0.10.0" + "node": ">=12" } }, - "node_modules/npm-run-path": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", - "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", - "dependencies": { - "path-key": "^3.0.0" - }, + "node_modules/monaco-editor-wrapper/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" + ], + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": ">=8" + "node": ">=12" } }, - "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/monaco-editor-wrapper/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" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" } }, - "node_modules/onchange": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/onchange/-/onchange-6.1.1.tgz", - "integrity": "sha512-G60OULp9Hi2dixPKYn/lfs7C8oDgFcneAhZ/4nPnvzd+Ar94q3FN0UG/t1zqXI15StSLvt7NlRqylamTSGhc4A==", - "dependencies": { - "@blakeembrey/deque": "^1.0.3", - "arrify": "^2.0.0", - "chokidar": "^3.0.0", - "cross-spawn": "^7.0.1", - "ignore": "^5.1.4", - "minimist": "^1.2.3", - "supports-color": "^7.0.0", - "tree-kill": "^1.2.2" - }, - "bin": { - "onchange": "cli.js" + "node_modules/monaco-editor-wrapper/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" + ], + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" } }, - "node_modules/onetime": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", - "dependencies": { - "mimic-fn": "^2.1.0" - }, + "node_modules/monaco-editor-wrapper/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" + ], + "optional": true, + "os": [ + "freebsd" + ], "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=12" } }, - "node_modules/ontouml-js": { - "version": "0.5.0", + "node_modules/monaco-editor-wrapper/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" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/monaco-editor-wrapper/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" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/monaco-editor-wrapper/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" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/monaco-editor-wrapper/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" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/monaco-editor-wrapper/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" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/monaco-editor-wrapper/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" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/monaco-editor-wrapper/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" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/monaco-editor-wrapper/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" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/monaco-editor-wrapper/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" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/monaco-editor-wrapper/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" + ], + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/monaco-editor-wrapper/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" + ], + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/monaco-editor-wrapper/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" + ], + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/monaco-editor-wrapper/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" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/monaco-editor-wrapper/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" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/monaco-editor-wrapper/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" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/monaco-editor-wrapper/node_modules/esbuild": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.20.2.tgz", + "integrity": "sha512-WdOOppmUNU+IbZ0PaDiTst80zjnrOkyJNHoKupIcVyU8Lvla3Ugx94VzkQ32Ijqd7UhHJy75gNWDMUekcrSJ6g==", + "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/monaco-editor-wrapper/node_modules/monaco-editor": { + "name": "@codingame/monaco-vscode-editor-api", + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/@codingame/monaco-vscode-editor-api/-/monaco-vscode-editor-api-3.2.3.tgz", + "integrity": "sha512-7EaQf5n3lTtCIciz7UyfoYt4FowhrD8xAc/T7gbyo2LkuSD7A8h4CHbnUOZNhsTqocFqOUSkcQl0z5n0T1LoTQ==", + "dependencies": { + "vscode": "npm:@codingame/monaco-vscode-api@3.2.3" + } + }, + "node_modules/monaco-languageclient": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/monaco-languageclient/-/monaco-languageclient-8.1.1.tgz", + "integrity": "sha512-33MLy4uk0s8hafD1WWdo0x/7ymKwDY5aBoC8Q4D+PBjae8xEHg+yIGyZneWF1ouO0/prn973hzBJ1kRZp6RTNw==", + "dependencies": { + "@codingame/monaco-vscode-extensions-service-override": "~3.2.3", + "@codingame/monaco-vscode-languages-service-override": "~3.2.3", + "@codingame/monaco-vscode-model-service-override": "~3.2.3", + "monaco-editor": "npm:@codingame/monaco-vscode-editor-api@~3.2.3", + "vscode": "npm:@codingame/monaco-vscode-api@~3.2.3", + "vscode-languageclient": "~9.0.1" + }, + "engines": { + "node": ">=16.11.0", + "npm": ">=9.0.0" + }, + "peerDependencies": { + "monaco-editor": "npm:@codingame/monaco-vscode-editor-api@~3.2.3", + "vscode": "npm:@codingame/monaco-vscode-api@~3.2.3" + }, + "peerDependenciesMeta": { + "monaco-editor": { + "optional": false + }, + "vscode": { + "optional": false + } + } + }, + "node_modules/monaco-languageclient/node_modules/monaco-editor": { + "name": "@codingame/monaco-vscode-editor-api", + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/@codingame/monaco-vscode-editor-api/-/monaco-vscode-editor-api-3.2.3.tgz", + "integrity": "sha512-7EaQf5n3lTtCIciz7UyfoYt4FowhrD8xAc/T7gbyo2LkuSD7A8h4CHbnUOZNhsTqocFqOUSkcQl0z5n0T1LoTQ==", + "dependencies": { + "vscode": "npm:@codingame/monaco-vscode-api@3.2.3" + } + }, + "node_modules/mrmime": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mrmime/-/mrmime-2.0.0.tgz", + "integrity": "sha512-eu38+hdgojoyq63s+yTpN4XMBdt5l8HhMhc4VKLO9KM5caLIBvUm4thi7fFaxyTmCKeNnXZ5pAlBwCUnhA09uw==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "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/n3": { + "version": "1.17.2", + "resolved": "https://registry.npmjs.org/n3/-/n3-1.17.2.tgz", + "integrity": "sha512-BxSM52wYFqXrbQQT5WUEzKUn6qpYV+2L4XZLfn3Gblz2kwZ09S+QxC33WNdVEQy2djenFL8SNkrjejEKlvI6+Q==", + "dependencies": { + "queue-microtask": "^1.1.2", + "readable-stream": "^4.0.0" + }, + "engines": { + "node": ">=12.0" + } + }, + "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/node-fetch-native": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/node-fetch-native/-/node-fetch-native-1.6.2.tgz", + "integrity": "sha512-69mtXOFZ6hSkYiXAVB5SqaRvrbITC/NPyqv7yuu/qw0nmgPyYbIMYYNIDhNtwPrzk0ptrimrLz/hhjvm4w5Z+w==" + }, + "node_modules/nomnoml": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/nomnoml/-/nomnoml-1.6.2.tgz", + "integrity": "sha512-R3dA3FS8txilobpd2ZdnCuEwmXYYljxza2wR41YE/cIHMbt0eXsjlXHlAsD+F/fVe536f0WkAQ+VQFRC3hPZCA==", + "dependencies": { + "graphre": "^0.1.3", + "nomnoml": "^1.5.3" + }, + "bin": { + "nomnoml": "dist/nomnoml-cli.js" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dependencies": { + "path-key": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "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/onchange": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/onchange/-/onchange-6.1.1.tgz", + "integrity": "sha512-G60OULp9Hi2dixPKYn/lfs7C8oDgFcneAhZ/4nPnvzd+Ar94q3FN0UG/t1zqXI15StSLvt7NlRqylamTSGhc4A==", + "dependencies": { + "@blakeembrey/deque": "^1.0.3", + "arrify": "^2.0.0", + "chokidar": "^3.0.0", + "cross-spawn": "^7.0.1", + "ignore": "^5.1.4", + "minimist": "^1.2.3", + "supports-color": "^7.0.0", + "tree-kill": "^1.2.2" + }, + "bin": { + "onchange": "cli.js" + } + }, + "node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ontouml-js": { + "version": "0.5.0", "resolved": "git+ssh://git@github.com/matheuslenke/ontouml-js.git#3ac6d342974dc0092c33f86df68f06721c29f76d", "license": "Apache-2.0", "dependencies": { @@ -6138,9 +6720,9 @@ } }, "node_modules/vite": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/vite/-/vite-4.5.2.tgz", - "integrity": "sha512-tBCZBNSBbHQkaGyhGCDUGqeo2ph8Fstyp6FMSvTtsXeZSPpSMGlviAOav2hxVTqFcx8Hj/twtWKsMJXNY0xI8w==", + "version": "4.5.3", + "resolved": "https://registry.npmjs.org/vite/-/vite-4.5.3.tgz", + "integrity": "sha512-kQL23kMeX92v3ph7IauVkXkikdDRsYMGTVl5KY2E9OY4ONLvkHf04MDTbnfo6NKxZiDLWzVpP5oTa8hQD8U3dg==", "dev": true, "dependencies": { "esbuild": "^0.18.10", @@ -6682,25 +7264,40 @@ } } }, + "node_modules/vscode": { + "name": "@codingame/monaco-vscode-api", + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/@codingame/monaco-vscode-api/-/monaco-vscode-api-3.2.3.tgz", + "integrity": "sha512-YOad82N2G5Ae/Ry14LOM3Mka6EjzbGXfwIs44xP/kFdhk9m7c1vXiIQxJIyUjTsJgzfEqYvcQKULlt4cqC7cEA==", + "dependencies": { + "@codingame/monaco-vscode-base-service-override": "3.2.3", + "@codingame/monaco-vscode-environment-service-override": "3.2.3", + "@codingame/monaco-vscode-extensions-service-override": "3.2.3", + "@codingame/monaco-vscode-files-service-override": "3.2.3", + "@codingame/monaco-vscode-host-service-override": "3.2.3", + "@codingame/monaco-vscode-layout-service-override": "3.2.3", + "@codingame/monaco-vscode-quickaccess-service-override": "3.2.3" + } + }, "node_modules/vscode-jsonrpc": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.1.0.tgz", - "integrity": "sha512-6TDy/abTQk+zDGYazgbIPc+4JoXdwC8NHU9Pbn4UJP1fehUyZmM4RHp5IthX7A6L5KS30PRui+j+tbbMMMafdw==", + "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": "8.1.0", - "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-8.1.0.tgz", - "integrity": "sha512-GL4QdbYUF/XxQlAsvYWZRV3V34kOkpRlvV60/72ghHfsYFnS/v2MANZ9P6sHmxFcZKOse8O+L9G7Czg0NUWing==", + "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.3" + "vscode-languageserver-protocol": "3.17.5" }, "engines": { - "vscode": "^1.67.0" + "vscode": "^1.82.0" } }, "node_modules/vscode-languageclient/node_modules/brace-expansion": { @@ -6723,30 +7320,25 @@ } }, "node_modules/vscode-languageserver": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-8.1.0.tgz", - "integrity": "sha512-eUt8f1z2N2IEUDBsKaNapkz7jl5QpskN2Y0G01T/ItMxBxw1fJwvtySGB9QMecatne8jFIWJGWI61dWjyTLQsw==", + "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.3" + "vscode-languageserver-protocol": "3.17.5" }, "bin": { "installServerIntoExtension": "bin/installServerIntoExtension" } }, "node_modules/vscode-languageserver-protocol": { - "version": "3.17.3", - "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.3.tgz", - "integrity": "sha512-924/h0AqsMtA5yK22GgMtCYiMdCOtWTSGgUOkgEDX+wk2b0x4sAfLiO4NxBxqbiVtz7K7/1/RgVrVI0NClZwqA==", + "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.1.0", - "vscode-languageserver-types": "3.17.3" + "vscode-jsonrpc": "8.2.0", + "vscode-languageserver-types": "3.17.5" } }, - "node_modules/vscode-languageserver-protocol/node_modules/vscode-languageserver-types": { - "version": "3.17.3", - "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.3.tgz", - "integrity": "sha512-SYU4z1dL0PyIMd4Vj8YOqFvHu7Hz/enbWtpfnVbJHU4Nd1YNYx8u0ennumc6h48GQNeOLxmwySmnADouT/AuZA==" - }, "node_modules/vscode-languageserver-textdocument": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.11.tgz", @@ -6757,11 +7349,33 @@ "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz", "integrity": "sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg==" }, + "node_modules/vscode-oniguruma": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/vscode-oniguruma/-/vscode-oniguruma-1.7.0.tgz", + "integrity": "sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA==" + }, + "node_modules/vscode-textmate": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-9.0.0.tgz", + "integrity": "sha512-Cl65diFGxz7gpwbav10HqiY/eVYTO1sjQpmRmV991Bj7wAoOAjGQ97PpQcXorDE2Uc4hnGWLY17xme+5t6MlSg==" + }, "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/vscode-ws-jsonrpc": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/vscode-ws-jsonrpc/-/vscode-ws-jsonrpc-3.3.0.tgz", + "integrity": "sha512-dTuDWJIwK5rBTQlM87JVK/JsTM+ARFuXw8B0erpEYrXay8QCBTOeO6yu2iyY5TuOwWikIenlBCEF6MgbzYgKIw==", + "dependencies": { + "vscode-jsonrpc": "~8.2.0" + }, + "engines": { + "node": ">=16.11.0", + "npm": ">=8.0.0" + } + }, "node_modules/wcwidth": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", @@ -7007,7 +7621,7 @@ }, "packages/tonto": { "name": "tonto-cli", - "version": "0.3.1", + "version": "0.3.3", "license": "MIT", "dependencies": { "ajv": "^8.12.0", @@ -7022,8 +7636,8 @@ "ontouml-js": "github:matheuslenke/ontouml-js#feature/include-types-in-build", "rimraf": "^4.1.2", "uuid": "^9.0.1", - "vscode-languageclient": "^8.0.2", - "vscode-languageserver": "^8.0.2", + "vscode-languageclient": "~9.0.1", + "vscode-languageserver": "~9.0.1", "vscode-languageserver-types": "^3.17.3", "vscode-uri": "^3.0.7" }, @@ -7051,7 +7665,7 @@ } }, "packages/tonto-package-manager": { - "version": "0.3.1", + "version": "0.3.2", "license": "MIT", "dependencies": { "chalk": "^5.3.0", @@ -7205,47 +7819,23 @@ "node": ">=14.17" } }, - "packages/tonto-package-manager/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" - } - }, - "packages/tonto-package-manager/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" - } - }, - "packages/tonto-package-manager/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" - } - }, "packages/tonto-vscode": { "name": "tonto", - "version": "0.3.1", + "version": "0.3.3", "license": "MIT", "dependencies": { "chalk": "^5.3.0", "commander": "^11.0.0", "langium": "^3.0.0", + "monaco-editor": "npm:@codingame/monaco-editor-treemended@1.83.16", + "monaco-editor-workers": "^0.45.0", + "monaco-editor-wrapper": "^4.0.2", + "monaco-languageclient": "^8.1.1", "node-fetch-native": "^1.6.2", "nomnoml": "^1.6.2", "prettier": "^3.2.5", "rimraf": "^4.1.2", - "tonto-cli": "0.3.1", + "tonto-cli": "file:../tonto", "tonto-package-manager": "~0.2.9", "uuid": "^9.0.1", "vscode-languageclient": "^9.0.1", @@ -7641,14 +8231,6 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "packages/tonto-vscode/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" - } - }, "packages/tonto-vscode/node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -7665,14 +8247,6 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, - "packages/tonto-vscode/node_modules/commander": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-11.0.0.tgz", - "integrity": "sha512-9HMlXtt/BNoYr8ooyjjNRdIilOTkVJXB+GhxMTtOKwk0R4j4lS4NpjuqmRxroBfnfTSHQIHQB7wryHhXarNjmQ==", - "engines": { - "node": ">=16" - } - }, "packages/tonto-vscode/node_modules/esbuild": { "version": "0.20.1", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.20.1.tgz", @@ -7723,37 +8297,11 @@ "eslint": ">=7.0.0" } }, - "packages/tonto-vscode/node_modules/langium-cli": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/langium-cli/-/langium-cli-3.0.0.tgz", - "integrity": "sha512-0jcJ9EfYzbm6i3DIoCPkaquzh+F1f195b0/NqntUVFsN1hptE9BkOO02cwgKQKBocYitXxtz2b3/wUWa4eIRvA==", - "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" - } - }, - "packages/tonto-vscode/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" - } + "packages/tonto-vscode/node_modules/monaco-editor": { + "name": "@codingame/monaco-editor-treemended", + "version": "1.83.16", + "resolved": "https://registry.npmjs.org/@codingame/monaco-editor-treemended/-/monaco-editor-treemended-1.83.16.tgz", + "integrity": "sha512-KS89o9zxphQqjQgZgpTDiHZNKCFxRpQdiDVkEfJGfNc83r5GbtTlIXA7RqtUSy55F+K5Bb3ua2WvrbwUGcZqBg==" }, "packages/tonto-vscode/node_modules/prettier": { "version": "2.8.8", @@ -8096,9 +8644,9 @@ } }, "packages/tonto-vscode/node_modules/vitest/node_modules/vite": { - "version": "3.2.8", - "resolved": "https://registry.npmjs.org/vite/-/vite-3.2.8.tgz", - "integrity": "sha512-EtQU16PLIJpAZol2cTLttNP1mX6L0SyI0pgQB1VOoWeQnMSvtiwovV3D6NcjN8CZQWWyESD2v5NGnpz5RvgOZA==", + "version": "3.2.10", + "resolved": "https://registry.npmjs.org/vite/-/vite-3.2.10.tgz", + "integrity": "sha512-Dx3olBo/ODNiMVk/cA5Yft9Ws+snLOXrhLtrI3F4XLt4syz2Yg8fayZMWScPKoz12v5BUv7VEmQHnsfpY80fYw==", "dev": true, "dependencies": { "esbuild": "^0.15.9", @@ -8144,46 +8692,10 @@ } } }, - "packages/tonto-vscode/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" - } - }, - "packages/tonto-vscode/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" - } - }, - "packages/tonto-vscode/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" - } - }, - "packages/tonto-vscode/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" - } + "packages/tonto-vscode/node_modules/vscode-languageserver-types": { + "version": "3.17.3", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.3.tgz", + "integrity": "sha512-SYU4z1dL0PyIMd4Vj8YOqFvHu7Hz/enbWtpfnVbJHU4Nd1YNYx8u0ennumc6h48GQNeOLxmwySmnADouT/AuZA==" }, "packages/tonto/node_modules/@esbuild/android-arm": { "version": "0.15.18", @@ -8352,9 +8864,9 @@ } }, "packages/tonto/node_modules/vitest/node_modules/vite": { - "version": "3.2.8", - "resolved": "https://registry.npmjs.org/vite/-/vite-3.2.8.tgz", - "integrity": "sha512-EtQU16PLIJpAZol2cTLttNP1mX6L0SyI0pgQB1VOoWeQnMSvtiwovV3D6NcjN8CZQWWyESD2v5NGnpz5RvgOZA==", + "version": "3.2.10", + "resolved": "https://registry.npmjs.org/vite/-/vite-3.2.10.tgz", + "integrity": "sha512-Dx3olBo/ODNiMVk/cA5Yft9Ws+snLOXrhLtrI3F4XLt4syz2Yg8fayZMWScPKoz12v5BUv7VEmQHnsfpY80fYw==", "dev": true, "dependencies": { "esbuild": "^0.15.9", diff --git a/package.json b/package.json index ed75323..a06e81b 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "private": true, "engineStrict": true, "description": "Tonto is a DSL for creating OntoUML models", - "version": "0.3.0", + "version": "0.3.4", "license": "MIT", "repository": { "type": "git", diff --git a/packages/tonto-vscode/data/tonto.tmLanguage.json b/packages/tonto-vscode/data/tonto.tmLanguage.json deleted file mode 100644 index c084e55..0000000 --- a/packages/tonto-vscode/data/tonto.tmLanguage.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "name": "tonto", - "scopeName": "source.tonto", - "fileTypes": [ - ".tonto" - ], - "patterns": [ - { - "include": "#comments" - }, - { - "name": "keyword.control.tonto", - "match": "\\b(abstract-individuals|aggregation|as|bringsAbout|categorizer|category|characterization|class|collective|collectives|comparative|complete|componentOf|composition|const|constitution|creation|datatype|derivation|derived|disjoint|enum|event|events|externalDependence|extrinsic-modes|extrinsicMode|formal|functional-complexes|general|genset|global|historicalDependence|historicalRole|historicalRoleMixin|import|inherence|instanceOf|instantiation|intrinsic-modes|intrinsicMode|inverseOf|kind|manifestation|material|mediation|memberOf|mixin|mode|objects|of|ordered|package|participation|participational|phase|phaseMixin|powertype|process|qualities|quality|quantities|quantity|redefines|relation|relator|relators|role|roleMixin|situation|situations|specializes|specifics|subCollectionOf|subQuantityOf|subkind|subsets|termination|triggers|type|types|value|where)\\b|\\B(--)\\B" - }, - { - "name": "string.quoted.double.tonto", - "begin": "\"", - "end": "\"", - "patterns": [ - { - "include": "#string-character-escape" - } - ] - }, - { - "name": "string.quoted.single.tonto", - "begin": "'", - "end": "'", - "patterns": [ - { - "include": "#string-character-escape" - } - ] - } - ], - "repository": { - "comments": { - "patterns": [ - { - "name": "comment.block.tonto", - "begin": "/\\*", - "beginCaptures": { - "0": { - "name": "punctuation.definition.comment.tonto" - } - }, - "end": "\\*/", - "endCaptures": { - "0": { - "name": "punctuation.definition.comment.tonto" - } - } - }, - { - "begin": "//", - "beginCaptures": { - "1": { - "name": "punctuation.whitespace.comment.leading.tonto" - } - }, - "end": "(?=$)", - "name": "comment.line.tonto" - } - ] - }, - "string-character-escape": { - "name": "constant.character.escape.tonto", - "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/tonto-vscode/esbuild.mjs b/packages/tonto-vscode/esbuild.mjs index b37eb68..88c95ea 100644 --- a/packages/tonto-vscode/esbuild.mjs +++ b/packages/tonto-vscode/esbuild.mjs @@ -38,7 +38,7 @@ const ctx = await esbuild.context({ loader: { ".ts": "ts" }, external: ["vscode"], platform: "node", - sourcemap: !minify, + sourcemap: true, minify, plugins }); diff --git a/packages/tonto-vscode/package.json b/packages/tonto-vscode/package.json index 1e94ed1..af33c8d 100644 --- a/packages/tonto-vscode/package.json +++ b/packages/tonto-vscode/package.json @@ -3,7 +3,7 @@ "displayName": "Tonto", "publisher": "Lenke", "description": "Tonto is a DSL for creating OntoUML models", - "version": "0.3.2", + "version": "0.3.4", "license": "MIT", "icon": "data/images/TontoIcon.png", "type": "module", @@ -21,6 +21,18 @@ ], "main": "./out/extension/main.cjs", "contributes": { + "themes": [ + { + "label": "Tonto Light", + "uiTheme": "vs", + "path": "./src/themes/Tonto-color-theme.json" + }, + { + "label": "Tonto Dark", + "uiTheme": "vs", + "path": "./src/themes/Tonto-dark-color-theme.json" + } + ], "languages": [ { "id": "tonto", @@ -38,7 +50,7 @@ { "language": "tonto", "scopeName": "source.tonto", - "path": "./data/tonto.tmLanguage.json" + "path": "./syntaxes/tonto.tmLanguage.json" } ], "commands": [ @@ -148,22 +160,30 @@ "clean": "rimraf out", "lint": "eslint src --ext ts", "lint:fix": "eslint src --ext ts --fix", - "build": "node ./esbuild.mjs", + "build": "tsc -b tsconfig.json && node ./esbuild.mjs", + "build:worker": "esbuild --minify ./out/language/main-browser.cjs --bundle --format=iife --outfile=./public/tonto-server-worker.js", + "build:monarch": "tsc -b tsconfig.monarch.json", + "build:web": "npm run build && npm run prepare:public && npm run build:worker && node scripts/copy-monaco-assets.mjs", "watch": "node ./esbuild.mjs --watch", "coverage": "vitest run --coverage", "langium:generate": "langium generate", "langium:watch": "langium generate --watch", - "publish:npm": "npm publish --access public" + "publish:npm": "npm publish --access public", + "prepare:public": "node scripts/prepare-public.mjs" }, "dependencies": { "chalk": "^5.3.0", "commander": "^11.0.0", "langium": "^3.0.0", + "monaco-editor": "npm:@codingame/monaco-editor-treemended@1.83.16", + "monaco-editor-workers": "^0.45.0", + "monaco-editor-wrapper": "^4.0.2", + "monaco-languageclient": "^8.1.1", "node-fetch-native": "^1.6.2", "nomnoml": "^1.6.2", "prettier": "^3.2.5", "rimraf": "^4.1.2", - "tonto-cli": "0.3.1", + "tonto-cli": "file:../tonto", "tonto-package-manager": "~0.2.9", "uuid": "^9.0.1", "vscode-languageclient": "^9.0.1", diff --git a/packages/tonto-vscode/scripts/bundle.mjs b/packages/tonto-vscode/scripts/bundle.mjs new file mode 100644 index 0000000..50dd061 --- /dev/null +++ b/packages/tonto-vscode/scripts/bundle.mjs @@ -0,0 +1,20 @@ +import getEditorServiceOverride from "@codingame/monaco-vscode-editor-service-override"; +import getKeybindingsServiceOverride from "@codingame/monaco-vscode-keybindings-service-override"; +import { MonacoEditorLanguageClientWrapper } from "monaco-editor-wrapper"; +import { addMonacoStyles } from "monaco-editor-wrapper/styles"; +import { useOpenEditorStub } from "monaco-languageclient"; + +export const defineUserServices = () => { + return { + userServices: { + ...getEditorServiceOverride(useOpenEditorStub), + ...getKeybindingsServiceOverride() + }, + debugLogging: true + }; +}; +export { + MonacoEditorLanguageClientWrapper, addMonacoStyles, getEditorServiceOverride, + getKeybindingsServiceOverride +}; + diff --git a/packages/tonto-vscode/scripts/copy-monaco-assets.mjs b/packages/tonto-vscode/scripts/copy-monaco-assets.mjs new file mode 100644 index 0000000..c91f0b5 --- /dev/null +++ b/packages/tonto-vscode/scripts/copy-monaco-assets.mjs @@ -0,0 +1,19 @@ +import shell from "shelljs"; + +// copy workers to public +shell.mkdir("-p", "./public/monaco-editor-workers/workers"); +shell.cp( + "-fr", + "./node_modules/monaco-editor-workers/dist/index.js", + "./public/monaco-editor-workers/index.js" +); +shell.cp( + "-fr", + "./node_modules/monaco-editor-workers/dist/workers/editorWorker-es.js", + "./public/monaco-editor-workers/workers/editorWorker-es.js" +); +shell.cp( + "-fr", + "./node_modules/monaco-editor-workers/dist/workers/editorWorker-iife.js", + "./public/monaco-editor-workers/workers/editorWorker-iife.js" +); \ No newline at end of file diff --git a/packages/tonto-vscode/scripts/prepare-public.mjs b/packages/tonto-vscode/scripts/prepare-public.mjs new file mode 100644 index 0000000..63e52aa --- /dev/null +++ b/packages/tonto-vscode/scripts/prepare-public.mjs @@ -0,0 +1,16 @@ +import * as esbuild from "esbuild"; +import shell from "shelljs"; + +// setup & copy over css & html to public +shell.mkdir("-p", "./public"); +shell.cp("-fr", "./src/static/*.css", "./public/"); +shell.cp("-fr", "./src/static/*.html", "./public"); + +// bundle minilogo.ts, and also copy to public +await esbuild.build({ + entryPoints: ["./src/static/minilogo.ts"], + minify: true, + sourcemap: true, + bundle: true, + outfile: "./public/minilogo.js", +}); \ No newline at end of file diff --git a/packages/tonto-vscode/src/extension/main.ts b/packages/tonto-vscode/src/extension/main.ts index 2b4287f..b3ac8c3 100644 --- a/packages/tonto-vscode/src/extension/main.ts +++ b/packages/tonto-vscode/src/extension/main.ts @@ -21,7 +21,6 @@ let outputChannel: vscode.OutputChannel; // This function is called when the extension is activated. export function activate(context: vscode.ExtensionContext): void { - outputChannel = vscode.window.createOutputChannel("Tonto: Validation output"); TontoLibraryFileSystemProvider.register(context); client = startLanguageClient(context); diff --git a/packages/tonto-vscode/src/language/main.ts b/packages/tonto-vscode/src/language/main.ts index 5a930ab..bedca3d 100644 --- a/packages/tonto-vscode/src/language/main.ts +++ b/packages/tonto-vscode/src/language/main.ts @@ -3,6 +3,7 @@ import { PartialLangiumSharedServices, startLanguageServer } from "langium/lsp"; import { NodeFileSystem } from "langium/node"; import { TontoSharedServices, createTontoServices } from "tonto-cli"; import { ProposedFeatures, createConnection } from "vscode-languageserver/node.js"; +import { TontoLanguageServer } from "../../../tonto/src/language/lsp/tonto-language-server.js"; import { TontoGrammarWorkspaceManager } from "./tonto-workspace-manager.js"; // Create a connection to the client @@ -10,7 +11,10 @@ const connection = createConnection(ProposedFeatures.all); export const TontoSharedModule: Module = { workspace: { - WorkspaceManager: (services) => new TontoGrammarWorkspaceManager(services) + WorkspaceManager: (services) => new TontoGrammarWorkspaceManager(services), + }, + lsp: { + LanguageServer: (services) => new TontoLanguageServer(services) } }; diff --git a/packages/tonto-vscode/src/themes/Tonto-color-theme.json b/packages/tonto-vscode/src/themes/Tonto-color-theme.json new file mode 100644 index 0000000..ab597c1 --- /dev/null +++ b/packages/tonto-vscode/src/themes/Tonto-color-theme.json @@ -0,0 +1,498 @@ +{ + "name": "Tonto", + "colors": { + "editor.background": "#f5f5f5", + "editor.foreground": "#333333", + "list.activeSelectionIconForeground": "#fff" + }, + "tokenColors": [ + { + "name": "Comments", + "scope": [ + "comment", + "punctuation.definition.comment" + ], + "settings": { + "fontStyle": "italic", + "foreground": "#AAAAAA" + } + }, + { + "name": "Comments: Preprocessor", + "scope": "comment.block.preprocessor", + "settings": { + "fontStyle": "", + "foreground": "#AAAAAA" + } + }, + { + "name": "Comments: Documentation", + "scope": [ + "comment.documentation", + "comment.block.documentation" + ], + "settings": { + "foreground": "#448C27" + } + }, + { + "name": "Invalid - Illegal", + "scope": "invalid.illegal", + "settings": { + "foreground": "#660000" + } + }, + { + "name": "Operators", + "scope": "keyword.operator", + "settings": { + "foreground": "#777777" + } + }, + { + "name": "Keywords", + "scope": [ + "keyword", + "storage", + ], + "settings": { + "foreground": "#4B83CD" + } + }, + { + "name": "Keywords", + "scope": [ + "keyword.control.tonto" + ], + "settings": { + "foreground": "#396bcd", + } + }, + { + "name": "Keywords", + "scope": [ + "keyword.control.nonSortal" + ], + "settings": { + "fontStyle": "italic" + } + }, + { + "name": "Types", + "scope": [ + "storage.type", + "support.type" + ], + "settings": { + "foreground": "#7A3E9D" + } + }, + { + "name": "Language Constants", + "scope": [ + "constant.language", + "support.constant", + "variable.language" + ], + "settings": { + "foreground": "#AB6526" + } + }, + { + "name": "Variables", + "scope": [ + "variable", + "support.variable" + ], + "settings": { + "foreground": "#7A3E9D" + } + }, + { + "name": "Functions", + "scope": [ + "entity.name.function", + "support.function" + ], + "settings": { + "fontStyle": "bold", + "foreground": "#AA3731" + } + }, + { + "name": "Classes", + "scope": [ + "entity.name.type", + "entity.other.inherited-class", + "support.class" + ], + "settings": { + "fontStyle": "bold", + "foreground": "#7A3E9D" + } + }, + { + "name": "Exceptions", + "scope": "entity.name.exception", + "settings": { + "foreground": "#660000" + } + }, + { + "name": "Sections", + "scope": "entity.name.section", + "settings": { + "fontStyle": "bold" + } + }, + { + "name": "Numbers, Characters", + "scope": [ + "constant.numeric", + "constant.character", + "constant" + ], + "settings": { + "foreground": "#AB6526" + } + }, + { + "name": "Strings", + "scope": "string", + "settings": { + "foreground": "#448C27" + } + }, + { + "name": "Strings: Escape Sequences", + "scope": "constant.character.escape", + "settings": { + "foreground": "#777777" + } + }, + { + "name": "Strings: Regular Expressions", + "scope": "string.regexp", + "settings": { + "foreground": "#4B83CD" + } + }, + { + "name": "Strings: Symbols", + "scope": "constant.other.symbol", + "settings": { + "foreground": "#AB6526" + } + }, + { + "name": "Punctuation", + "scope": "punctuation", + "settings": { + "foreground": "#777777" + } + }, + { + "name": "HTML: Doctype Declaration", + "scope": [ + "meta.tag.sgml.doctype", + "meta.tag.sgml.doctype string", + "meta.tag.sgml.doctype entity.name.tag", + "meta.tag.sgml punctuation.definition.tag.html" + ], + "settings": { + "foreground": "#AAAAAA" + } + }, + { + "name": "HTML: Tags", + "scope": [ + "meta.tag", + "punctuation.definition.tag.html", + "punctuation.definition.tag.begin.html", + "punctuation.definition.tag.end.html" + ], + "settings": { + "foreground": "#91B3E0" + } + }, + { + "name": "HTML: Tag Names", + "scope": "entity.name.tag", + "settings": { + "foreground": "#4B83CD" + } + }, + { + "name": "HTML: Attribute Names", + "scope": [ + "meta.tag entity.other.attribute-name", + "entity.other.attribute-name.html" + ], + "settings": { + "fontStyle": "italic", + "foreground": "#91B3E0" + } + }, + { + "name": "HTML: Entities", + "scope": [ + "constant.character.entity", + "punctuation.definition.entity" + ], + "settings": { + "foreground": "#AB6526" + } + }, + { + "name": "CSS: Selectors", + "scope": [ + "meta.selector", + "meta.selector entity", + "meta.selector entity punctuation", + "entity.name.tag.css" + ], + "settings": { + "foreground": "#7A3E9D" + } + }, + { + "name": "CSS: Property Names", + "scope": [ + "meta.property-name", + "support.type.property-name" + ], + "settings": { + "foreground": "#AB6526" + } + }, + { + "name": "CSS: Property Values", + "scope": [ + "meta.property-value", + "meta.property-value constant.other", + "support.constant.property-value" + ], + "settings": { + "foreground": "#448C27" + } + }, + { + "name": "CSS: Important Keyword", + "scope": "keyword.other.important", + "settings": { + "fontStyle": "bold" + } + }, + { + "name": "Markup: Changed", + "scope": "markup.changed", + "settings": { + "foreground": "#000000" + } + }, + { + "name": "Markup: Deletion", + "scope": "markup.deleted", + "settings": { + "foreground": "#000000" + } + }, + { + "name": "Markup: Emphasis", + "scope": "markup.italic", + "settings": { + "fontStyle": "italic" + } + }, + { + "name": "Markup: Error", + "scope": "markup.error", + "settings": { + "foreground": "#660000" + } + }, + { + "name": "Markup: Insertion", + "scope": "markup.inserted", + "settings": { + "foreground": "#000000" + } + }, + { + "name": "Markup: Link", + "scope": "meta.link", + "settings": { + "foreground": "#4B83CD" + } + }, + { + "name": "Markup: Output", + "scope": [ + "markup.output", + "markup.raw" + ], + "settings": { + "foreground": "#777777" + } + }, + { + "name": "Markup: Prompt", + "scope": "markup.prompt", + "settings": { + "foreground": "#777777" + } + }, + { + "name": "Markup: Heading", + "scope": "markup.heading", + "settings": { + "foreground": "#AA3731" + } + }, + { + "name": "Markup: Strong", + "scope": "markup.bold", + "settings": { + "fontStyle": "bold" + } + }, + { + "name": "Markup: Traceback", + "scope": "markup.traceback", + "settings": { + "foreground": "#660000" + } + }, + { + "name": "Markup: Underline", + "scope": "markup.underline", + "settings": { + "fontStyle": "underline" + } + }, + { + "name": "Markup Quote", + "scope": "markup.quote", + "settings": { + "foreground": "#7A3E9D" + } + }, + { + "name": "Markup Lists", + "scope": "markup.list", + "settings": { + "foreground": "#4B83CD" + } + }, + { + "name": "Markup Styling", + "scope": [ + "markup.bold", + "markup.italic" + ], + "settings": { + "foreground": "#448C27" + } + }, + { + "name": "Markup Inline", + "scope": "markup.inline.raw", + "settings": { + "fontStyle": "", + "foreground": "#AB6526" + } + }, + { + "name": "Extra: Diff Range", + "scope": [ + "meta.diff.range", + "meta.diff.index", + "meta.separator" + ], + "settings": { + "foreground": "#434343" + } + }, + { + "name": "Extra: Diff From", + "scope": "meta.diff.header.from-file", + "settings": { + "foreground": "#434343" + } + }, + { + "name": "Extra: Diff To", + "scope": "meta.diff.header.to-file", + "settings": { + "foreground": "#434343" + } + } + ], + "semanticHighlighting": true, + "semanticTokenColors": { + "tontoKind": { + "foreground": "#CD6872", + "fontStyle": "bold" + }, + "tontoQualityKind": { + "foreground": "#19b0f1", + "fontStyle": "bold" + }, + "tontoQuantityKind": { + "foreground": "#CD6872", + "fontStyle": "bold" + }, + "tontoCollectiveKind": { + "foreground": "#CD6872", + "fontStyle": "bold" + }, + "tontoRelatorKind": { + "foreground": "#45e72b", + "fontStyle": "bold" + }, + "tontoEvent": { + "foreground": "#d1ca3c", + "fontStyle": "bold" + }, + "tontoModeKind": { + "foreground": "#19b0f1", + "fontStyle": "bold" + }, + "tontoMode": { + "foreground": "#19b0f1", + }, + "tontoSituation": { + "foreground": "#fca90d", + "fontStyle": "bold" + }, + "tontoType": { + "foreground": "#9b69b1", + "fontStyle": "bold" + }, + "tontoObjects": { + "foreground": "#f51212", + "fontStyle": "bold" + }, + "tontoFunctionalComplex": { + "foreground": "#CD6872", + }, + "tontoQuality": { + "foreground": "#19b0f1", + }, + "tontoQuantity": { + "foreground": "#CD6872", + }, + "tontoCollective": { + "foreground": "#CD6872", + }, + "tontoRelator": { + "foreground": "#45e72b", + }, + "tontoNone": { + "foreground": "#7f7d7d", + }, + "tontoNonSortal": { + "fontStyle": "italic" + } + } +} diff --git a/packages/tonto-vscode/src/themes/Tonto-dark-color-theme.json b/packages/tonto-vscode/src/themes/Tonto-dark-color-theme.json new file mode 100644 index 0000000..1473ad1 --- /dev/null +++ b/packages/tonto-vscode/src/themes/Tonto-dark-color-theme.json @@ -0,0 +1,1336 @@ +{ + "$schema": "vscode://schemas/color-theme", + "type": "dark", + "colors": { + "actionBar.toggledBackground": "#383a49", + "activityBarBadge.background": "#007acc", + "checkbox.border": "#6b6b6b", + "editor.background": "#1e1e1e", + "editor.foreground": "#d4d4d4", + "editor.inactiveSelectionBackground": "#3a3d41", + "editor.selectionHighlightBackground": "#add6ff26", + "editorIndentGuide.activeBackground1": "#707070", + "editorIndentGuide.background1": "#404040", + "input.placeholderForeground": "#a6a6a6", + "list.activeSelectionIconForeground": "#ffffff", + "list.dropBackground": "#383b3d", + "menu.background": "#252526", + "menu.border": "#454545", + "menu.foreground": "#cccccc", + "menu.separatorBackground": "#454545", + "ports.iconRunningProcessForeground": "#369432", + "sideBarSectionHeader.background": "#00000000", + "sideBarSectionHeader.border": "#cccccc33", + "sideBarTitle.foreground": "#bbbbbb", + "statusBarItem.remoteBackground": "#16825d", + "statusBarItem.remoteForeground": "#ffffff", + "tab.lastPinnedBorder": "#cccccc33", + "terminal.inactiveSelectionBackground": "#3a3d41", + "widget.border": "#303031", + "activityBar.activeBorder": "#ffffff", + "activityBar.background": "#333333", + "activityBar.dropBorder": "#ffffff", + "activityBar.foreground": "#ffffff", + "activityBar.inactiveForeground": "#ffffff66", + "activityBarBadge.foreground": "#ffffff", + "activityBarTop.activeBorder": "#e7e7e7", + "activityBarTop.dropBorder": "#e7e7e7", + "activityBarTop.foreground": "#e7e7e7", + "activityBarTop.inactiveForeground": "#e7e7e799", + "badge.background": "#4d4d4d", + "badge.foreground": "#ffffff", + "banner.background": "#04395e", + "banner.foreground": "#ffffff", + "banner.iconForeground": "#3794ff", + "breadcrumb.activeSelectionForeground": "#e0e0e0", + "breadcrumb.background": "#1e1e1e", + "breadcrumb.focusForeground": "#e0e0e0", + "breadcrumb.foreground": "#cccccccc", + "breadcrumbPicker.background": "#252526", + "button.background": "#0e639c", + "button.foreground": "#ffffff", + "button.hoverBackground": "#1177bb", + "button.secondaryBackground": "#3a3d41", + "button.secondaryForeground": "#ffffff", + "button.secondaryHoverBackground": "#45494e", + "button.separator": "#ffffff66", + "charts.blue": "#3794ff", + "charts.foreground": "#cccccc", + "charts.green": "#89d185", + "charts.lines": "#cccccc80", + "charts.orange": "#d18616", + "charts.purple": "#b180d7", + "charts.red": "#f14c4c", + "charts.yellow": "#cca700", + "chat.avatarBackground": "#1f1f1f", + "chat.avatarForeground": "#cccccc", + "chat.requestBackground": "#1e1e1e9e", + "chat.requestBorder": "#ffffff1a", + "chat.slashCommandBackground": "#34414b", + "chat.slashCommandForeground": "#40a6ff", + "checkbox.background": "#3c3c3c", + "checkbox.foreground": "#f0f0f0", + "checkbox.selectBackground": "#252526", + "checkbox.selectBorder": "#c5c5c5", + "commandCenter.activeBackground": "#ffffff14", + "commandCenter.activeBorder": "#cccccc4d", + "commandCenter.activeForeground": "#cccccc", + "commandCenter.background": "#ffffff0d", + "commandCenter.border": "#cccccc33", + "commandCenter.debuggingBackground": "#cc663342", + "commandCenter.foreground": "#cccccc", + "commandCenter.inactiveBorder": "#cccccc26", + "commandCenter.inactiveForeground": "#cccccc99", + "commentsView.resolvedIcon": "#cccccc80", + "commentsView.unresolvedIcon": "#007fd4", + "debugConsole.errorForeground": "#f48771", + "debugConsole.infoForeground": "#3794ff", + "debugConsole.sourceForeground": "#cccccc", + "debugConsole.warningForeground": "#cca700", + "debugConsoleInputIcon.foreground": "#cccccc", + "debugExceptionWidget.background": "#420b0d", + "debugExceptionWidget.border": "#a31515", + "debugIcon.breakpointCurrentStackframeForeground": "#ffcc00", + "debugIcon.breakpointDisabledForeground": "#848484", + "debugIcon.breakpointForeground": "#e51400", + "debugIcon.breakpointStackframeForeground": "#89d185", + "debugIcon.breakpointUnverifiedForeground": "#848484", + "debugIcon.continueForeground": "#75beff", + "debugIcon.disconnectForeground": "#f48771", + "debugIcon.pauseForeground": "#75beff", + "debugIcon.restartForeground": "#89d185", + "debugIcon.startForeground": "#89d185", + "debugIcon.stepBackForeground": "#75beff", + "debugIcon.stepIntoForeground": "#75beff", + "debugIcon.stepOutForeground": "#75beff", + "debugIcon.stepOverForeground": "#75beff", + "debugIcon.stopForeground": "#f48771", + "debugTokenExpression.boolean": "#4e94ce", + "debugTokenExpression.error": "#f48771", + "debugTokenExpression.name": "#c586c0", + "debugTokenExpression.number": "#b5cea8", + "debugTokenExpression.string": "#ce9178", + "debugTokenExpression.value": "#cccccc99", + "debugToolBar.background": "#333333", + "debugView.exceptionLabelBackground": "#6c2022", + "debugView.exceptionLabelForeground": "#cccccc", + "debugView.stateLabelBackground": "#88888844", + "debugView.stateLabelForeground": "#cccccc", + "debugView.valueChangedHighlight": "#569cd6", + "descriptionForeground": "#ccccccb3", + "diffEditor.diagonalFill": "#cccccc33", + "diffEditor.insertedLineBackground": "#9bb95533", + "diffEditor.insertedTextBackground": "#9ccc2c33", + "diffEditor.move.border": "#8b8b8b9c", + "diffEditor.moveActive.border": "#ffa500", + "diffEditor.removedLineBackground": "#ff000033", + "diffEditor.removedTextBackground": "#ff000033", + "diffEditor.unchangedCodeBackground": "#74747429", + "diffEditor.unchangedRegionBackground": "#252526", + "diffEditor.unchangedRegionForeground": "#cccccc", + "diffEditor.unchangedRegionShadow": "#000000", + "disabledForeground": "#cccccc80", + "dropdown.background": "#3c3c3c", + "dropdown.border": "#3c3c3c", + "dropdown.foreground": "#f0f0f0", + "editor.findMatchBackground": "#515c6a", + "editor.findMatchHighlightBackground": "#ea5c0055", + "editor.findRangeHighlightBackground": "#3a3d4166", + "editor.focusedStackFrameHighlightBackground": "#7abd7a4d", + "editor.foldBackground": "#264f784d", + "editor.hoverHighlightBackground": "#264f7840", + "editor.inlineValuesBackground": "#ffc80033", + "editor.inlineValuesForeground": "#ffffff80", + "editor.lineHighlightBorder": "#282828", + "editor.linkedEditingBackground": "#ff00004d", + "editor.rangeHighlightBackground": "#ffffff0b", + "editor.selectionBackground": "#264f78", + "editor.snippetFinalTabstopHighlightBorder": "#525252", + "editor.snippetTabstopHighlightBackground": "#7c7c7c4d", + "editor.stackFrameHighlightBackground": "#ffff0033", + "editor.symbolHighlightBackground": "#ea5c0055", + "editor.wordHighlightBackground": "#575757b8", + "editor.wordHighlightStrongBackground": "#004972b8", + "editor.wordHighlightTextBackground": "#575757b8", + "editorBracketHighlight.foreground1": "#ffd700", + "editorBracketHighlight.foreground2": "#da70d6", + "editorBracketHighlight.foreground3": "#179fff", + "editorBracketHighlight.foreground4": "#00000000", + "editorBracketHighlight.foreground5": "#00000000", + "editorBracketHighlight.foreground6": "#00000000", + "editorBracketHighlight.unexpectedBracket.foreground": "#ff1212cc", + "editorBracketMatch.background": "#0064001a", + "editorBracketMatch.border": "#888888", + "editorBracketPairGuide.activeBackground1": "#00000000", + "editorBracketPairGuide.activeBackground2": "#00000000", + "editorBracketPairGuide.activeBackground3": "#00000000", + "editorBracketPairGuide.activeBackground4": "#00000000", + "editorBracketPairGuide.activeBackground5": "#00000000", + "editorBracketPairGuide.activeBackground6": "#00000000", + "editorBracketPairGuide.background1": "#00000000", + "editorBracketPairGuide.background2": "#00000000", + "editorBracketPairGuide.background3": "#00000000", + "editorBracketPairGuide.background4": "#00000000", + "editorBracketPairGuide.background5": "#00000000", + "editorBracketPairGuide.background6": "#00000000", + "editorCodeLens.foreground": "#999999", + "editorCommentsWidget.rangeActiveBackground": "#007fd41a", + "editorCommentsWidget.rangeBackground": "#007fd41a", + "editorCommentsWidget.replyInputBackground": "#252526", + "editorCommentsWidget.resolvedBorder": "#cccccc80", + "editorCommentsWidget.unresolvedBorder": "#007fd4", + "editorCursor.foreground": "#aeafad", + "editorError.foreground": "#f14c4c", + "editorGhostText.foreground": "#ffffff56", + "editorGroup.border": "#444444", + "editorGroup.dropBackground": "#53595d80", + "editorGroup.dropIntoPromptBackground": "#252526", + "editorGroup.dropIntoPromptForeground": "#cccccc", + "editorGroupHeader.noTabsBackground": "#1e1e1e", + "editorGroupHeader.tabsBackground": "#252526", + "editorGutter.addedBackground": "#487e02", + "editorGutter.background": "#1e1e1e", + "editorGutter.commentGlyphForeground": "#d4d4d4", + "editorGutter.commentRangeForeground": "#37373d", + "editorGutter.commentUnresolvedGlyphForeground": "#d4d4d4", + "editorGutter.deletedBackground": "#f14c4c", + "editorGutter.foldingControlForeground": "#c5c5c5", + "editorGutter.modifiedBackground": "#1b81a8", + "editorHint.foreground": "#eeeeeeb3", + "editorHoverWidget.background": "#252526", + "editorHoverWidget.border": "#454545", + "editorHoverWidget.foreground": "#cccccc", + "editorHoverWidget.highlightForeground": "#2aaaff", + "editorHoverWidget.statusBarBackground": "#2c2c2d", + "editorIndentGuide.activeBackground2": "#00000000", + "editorIndentGuide.activeBackground3": "#00000000", + "editorIndentGuide.activeBackground4": "#00000000", + "editorIndentGuide.activeBackground5": "#00000000", + "editorIndentGuide.activeBackground6": "#00000000", + "editorIndentGuide.background2": "#00000000", + "editorIndentGuide.background3": "#00000000", + "editorIndentGuide.background4": "#00000000", + "editorIndentGuide.background5": "#00000000", + "editorIndentGuide.background6": "#00000000", + "editorInfo.foreground": "#3794ff", + "editorInlayHint.background": "#4d4d4d1a", + "editorInlayHint.foreground": "#969696", + "editorInlayHint.parameterBackground": "#4d4d4d1a", + "editorInlayHint.parameterForeground": "#969696", + "editorInlayHint.typeBackground": "#4d4d4d1a", + "editorInlayHint.typeForeground": "#969696", + "editorLightBulb.foreground": "#ffcc00", + "editorLightBulbAi.foreground": "#ffcc00", + "editorLightBulbAutoFix.foreground": "#75beff", + "editorLineNumber.activeForeground": "#c6c6c6", + "editorLineNumber.foreground": "#858585", + "editorLink.activeForeground": "#4e94ce", + "editorMarkerNavigation.background": "#1e1e1e", + "editorMarkerNavigationError.background": "#f14c4c", + "editorMarkerNavigationError.headerBackground": "#f14c4c1a", + "editorMarkerNavigationInfo.background": "#3794ff", + "editorMarkerNavigationInfo.headerBackground": "#3794ff1a", + "editorMarkerNavigationWarning.background": "#cca700", + "editorMarkerNavigationWarning.headerBackground": "#cca7001a", + "editorMultiCursor.primary.foreground": "#aeafad", + "editorMultiCursor.secondary.foreground": "#aeafad", + "editorOverviewRuler.addedForeground": "#487e0299", + "editorOverviewRuler.border": "#7f7f7f4d", + "editorOverviewRuler.bracketMatchForeground": "#a0a0a0", + "editorOverviewRuler.commentForeground": "#37373d", + "editorOverviewRuler.commentUnresolvedForeground": "#37373d", + "editorOverviewRuler.commonContentForeground": "#60606066", + "editorOverviewRuler.currentContentForeground": "#40c8ae80", + "editorOverviewRuler.deletedForeground": "#f14c4c99", + "editorOverviewRuler.errorForeground": "#ff1212b3", + "editorOverviewRuler.findMatchForeground": "#d186167e", + "editorOverviewRuler.incomingContentForeground": "#40a6ff80", + "editorOverviewRuler.infoForeground": "#3794ff", + "editorOverviewRuler.inlineChatInserted": "#9ccc2c1f", + "editorOverviewRuler.inlineChatRemoved": "#ff00001f", + "editorOverviewRuler.modifiedForeground": "#1b81a899", + "editorOverviewRuler.rangeHighlightForeground": "#007acc99", + "editorOverviewRuler.selectionHighlightForeground": "#a0a0a0cc", + "editorOverviewRuler.warningForeground": "#cca700", + "editorOverviewRuler.wordHighlightForeground": "#a0a0a0cc", + "editorOverviewRuler.wordHighlightStrongForeground": "#c0a0c0cc", + "editorOverviewRuler.wordHighlightTextForeground": "#a0a0a0cc", + "editorPane.background": "#1e1e1e", + "editorRuler.foreground": "#5a5a5a", + "editorStickyScroll.background": "#1e1e1e", + "editorStickyScroll.shadow": "#000000", + "editorStickyScrollHover.background": "#2a2d2e", + "editorSuggestWidget.background": "#252526", + "editorSuggestWidget.border": "#454545", + "editorSuggestWidget.focusHighlightForeground": "#2aaaff", + "editorSuggestWidget.foreground": "#d4d4d4", + "editorSuggestWidget.highlightForeground": "#2aaaff", + "editorSuggestWidget.selectedBackground": "#04395e", + "editorSuggestWidget.selectedForeground": "#ffffff", + "editorSuggestWidget.selectedIconForeground": "#ffffff", + "editorSuggestWidgetStatus.foreground": "#d4d4d480", + "editorUnicodeHighlight.border": "#cca700", + "editorUnnecessaryCode.opacity": "#000000aa", + "editorWarning.foreground": "#cca700", + "editorWatermark.foreground": "#d4d4d499", + "editorWhitespace.foreground": "#e3e4e229", + "editorWidget.background": "#252526", + "editorWidget.border": "#454545", + "editorWidget.foreground": "#cccccc", + "errorForeground": "#f48771", + "errorLens.errorBackground": "#e454541b", + "errorLens.errorBackgroundLight": "#e4545420", + "errorLens.errorForeground": "#ff6464", + "errorLens.errorForegroundLight": "#e45454", + "errorLens.errorMessageBackground": "#e4545419", + "errorLens.errorRangeBackground": "#e4545419", + "errorLens.hintBackground": "#17a2a220", + "errorLens.hintBackgroundLight": "#17a2a220", + "errorLens.hintForeground": "#2faf64", + "errorLens.hintForegroundLight": "#2faf64", + "errorLens.hintMessageBackground": "#17a2a219", + "errorLens.hintRangeBackground": "#17a2a219", + "errorLens.infoBackground": "#00b7e420", + "errorLens.infoBackgroundLight": "#00b7e420", + "errorLens.infoForeground": "#00b7e4", + "errorLens.infoForegroundLight": "#00b7e4", + "errorLens.infoMessageBackground": "#00b7e419", + "errorLens.infoRangeBackground": "#00b7e419", + "errorLens.statusBarErrorForeground": "#ff6464", + "errorLens.statusBarHintForeground": "#2faf64", + "errorLens.statusBarIconErrorForeground": "#ff6464", + "errorLens.statusBarIconWarningForeground": "#fa973a", + "errorLens.statusBarInfoForeground": "#00b7e4", + "errorLens.statusBarWarningForeground": "#fa973a", + "errorLens.warningBackground": "#ff942f1b", + "errorLens.warningBackgroundLight": "#ff942f20", + "errorLens.warningForeground": "#fa973a", + "errorLens.warningForegroundLight": "#ff942f", + "errorLens.warningMessageBackground": "#ff942f19", + "errorLens.warningRangeBackground": "#ff942f19", + "extensionBadge.remoteBackground": "#007acc", + "extensionBadge.remoteForeground": "#ffffff", + "extensionButton.background": "#0e639c", + "extensionButton.foreground": "#ffffff", + "extensionButton.hoverBackground": "#1177bb", + "extensionButton.prominentBackground": "#0e639c", + "extensionButton.prominentForeground": "#ffffff", + "extensionButton.prominentHoverBackground": "#1177bb", + "extensionButton.separator": "#ffffff66", + "extensionIcon.preReleaseForeground": "#1d9271", + "extensionIcon.sponsorForeground": "#d758b3", + "extensionIcon.starForeground": "#ff8e00", + "extensionIcon.verifiedForeground": "#3794ff", + "focusBorder": "#007fd4", + "foreground": "#cccccc", + "gitDecoration.addedResourceForeground": "#81b88b", + "gitDecoration.conflictingResourceForeground": "#e4676b", + "gitDecoration.deletedResourceForeground": "#c74e39", + "gitDecoration.ignoredResourceForeground": "#8c8c8c", + "gitDecoration.modifiedResourceForeground": "#e2c08d", + "gitDecoration.renamedResourceForeground": "#73c991", + "gitDecoration.stageDeletedResourceForeground": "#c74e39", + "gitDecoration.stageModifiedResourceForeground": "#e2c08d", + "gitDecoration.submoduleResourceForeground": "#8db9e2", + "gitDecoration.untrackedResourceForeground": "#73c991", + "icon.foreground": "#c5c5c5", + "inlineChat.background": "#252526", + "inlineChat.border": "#454545", + "inlineChat.regionHighlight": "#264f7840", + "inlineChat.shadow": "#0000005c", + "inlineChatDiff.inserted": "#9ccc2c1a", + "inlineChatDiff.removed": "#ff00001a", + "inlineChatInput.background": "#3c3c3c", + "inlineChatInput.border": "#454545", + "inlineChatInput.focusBorder": "#007fd4", + "inlineChatInput.placeholderForeground": "#a6a6a6", + "input.background": "#3c3c3c", + "input.foreground": "#cccccc", + "inputOption.activeBackground": "#007fd466", + "inputOption.activeBorder": "#007acc", + "inputOption.activeForeground": "#ffffff", + "inputOption.hoverBackground": "#5a5d5e80", + "inputValidation.errorBackground": "#5a1d1d", + "inputValidation.errorBorder": "#be1100", + "inputValidation.infoBackground": "#063b49", + "inputValidation.infoBorder": "#007acc", + "inputValidation.warningBackground": "#352a05", + "inputValidation.warningBorder": "#b89500", + "interactive.activeCodeBorder": "#007acc", + "interactive.inactiveCodeBorder": "#37373d", + "keybindingLabel.background": "#8080802b", + "keybindingLabel.border": "#33333399", + "keybindingLabel.bottomBorder": "#44444499", + "keybindingLabel.foreground": "#cccccc", + "keybindingTable.headerBackground": "#cccccc0a", + "keybindingTable.rowsBackground": "#cccccc0a", + "list.activeSelectionBackground": "#04395e", + "list.activeSelectionForeground": "#ffffff", + "list.deemphasizedForeground": "#8c8c8c", + "list.dropBetweenBackground": "#c5c5c5", + "list.errorForeground": "#f88070", + "list.filterMatchBackground": "#ea5c0055", + "list.focusHighlightForeground": "#2aaaff", + "list.focusOutline": "#007fd4", + "list.highlightForeground": "#2aaaff", + "list.hoverBackground": "#2a2d2e", + "list.inactiveSelectionBackground": "#37373d", + "list.invalidItemForeground": "#b89500", + "list.warningForeground": "#cca700", + "listFilterWidget.background": "#252526", + "listFilterWidget.noMatchesOutline": "#be1100", + "listFilterWidget.outline": "#00000000", + "listFilterWidget.shadow": "#0000005c", + "menu.selectionBackground": "#04395e", + "menu.selectionForeground": "#ffffff", + "menubar.selectionBackground": "#5a5d5e50", + "menubar.selectionForeground": "#cccccc", + "merge.commonContentBackground": "#60606029", + "merge.commonHeaderBackground": "#60606066", + "merge.currentContentBackground": "#40c8ae33", + "merge.currentHeaderBackground": "#40c8ae80", + "merge.incomingContentBackground": "#40a6ff33", + "merge.incomingHeaderBackground": "#40a6ff80", + "mergeEditor.change.background": "#9bb95533", + "mergeEditor.change.word.background": "#9ccc2c33", + "mergeEditor.changeBase.background": "#4b1818", + "mergeEditor.changeBase.word.background": "#6f1313", + "mergeEditor.conflict.handled.minimapOverViewRuler": "#adaca8ee", + "mergeEditor.conflict.handledFocused.border": "#c1c1c1cc", + "mergeEditor.conflict.handledUnfocused.border": "#86868649", + "mergeEditor.conflict.input1.background": "#40c8ae33", + "mergeEditor.conflict.input2.background": "#40a6ff33", + "mergeEditor.conflict.unhandled.minimapOverViewRuler": "#fcba03", + "mergeEditor.conflict.unhandledFocused.border": "#ffa600", + "mergeEditor.conflict.unhandledUnfocused.border": "#ffa6007a", + "mergeEditor.conflictingLines.background": "#ffea0047", + "minimap.errorHighlight": "#ff1212b3", + "minimap.findMatchHighlight": "#d18616", + "minimap.foregroundOpacity": "#000000", + "minimap.infoHighlight": "#3794ff", + "minimap.selectionHighlight": "#264f78", + "minimap.selectionOccurrenceHighlight": "#676767", + "minimap.warningHighlight": "#cca700", + "minimapGutter.addedBackground": "#487e02", + "minimapGutter.deletedBackground": "#f14c4c", + "minimapGutter.modifiedBackground": "#1b81a8", + "minimapSlider.activeBackground": "#bfbfbf33", + "minimapSlider.background": "#79797933", + "minimapSlider.hoverBackground": "#64646459", + "multiDiffEditor.border": "#cccccc33", + "multiDiffEditor.headerBackground": "#262626", + "notebook.cellBorderColor": "#37373d", + "notebook.cellEditorBackground": "#252526", + "notebook.cellInsertionIndicator": "#007fd4", + "notebook.cellStatusBarItemHoverBackground": "#ffffff26", + "notebook.cellToolbarSeparator": "#80808059", + "notebook.editorBackground": "#1e1e1e", + "notebook.focusedCellBorder": "#007fd4", + "notebook.focusedEditorBorder": "#007fd4", + "notebook.inactiveFocusedCellBorder": "#37373d", + "notebook.selectedCellBackground": "#37373d", + "notebook.selectedCellBorder": "#37373d", + "notebook.symbolHighlightBackground": "#ffffff0b", + "notebookEditorOverviewRuler.runningCellForeground": "#89d185", + "notebookScrollbarSlider.activeBackground": "#bfbfbf66", + "notebookScrollbarSlider.background": "#79797966", + "notebookScrollbarSlider.hoverBackground": "#646464b3", + "notebookStatusErrorIcon.foreground": "#f48771", + "notebookStatusRunningIcon.foreground": "#cccccc", + "notebookStatusSuccessIcon.foreground": "#89d185", + "notificationCenter.border": "#303031", + "notificationCenterHeader.background": "#303031", + "notificationLink.foreground": "#3794ff", + "notificationToast.border": "#303031", + "notifications.background": "#252526", + "notifications.border": "#303031", + "notifications.foreground": "#cccccc", + "notificationsErrorIcon.foreground": "#f14c4c", + "notificationsInfoIcon.foreground": "#3794ff", + "notificationsWarningIcon.foreground": "#cca700", + "panel.background": "#1e1e1e", + "panel.border": "#80808059", + "panel.dropBorder": "#e7e7e7", + "panelSection.border": "#80808059", + "panelSection.dropBackground": "#53595d80", + "panelSectionHeader.background": "#80808033", + "panelTitle.activeBorder": "#e7e7e7", + "panelTitle.activeForeground": "#e7e7e7", + "panelTitle.inactiveForeground": "#e7e7e799", + "peekView.border": "#3794ff", + "peekViewEditor.background": "#001f33", + "peekViewEditor.matchHighlightBackground": "#ff8f0099", + "peekViewEditorGutter.background": "#001f33", + "peekViewEditorStickyScroll.background": "#001f33", + "peekViewResult.background": "#252526", + "peekViewResult.fileForeground": "#ffffff", + "peekViewResult.lineForeground": "#bbbbbb", + "peekViewResult.matchHighlightBackground": "#ea5c004d", + "peekViewResult.selectionBackground": "#3399ff33", + "peekViewResult.selectionForeground": "#ffffff", + "peekViewTitle.background": "#252526", + "peekViewTitleDescription.foreground": "#ccccccb3", + "peekViewTitleLabel.foreground": "#ffffff", + "pickerGroup.border": "#3f3f46", + "pickerGroup.foreground": "#3794ff", + "problemsErrorIcon.foreground": "#f14c4c", + "problemsInfoIcon.foreground": "#3794ff", + "problemsWarningIcon.foreground": "#cca700", + "profileBadge.background": "#4d4d4d", + "profileBadge.foreground": "#ffffff", + "progressBar.background": "#0e70c0", + "quickInput.background": "#252526", + "quickInput.foreground": "#cccccc", + "quickInputList.focusBackground": "#04395e", + "quickInputList.focusForeground": "#ffffff", + "quickInputList.focusIconForeground": "#ffffff", + "quickInputTitle.background": "#ffffff1b", + "sash.hoverBorder": "#007fd4", + "scm.historyItemAdditionsForeground": "#81b88b", + "scm.historyItemDeletionsForeground": "#c74e39", + "scm.historyItemSelectedStatisticsBorder": "#ffffff33", + "scm.historyItemStatisticsBorder": "#cccccc33", + "scrollbar.shadow": "#000000", + "scrollbarSlider.activeBackground": "#bfbfbf66", + "scrollbarSlider.background": "#79797966", + "scrollbarSlider.hoverBackground": "#646464b3", + "search.resultsInfoForeground": "#cccccca6", + "searchEditor.findMatchBackground": "#ea5c0038", + "settings.checkboxBackground": "#3c3c3c", + "settings.checkboxBorder": "#6b6b6b", + "settings.checkboxForeground": "#f0f0f0", + "settings.dropdownBackground": "#3c3c3c", + "settings.dropdownBorder": "#3c3c3c", + "settings.dropdownForeground": "#f0f0f0", + "settings.dropdownListBorder": "#454545", + "settings.focusedRowBackground": "#2a2d2e99", + "settings.focusedRowBorder": "#007fd4", + "settings.headerBorder": "#80808059", + "settings.headerForeground": "#e7e7e7", + "settings.modifiedItemIndicator": "#0c7d9d", + "settings.numberInputBackground": "#3c3c3c", + "settings.numberInputForeground": "#cccccc", + "settings.rowHoverBackground": "#2a2d2e4d", + "settings.sashBorder": "#80808059", + "settings.settingsHeaderHoverForeground": "#e7e7e7b3", + "settings.textInputBackground": "#3c3c3c", + "settings.textInputForeground": "#cccccc", + "sideBar.background": "#252526", + "sideBar.dropBackground": "#53595d80", + "sideBarActivityBarTop.border": "#cccccc33", + "sideBySideEditor.horizontalBorder": "#444444", + "sideBySideEditor.verticalBorder": "#444444", + "simpleFindWidget.sashBorder": "#454545", + "statusBar.background": "#007acc", + "statusBar.debuggingBackground": "#cc6633", + "statusBar.debuggingForeground": "#ffffff", + "statusBar.focusBorder": "#ffffff", + "statusBar.foreground": "#ffffff", + "statusBar.noFolderBackground": "#68217a", + "statusBar.noFolderForeground": "#ffffff", + "statusBarItem.activeBackground": "#ffffff2e", + "statusBarItem.compactHoverBackground": "#ffffff33", + "statusBarItem.errorBackground": "#c72e0f", + "statusBarItem.errorForeground": "#ffffff", + "statusBarItem.errorHoverBackground": "#ffffff1f", + "statusBarItem.errorHoverForeground": "#ffffff", + "statusBarItem.focusBorder": "#ffffff", + "statusBarItem.hoverBackground": "#ffffff1f", + "statusBarItem.hoverForeground": "#ffffff", + "statusBarItem.offlineBackground": "#6c1717", + "statusBarItem.offlineForeground": "#ffffff", + "statusBarItem.offlineHoverBackground": "#ffffff1f", + "statusBarItem.offlineHoverForeground": "#ffffff", + "statusBarItem.prominentBackground": "#00000080", + "statusBarItem.prominentForeground": "#ffffff", + "statusBarItem.prominentHoverBackground": "#0000004d", + "statusBarItem.prominentHoverForeground": "#ffffff", + "statusBarItem.remoteHoverBackground": "#ffffff1f", + "statusBarItem.remoteHoverForeground": "#ffffff", + "statusBarItem.warningBackground": "#7a6400", + "statusBarItem.warningForeground": "#ffffff", + "statusBarItem.warningHoverBackground": "#ffffff1f", + "statusBarItem.warningHoverForeground": "#ffffff", + "symbolIcon.arrayForeground": "#cccccc", + "symbolIcon.booleanForeground": "#cccccc", + "symbolIcon.classForeground": "#ee9d28", + "symbolIcon.colorForeground": "#cccccc", + "symbolIcon.constantForeground": "#cccccc", + "symbolIcon.constructorForeground": "#b180d7", + "symbolIcon.enumeratorForeground": "#ee9d28", + "symbolIcon.enumeratorMemberForeground": "#75beff", + "symbolIcon.eventForeground": "#ee9d28", + "symbolIcon.fieldForeground": "#75beff", + "symbolIcon.fileForeground": "#cccccc", + "symbolIcon.folderForeground": "#cccccc", + "symbolIcon.functionForeground": "#b180d7", + "symbolIcon.interfaceForeground": "#75beff", + "symbolIcon.keyForeground": "#cccccc", + "symbolIcon.keywordForeground": "#cccccc", + "symbolIcon.methodForeground": "#b180d7", + "symbolIcon.moduleForeground": "#cccccc", + "symbolIcon.namespaceForeground": "#cccccc", + "symbolIcon.nullForeground": "#cccccc", + "symbolIcon.numberForeground": "#cccccc", + "symbolIcon.objectForeground": "#cccccc", + "symbolIcon.operatorForeground": "#cccccc", + "symbolIcon.packageForeground": "#cccccc", + "symbolIcon.propertyForeground": "#cccccc", + "symbolIcon.referenceForeground": "#cccccc", + "symbolIcon.snippetForeground": "#cccccc", + "symbolIcon.stringForeground": "#cccccc", + "symbolIcon.structForeground": "#cccccc", + "symbolIcon.textForeground": "#cccccc", + "symbolIcon.typeParameterForeground": "#cccccc", + "symbolIcon.unitForeground": "#cccccc", + "symbolIcon.variableForeground": "#75beff", + "tab.activeBackground": "#1e1e1e", + "tab.activeForeground": "#ffffff", + "tab.activeModifiedBorder": "#3399cc", + "tab.border": "#252526", + "tab.dragAndDropBorder": "#ffffff", + "tab.inactiveBackground": "#2d2d2d", + "tab.inactiveForeground": "#ffffff80", + "tab.inactiveModifiedBorder": "#3399cc80", + "tab.unfocusedActiveBackground": "#1e1e1e", + "tab.unfocusedActiveForeground": "#ffffff80", + "tab.unfocusedActiveModifiedBorder": "#3399cc80", + "tab.unfocusedInactiveBackground": "#2d2d2d", + "tab.unfocusedInactiveForeground": "#ffffff40", + "tab.unfocusedInactiveModifiedBorder": "#3399cc40", + "terminal.ansiBlack": "#000000", + "terminal.ansiBlue": "#2472c8", + "terminal.ansiBrightBlack": "#666666", + "terminal.ansiBrightBlue": "#3b8eea", + "terminal.ansiBrightCyan": "#29b8db", + "terminal.ansiBrightGreen": "#23d18b", + "terminal.ansiBrightMagenta": "#d670d6", + "terminal.ansiBrightRed": "#f14c4c", + "terminal.ansiBrightWhite": "#e5e5e5", + "terminal.ansiBrightYellow": "#f5f543", + "terminal.ansiCyan": "#11a8cd", + "terminal.ansiGreen": "#0dbc79", + "terminal.ansiMagenta": "#bc3fbc", + "terminal.ansiRed": "#cd3131", + "terminal.ansiWhite": "#e5e5e5", + "terminal.ansiYellow": "#e5e510", + "terminal.border": "#80808059", + "terminal.dropBackground": "#53595d80", + "terminal.findMatchBackground": "#515c6a", + "terminal.findMatchHighlightBackground": "#ea5c0055", + "terminal.foreground": "#cccccc", + "terminal.hoverHighlightBackground": "#264f7820", + "terminal.selectionBackground": "#264f78", + "terminalCommandDecoration.defaultBackground": "#ffffff40", + "terminalCommandDecoration.errorBackground": "#f14c4c", + "terminalCommandDecoration.successBackground": "#1b81a8", + "terminalOverviewRuler.cursorForeground": "#a0a0a0cc", + "terminalOverviewRuler.findMatchForeground": "#d186167e", + "terminalStickyScrollHover.background": "#2a2d2e", + "testing.coverCountBadgeBackground": "#4d4d4d", + "testing.coverCountBadgeForeground": "#ffffff", + "testing.coveredBackground": "#9ccc2c33", + "testing.coveredBorder": "#9ccc2c26", + "testing.coveredGutterBackground": "#9ccc2c1f", + "testing.iconErrored": "#f14c4c", + "testing.iconErrored.retired": "#f14c4cb3", + "testing.iconFailed": "#f14c4c", + "testing.iconFailed.retired": "#f14c4cb3", + "testing.iconPassed": "#73c991", + "testing.iconPassed.retired": "#73c991b3", + "testing.iconQueued": "#cca700", + "testing.iconQueued.retired": "#cca700b3", + "testing.iconSkipped": "#848484", + "testing.iconSkipped.retired": "#848484b3", + "testing.iconUnset": "#848484", + "testing.iconUnset.retired": "#848484b3", + "testing.message.error.decorationForeground": "#f14c4c", + "testing.message.error.lineBackground": "#ff000033", + "testing.message.info.decorationForeground": "#d4d4d480", + "testing.messagePeekBorder": "#3794ff", + "testing.messagePeekHeaderBackground": "#3794ff1a", + "testing.peekBorder": "#f14c4c", + "testing.peekHeaderBackground": "#f14c4c1a", + "testing.runAction": "#73c991", + "testing.uncoveredBackground": "#ff000033", + "testing.uncoveredBorder": "#ff000026", + "testing.uncoveredBranchBackground": "#781212", + "testing.uncoveredGutterBackground": "#ff00004d", + "textBlockQuote.background": "#222222", + "textBlockQuote.border": "#007acc80", + "textCodeBlock.background": "#0a0a0a66", + "textLink.activeForeground": "#3794ff", + "textLink.foreground": "#3794ff", + "textPreformat.background": "#ffffff1a", + "textPreformat.foreground": "#d7ba7d", + "textSeparator.foreground": "#ffffff2e", + "titleBar.activeBackground": "#3c3c3c", + "titleBar.activeForeground": "#cccccc", + "titleBar.inactiveBackground": "#3c3c3c99", + "titleBar.inactiveForeground": "#cccccc99", + "toolbar.activeBackground": "#63666750", + "toolbar.hoverBackground": "#5a5d5e50", + "tree.inactiveIndentGuidesStroke": "#58585866", + "tree.indentGuidesStroke": "#585858", + "tree.tableColumnsBorder": "#cccccc20", + "tree.tableOddRowsBackground": "#cccccc0a", + "walkThrough.embeddedEditorBackground": "#00000066", + "walkthrough.stepTitle.foreground": "#ffffff", + "welcomePage.progress.background": "#3c3c3c", + "welcomePage.progress.foreground": "#3794ff", + "welcomePage.tileBackground": "#252526", + "welcomePage.tileBorder": "#ffffff1a", + "welcomePage.tileHoverBackground": "#2c2c2d", + "widget.shadow": "#0000005c", + }, + "tokenColors": [ + { + "scope": [ + "meta.embedded", + "source.groovy.embedded", + "string meta.image.inline.markdown", + "variable.legacy.builtin.python" + ], + "settings": { + "foreground": "#D4D4D4" + } + }, + { + "scope": "emphasis", + "settings": { + "fontStyle": "italic" + } + }, + { + "scope": "strong", + "settings": { + "fontStyle": "bold" + } + }, + { + "scope": "header", + "settings": { + "foreground": "#000080" + } + }, + { + "scope": "comment", + "settings": { + "foreground": "#6A9955" + } + }, + { + "scope": "constant.language", + "settings": { + "foreground": "#569CD6" + } + }, + { + "scope": [ + "constant.numeric", + "variable.other.enummember", + "keyword.operator.plus.exponent", + "keyword.operator.minus.exponent" + ], + "settings": { + "foreground": "#B5CEA8" + } + }, + { + "scope": "constant.regexp", + "settings": { + "foreground": "#646695" + } + }, + { + "scope": "entity.name.tag", + "settings": { + "foreground": "#569CD6" + } + }, + { + "scope": [ + "entity.name.tag.css", + "entity.name.tag.less" + ], + "settings": { + "foreground": "#D7BA7D" + } + }, + { + "scope": "entity.other.attribute-name", + "settings": { + "foreground": "#9CDCFE" + } + }, + { + "scope": [ + "entity.other.attribute-name.class.css", + "source.css entity.other.attribute-name.class", + "entity.other.attribute-name.id.css", + "entity.other.attribute-name.parent-selector.css", + "entity.other.attribute-name.parent.less", + "source.css entity.other.attribute-name.pseudo-class", + "entity.other.attribute-name.pseudo-element.css", + "source.css.less entity.other.attribute-name.id", + "entity.other.attribute-name.scss" + ], + "settings": { + "foreground": "#D7BA7D" + } + }, + { + "scope": "invalid", + "settings": { + "foreground": "#F44747" + } + }, + { + "scope": "markup.underline", + "settings": { + "fontStyle": "underline" + } + }, + { + "scope": "markup.bold", + "settings": { + "foreground": "#569CD6", + "fontStyle": "bold" + } + }, + { + "scope": "markup.heading", + "settings": { + "foreground": "#569CD6", + "fontStyle": "bold" + } + }, + { + "scope": "markup.italic", + "settings": { + "fontStyle": "italic" + } + }, + { + "scope": "markup.strikethrough", + "settings": { + "fontStyle": "strikethrough" + } + }, + { + "scope": "markup.inserted", + "settings": { + "foreground": "#B5CEA8" + } + }, + { + "scope": "markup.deleted", + "settings": { + "foreground": "#CE9178" + } + }, + { + "scope": "markup.changed", + "settings": { + "foreground": "#569CD6" + } + }, + { + "scope": "punctuation.definition.quote.begin.markdown", + "settings": { + "foreground": "#6A9955" + } + }, + { + "scope": "punctuation.definition.list.begin.markdown", + "settings": { + "foreground": "#6796E6" + } + }, + { + "scope": "markup.inline.raw", + "settings": { + "foreground": "#CE9178" + } + }, + { + "scope": "punctuation.definition.tag", + "settings": { + "foreground": "#808080" + } + }, + { + "scope": [ + "meta.preprocessor", + "entity.name.function.preprocessor" + ], + "settings": { + "foreground": "#569CD6" + } + }, + { + "scope": "meta.preprocessor.string", + "settings": { + "foreground": "#CE9178" + } + }, + { + "scope": "meta.preprocessor.numeric", + "settings": { + "foreground": "#B5CEA8" + } + }, + { + "scope": "meta.structure.dictionary.key.python", + "settings": { + "foreground": "#9CDCFE" + } + }, + { + "scope": "meta.diff.header", + "settings": { + "foreground": "#569CD6" + } + }, + { + "scope": "storage", + "settings": { + "foreground": "#569CD6" + } + }, + { + "scope": "storage.type", + "settings": { + "foreground": "#569CD6" + } + }, + { + "scope": [ + "storage.modifier", + "keyword.operator.noexcept" + ], + "settings": { + "foreground": "#569CD6" + } + }, + { + "scope": [ + "string", + "meta.embedded.assembly" + ], + "settings": { + "foreground": "#CE9178" + } + }, + { + "scope": "string.tag", + "settings": { + "foreground": "#CE9178" + } + }, + { + "scope": "string.value", + "settings": { + "foreground": "#CE9178" + } + }, + { + "scope": "string.regexp", + "settings": { + "foreground": "#D16969" + } + }, + { + "scope": [ + "punctuation.definition.template-expression.begin", + "punctuation.definition.template-expression.end", + "punctuation.section.embedded" + ], + "settings": { + "foreground": "#569CD6" + } + }, + { + "scope": [ + "meta.template.expression" + ], + "settings": { + "foreground": "#D4D4D4" + } + }, + { + "scope": [ + "support.type.vendored.property-name", + "support.type.property-name", + "source.css variable", + "source.coffee.embedded" + ], + "settings": { + "foreground": "#9CDCFE" + } + }, + { + "scope": "keyword", + "settings": { + "foreground": "#569CD6" + } + }, + { + "scope": "keyword.control.tonto", + "settings": { + "foreground": "#569CD6" + } + }, + { + "name": "Keywords", + "scope": [ + "keyword.control.nonSortal" + ], + "settings": { + "fontStyle": "italic" + } + }, + { + "scope": "keyword.operator", + "settings": { + "foreground": "#D4D4D4" + } + }, + { + "scope": [ + "keyword.operator.new", + "keyword.operator.expression", + "keyword.operator.cast", + "keyword.operator.sizeof", + "keyword.operator.alignof", + "keyword.operator.typeid", + "keyword.operator.alignas", + "keyword.operator.instanceof", + "keyword.operator.logical.python", + "keyword.operator.wordlike" + ], + "settings": { + "foreground": "#569CD6" + } + }, + { + "scope": "keyword.other.unit", + "settings": { + "foreground": "#B5CEA8" + } + }, + { + "scope": [ + "punctuation.section.embedded.begin.php", + "punctuation.section.embedded.end.php" + ], + "settings": { + "foreground": "#569CD6" + } + }, + { + "scope": "support.function.git-rebase", + "settings": { + "foreground": "#9CDCFE" + } + }, + { + "scope": "constant.sha.git-rebase", + "settings": { + "foreground": "#B5CEA8" + } + }, + { + "scope": [ + "storage.modifier.import.java", + "variable.language.wildcard.java", + "storage.modifier.package.java" + ], + "settings": { + "foreground": "#D4D4D4" + } + }, + { + "scope": "variable.language", + "settings": { + "foreground": "#569CD6" + } + }, + { + "scope": [ + "entity.name.function", + "support.function", + "support.constant.handlebars", + "source.powershell variable.other.member", + "entity.name.operator.custom-literal" + ], + "settings": { + "foreground": "#DCDCAA" + } + }, + { + "scope": [ + "support.class", + "support.type", + "entity.name.type", + "entity.name.namespace", + "entity.other.attribute", + "entity.name.scope-resolution", + "entity.name.class", + "storage.type.numeric.go", + "storage.type.byte.go", + "storage.type.boolean.go", + "storage.type.string.go", + "storage.type.uintptr.go", + "storage.type.error.go", + "storage.type.rune.go", + "storage.type.cs", + "storage.type.generic.cs", + "storage.type.modifier.cs", + "storage.type.variable.cs", + "storage.type.annotation.java", + "storage.type.generic.java", + "storage.type.java", + "storage.type.object.array.java", + "storage.type.primitive.array.java", + "storage.type.primitive.java", + "storage.type.token.java", + "storage.type.groovy", + "storage.type.annotation.groovy", + "storage.type.parameters.groovy", + "storage.type.generic.groovy", + "storage.type.object.array.groovy", + "storage.type.primitive.array.groovy", + "storage.type.primitive.groovy" + ], + "settings": { + "foreground": "#4EC9B0" + } + }, + { + "scope": [ + "meta.type.cast.expr", + "meta.type.new.expr", + "support.constant.math", + "support.constant.dom", + "support.constant.json", + "entity.other.inherited-class" + ], + "settings": { + "foreground": "#4EC9B0" + } + }, + { + "scope": [ + "keyword.control", + "source.cpp keyword.operator.new", + "keyword.operator.delete", + "keyword.other.using", + "keyword.other.directive.using", + "keyword.other.operator", + "entity.name.operator" + ], + "settings": { + "foreground": "#C586C0" + } + }, + { + "scope": [ + "variable", + "meta.definition.variable.name", + "support.variable", + "entity.name.variable", + "constant.other.placeholder" + ], + "settings": { + "foreground": "#9CDCFE" + } + }, + { + "scope": [ + "variable.other.constant", + "variable.other.enummember" + ], + "settings": { + "foreground": "#4FC1FF" + } + }, + { + "scope": [ + "meta.object-literal.key" + ], + "settings": { + "foreground": "#9CDCFE" + } + }, + { + "scope": [ + "support.constant.property-value", + "support.constant.font-name", + "support.constant.media-type", + "support.constant.media", + "constant.other.color.rgb-value", + "constant.other.rgb-value", + "support.constant.color" + ], + "settings": { + "foreground": "#CE9178" + } + }, + { + "scope": [ + "punctuation.definition.group.regexp", + "punctuation.definition.group.assertion.regexp", + "punctuation.definition.character-class.regexp", + "punctuation.character.set.begin.regexp", + "punctuation.character.set.end.regexp", + "keyword.operator.negation.regexp", + "support.other.parenthesis.regexp" + ], + "settings": { + "foreground": "#CE9178" + } + }, + { + "scope": [ + "constant.character.character-class.regexp", + "constant.other.character-class.set.regexp", + "constant.other.character-class.regexp", + "constant.character.set.regexp" + ], + "settings": { + "foreground": "#D16969" + } + }, + { + "scope": [ + "keyword.operator.or.regexp", + "keyword.control.anchor.regexp" + ], + "settings": { + "foreground": "#DCDCAA" + } + }, + { + "scope": "keyword.operator.quantifier.regexp", + "settings": { + "foreground": "#D7BA7D" + } + }, + { + "scope": [ + "constant.character", + "constant.other.option" + ], + "settings": { + "foreground": "#569CD6" + } + }, + { + "scope": "constant.character.escape", + "settings": { + "foreground": "#D7BA7D" + } + }, + { + "scope": "entity.name.label", + "settings": { + "foreground": "#C8C8C8" + } + }, + { + "scope": "token.info-token", + "settings": { + "foreground": "#6796E6" + } + }, + { + "scope": "token.warn-token", + "settings": { + "foreground": "#CD9731" + } + }, + { + "scope": "token.error-token", + "settings": { + "foreground": "#F44747" + } + }, + { + "scope": "token.debug-token", + "settings": { + "foreground": "#B267E6" + } + } + ], + "semanticHighlighting": true, + "semanticTokenColors": { + "tontoKind": { + "foreground": "#CD6872", + "fontStyle": "bold" + }, + "tontoQualityKind": { + "foreground": "#19b0f1", + "fontStyle": "bold" + }, + "tontoQuantityKind": { + "foreground": "#CD6872", + "fontStyle": "bold" + }, + "tontoCollectiveKind": { + "foreground": "#CD6872", + "fontStyle": "bold" + }, + "tontoRelatorKind": { + "foreground": "#45e72b", + "fontStyle": "bold" + }, + "tontoEvent": { + "foreground": "#d1ca3c", + "fontStyle": "bold" + }, + "tontoModeKind": { + "foreground": "#19b0f1", + "fontStyle": "bold" + }, + "tontoMode": { + "foreground": "#19b0f1", + "fontStyle": "italic" + }, + "tontoSituation": { + "foreground": "#fca90d", + "fontStyle": "bold" + }, + "tontoType": { + "foreground": "#9b69b1", + "fontStyle": "bold" + }, + "tontoObjects": { + "foreground": "#CD6872", + "fontStyle": "bold" + }, + "tontoFunctionalComplex": { + "foreground": "#f46a6a", + "fontStyle": "italic" + }, + "tontoQuality": { + "foreground": "#19b0f1", + "fontStyle": "italic" + }, + "tontoQuantity": { + "foreground": "#CD6872", + "fontStyle": "italic" + }, + "tontoCollective": { + "foreground": "#CD6872", + "fontStyle": "italic" + }, + "tontoRelator": { + "foreground": "#45e72b", + "fontStyle": "italic" + }, + "tontoNone": { + "foreground": "#a1a1a1", + } + } +} \ No newline at end of file diff --git a/packages/tonto-vscode/tsconfig.json b/packages/tonto-vscode/tsconfig.json index 0065c13..590c42d 100644 --- a/packages/tonto-vscode/tsconfig.json +++ b/packages/tonto-vscode/tsconfig.json @@ -11,10 +11,9 @@ } ], "include": [ - "src/**/*" + "src/**/*.ts" ], "exclude": [ - "out", "/node_modules" ] } \ No newline at end of file diff --git a/packages/tonto-vscode/tsconfig.monarch.json b/packages/tonto-vscode/tsconfig.monarch.json new file mode 100644 index 0000000..4177516 --- /dev/null +++ b/packages/tonto-vscode/tsconfig.monarch.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "target": "ES2017", + "module": "ESNext", + "sourceMap": true, + "outDir": "syntaxes", + "strict": true, + "noUnusedLocals": true, + "noImplicitReturns": true, + "noImplicitOverride": true, + "moduleResolution": "node", + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true + }, + "include": [ + "data/tonto.monarch.ts" + ], + "exclude": ["out", "node_modules"] +} diff --git a/packages/tonto/langium-config.json b/packages/tonto/langium-config.json index 6c75b59..ec60aa3 100644 --- a/packages/tonto/langium-config.json +++ b/packages/tonto/langium-config.json @@ -7,6 +7,9 @@ "caseInsensitive": false, "textMate": { "out": "syntaxes/tonto.tmLanguage.json" + }, + "monarch": { + "out": "syntaxes/tonto.monarch.ts" } }], "out": "src/language/generated" diff --git a/packages/tonto/package.json b/packages/tonto/package.json index 12e7ea5..5544337 100644 --- a/packages/tonto/package.json +++ b/packages/tonto/package.json @@ -8,7 +8,7 @@ }, "type": "module", "description": "Tonto is a DSL for creating OntoUML models", - "version": "0.3.2", + "version": "0.3.4", "license": "MIT", "icon": "data/images/TontoIcon.png", "repository": { @@ -60,8 +60,8 @@ "ontouml-js": "github:matheuslenke/ontouml-js#feature/include-types-in-build", "rimraf": "^4.1.2", "uuid": "^9.0.1", - "vscode-languageclient": "^8.0.2", - "vscode-languageserver": "^8.0.2", + "vscode-languageclient": "~9.0.1", + "vscode-languageserver": "~9.0.1", "vscode-languageserver-types": "^3.17.3", "vscode-uri": "^3.0.7" }, diff --git a/packages/tonto/src/language/generated/ast.ts b/packages/tonto/src/language/generated/ast.ts index c22b506..7d987d0 100644 --- a/packages/tonto/src/language/generated/ast.ts +++ b/packages/tonto/src/language/generated/ast.ts @@ -179,6 +179,7 @@ export interface DataType extends AstNode { elements: Array; isEnum: boolean; name: QualifiedName; + ontologicalCategory?: 'datatype'; ontologicalNature?: ElementOntologicalNature; specializationEndurants: Array>; } @@ -467,6 +468,7 @@ export class TontoAstReflection extends AbstractAstReflection { { name: 'elements', defaultValue: [] }, { name: 'isEnum', defaultValue: false }, { name: 'name' }, + { name: 'ontologicalCategory' }, { name: 'ontologicalNature' }, { name: 'specializationEndurants', defaultValue: [] } ] diff --git a/packages/tonto/src/language/generated/grammar.ts b/packages/tonto/src/language/generated/grammar.ts index cb6b43b..0087eb5 100644 --- a/packages/tonto/src/language/generated/grammar.ts +++ b/packages/tonto/src/language/generated/grammar.ts @@ -928,8 +928,13 @@ export const TontoGrammar = (): Grammar => loadedTontoGrammar ?? (loadedTontoGra "$type": "Group", "elements": [ { - "$type": "Keyword", - "value": "datatype" + "$type": "Assignment", + "feature": "ontologicalCategory", + "operator": "=", + "terminal": { + "$type": "Keyword", + "value": "datatype" + } }, { "$type": "Assignment", @@ -1522,10 +1527,6 @@ export const TontoGrammar = (): Grammar => loadedTontoGrammar ?? (loadedTontoGra "$type": "Keyword", "value": "relation" }, - { - "$type": "Keyword", - "value": ":" - }, { "$type": "Assignment", "feature": "firstEnd", @@ -1614,10 +1615,6 @@ export const TontoGrammar = (): Grammar => loadedTontoGrammar ?? (loadedTontoGra }, "cardinality": "?" }, - { - "$type": "Keyword", - "value": ":" - }, { "$type": "Assignment", "feature": "secondEnd", diff --git a/packages/tonto/src/language/grammar/datatypes.langium b/packages/tonto/src/language/grammar/datatypes.langium index 5287544..743fefe 100644 --- a/packages/tonto/src/language/grammar/datatypes.langium +++ b/packages/tonto/src/language/grammar/datatypes.langium @@ -5,7 +5,7 @@ import "relations" // <--- DataTypes ---> DataType: - 'datatype' name=QualifiedName ontologicalNature=ElementOntologicalNature? + ontologicalCategory='datatype' name=QualifiedName ontologicalNature=ElementOntologicalNature? ('specializes' specializationEndurants+=[DataTypeOrClass:QualifiedName] (',' specializationEndurants+=[DataTypeOrClass:QualifiedName])? )? diff --git a/packages/tonto/src/language/grammar/relations.langium b/packages/tonto/src/language/grammar/relations.langium index fc8af83..0e03e17 100644 --- a/packages/tonto/src/language/grammar/relations.langium +++ b/packages/tonto/src/language/grammar/relations.langium @@ -12,7 +12,7 @@ InternalRelation infers ElementRelation: ExternalRelation infers ElementRelation: ('@'relationType=RelationStereotype)? - 'relation' ':'firstEnd=[DataTypeOrClassOrRelation:QualifiedName] + 'relation' firstEnd=[DataTypeOrClassOrRelation:QualifiedName] RelationData ; @@ -24,7 +24,7 @@ fragment RelationData: RelationName secondCardinality=Cardinality? - ':'secondEnd=[DataTypeOrClassOrRelation:QualifiedName] + secondEnd=[DataTypeOrClassOrRelation:QualifiedName] secondEndMetaAttributes=RelationMetaAttributes? ('specializes' specializeRelation=[ElementRelation:QualifiedName])? diff --git a/packages/tonto/src/language/lsp/completions/completeForAttribute.ts b/packages/tonto/src/language/lsp/completions/completeForAttribute.ts index 36a66d6..2951cf8 100644 --- a/packages/tonto/src/language/lsp/completions/completeForAttribute.ts +++ b/packages/tonto/src/language/lsp/completions/completeForAttribute.ts @@ -1,30 +1,29 @@ -// import { AbstractElement } from "langium/grammar/generated/ast.js"; -// import { CompletionItemKind } from "vscode-languageserver"; -// import { InsertTextFormat } from "vscode-languageserver"; +import { CompletionItemKind, InsertTextFormat } from "vscode-languageserver"; -import { CompletionAcceptor, NextFeature } from "langium/lsp"; +import { CompletionAcceptor, CompletionContext, NextFeature } from "langium/lsp"; -function completeForAttributeSnippets(next: NextFeature, acceptor: CompletionAcceptor) { - // if (next.property === "name") { - // acceptor({ - // label: "attribute", - // kind: CompletionItemKind.Snippet, - // detail: "Basic internal association", - // sortText: "100", - // insertText: "${1:name}: ${2:type}", - // insertTextFormat: InsertTextFormat.Snippet, - // }); +export function completeForAttributeSnippets( + context: CompletionContext, + next: NextFeature, + acceptor: CompletionAcceptor) { + if (next.property === "name") { + acceptor(context, { + label: "attribute", + kind: CompletionItemKind.Snippet, + detail: "Basic internal association", + sortText: "100", + insertText: "${1:name}: ${2:type}", + insertTextFormat: InsertTextFormat.Snippet, + }); - // acceptor({ - // label: "complete-attribute", - // kind: CompletionItemKind.Snippet, - // detail: "Basic internal association", - // sortText: "100", - // insertText: "${1:name}: ${2:type} [${3:*}] { $4 }", - // insertTextFormat: InsertTextFormat.Snippet, - // }); - // } + acceptor(context, { + label: "complete-attribute", + kind: CompletionItemKind.Snippet, + detail: "Basic internal association", + sortText: "100", + insertText: "${1:name}: ${2:type} [${3:*}] { $4 }", + insertTextFormat: InsertTextFormat.Snippet, + }); + } } - -export { completeForAttributeSnippets }; diff --git a/packages/tonto/src/language/lsp/completions/completeForCardinality.ts b/packages/tonto/src/language/lsp/completions/completeForCardinality.ts index 7b400fc..11f01e2 100644 --- a/packages/tonto/src/language/lsp/completions/completeForCardinality.ts +++ b/packages/tonto/src/language/lsp/completions/completeForCardinality.ts @@ -1,33 +1,33 @@ -// import { CompletionItemKind } from "vscode-languageserver"; +import { CompletionItemKind } from "vscode-languageserver"; -import { CompletionAcceptor } from "langium/lsp"; +import { CompletionAcceptor, CompletionContext } from "langium/lsp"; -function completeForCardinality(acceptor: CompletionAcceptor) { - // acceptor({ - // label: "[1]", - // kind: CompletionItemKind.Keyword, - // detail: "Cardinality", - // sortText: "0", - // }); - // acceptor({ - // label: "[*]", - // kind: CompletionItemKind.Keyword, - // detail: "Cardinality", - // sortText: "0", - // }); - // acceptor({ - // label: "[0..*]", - // kind: CompletionItemKind.Keyword, - // detail: "Cardinality", - // sortText: "0", - // }); - // acceptor({ - // label: "[0..2]", - // kind: CompletionItemKind.Keyword, - // detail: "Cardinality", - // sortText: "0", - // }); +function completeForCardinality(context: CompletionContext, acceptor: CompletionAcceptor) { + acceptor(context, { + label: "[1]", + kind: CompletionItemKind.Keyword, + detail: "Cardinality", + sortText: "0", + }); + acceptor(context, { + label: "[*]", + kind: CompletionItemKind.Keyword, + detail: "Cardinality", + sortText: "0", + }); + acceptor(context, { + label: "[0..*]", + kind: CompletionItemKind.Keyword, + detail: "Cardinality", + sortText: "0", + }); + acceptor(context, { + label: "[0..2]", + kind: CompletionItemKind.Keyword, + detail: "Cardinality", + sortText: "0", + }); } export { completeForCardinality }; diff --git a/packages/tonto/src/language/lsp/completions/completeForDatatype.ts b/packages/tonto/src/language/lsp/completions/completeForDatatype.ts index a59d575..6004675 100644 --- a/packages/tonto/src/language/lsp/completions/completeForDatatype.ts +++ b/packages/tonto/src/language/lsp/completions/completeForDatatype.ts @@ -1,26 +1,24 @@ +import { CompletionAcceptor, CompletionContext, NextFeature } from "langium/lsp"; +import { CompletionItemKind } from "vscode-languageserver"; +import { InsertTextFormat } from "vscode-languageserver-types"; -// import { CompletionItemKind } from "vscode-languageserver"; -// import { InsertTextFormat } from "vscode-languageserver-types"; - -import { CompletionAcceptor, NextFeature } from "langium/lsp"; - -function completeForDataType(next: NextFeature, acceptor: CompletionAcceptor) { - // acceptor({ - // label: "basic-datatype", - // kind: CompletionItemKind.Snippet, - // detail: "Basic Datatype", - // sortText: "100", - // insertText: ["datatype ${1:name} {", "$2", "}"].join("\n"), - // insertTextFormat: InsertTextFormat.Snippet, - // }); - // acceptor({ - // label: "nature-datatype", - // kind: CompletionItemKind.Snippet, - // detail: "Datatype with Ontological Nature", - // sortText: "100", - // insertText: ["datatype ${1:name} of ${2:nature} {", "$2", "}"].join("\n"), - // insertTextFormat: InsertTextFormat.Snippet, - // }); +function completeForDataType(context: CompletionContext, next: NextFeature, acceptor: CompletionAcceptor) { + acceptor(context, { + label: "basic-datatype", + kind: CompletionItemKind.Snippet, + detail: "Basic Datatype", + sortText: "100", + insertText: ["datatype ${1:name} {", "$2", "}"].join("\n"), + insertTextFormat: InsertTextFormat.Snippet, + }); + acceptor(context, { + label: "nature-datatype", + kind: CompletionItemKind.Snippet, + detail: "Datatype with Ontological Nature", + sortText: "100", + insertText: ["datatype ${1:name} of ${2:nature} {", "$2", "}"].join("\n"), + insertTextFormat: InsertTextFormat.Snippet, + }); } export { completeForDataType }; diff --git a/packages/tonto/src/language/lsp/completions/completeForElementRelation.ts b/packages/tonto/src/language/lsp/completions/completeForElementRelation.ts index 04259ae..9eaf513 100644 --- a/packages/tonto/src/language/lsp/completions/completeForElementRelation.ts +++ b/packages/tonto/src/language/lsp/completions/completeForElementRelation.ts @@ -1,61 +1,64 @@ -// import { CompletionItemKind } from "vscode-languageserver"; -// import { InsertTextFormat } from "vscode-languageserver-types"; -// import { completeForCardinality } from "./completeForCardinality.js"; +import { CompletionItemKind } from "vscode-languageserver"; +import { InsertTextFormat } from "vscode-languageserver-types"; +import { completeForCardinality } from "./completeForCardinality.js"; -import { CompletionAcceptor, NextFeature } from "langium/lsp"; +import { CompletionAcceptor, CompletionContext, NextFeature } from "langium/lsp"; -function completeForElementRelation(keyword: NextFeature, acceptor: CompletionAcceptor) { - // switch (keyword.value) { - // case "--": - // acceptor({ - // label: "-- $relationName --", - // kind: CompletionItemKind.Snippet, - // detail: "Association", - // insertTextFormat: InsertTextFormat.Snippet, - // sortText: "10", - // }); - // acceptor({ - // label: "--", - // kind: CompletionItemKind.Keyword, - // detail: "Association", - // sortText: "1", - // }); - // break; - // case "<>--": - // acceptor({ - // label: "<>-- $relationName --", - // kind: CompletionItemKind.Snippet, - // detail: "Composition", - // sortText: "10", - // insertTextFormat: InsertTextFormat.Snippet, - // }); - // acceptor({ - // label: "<>--", - // kind: CompletionItemKind.Keyword, - // detail: "Association", - // sortText: "1", - // }); - // break; - // case "[": - // completeForCardinality(acceptor); - // break; - // case "(": - // acceptor({ - // label: "( $endName )", - // kind: CompletionItemKind.Snippet, - // detail: "End name", - // sortText: "10", - // insertTextFormat: InsertTextFormat.Snippet, - // }); - // acceptor({ - // label: "( { ${1:const} } ${2:endName} )", - // kind: CompletionItemKind.Snippet, - // detail: "Complete end name", - // sortText: "10", - // insertTextFormat: InsertTextFormat.Snippet, - // }); - // break; - // } +function completeForElementRelation( + context: CompletionContext, + keyword: NextFeature, + acceptor: CompletionAcceptor) { + switch (keyword.property) { + case "--": + acceptor(context, { + label: "-- $relationName --", + kind: CompletionItemKind.Snippet, + detail: "Association", + insertTextFormat: InsertTextFormat.Snippet, + sortText: "10", + }); + acceptor(context, { + label: "--", + kind: CompletionItemKind.Keyword, + detail: "Association", + sortText: "1", + }); + break; + case "<>--": + acceptor(context, { + label: "<>-- $relationName --", + kind: CompletionItemKind.Snippet, + detail: "Composition", + sortText: "10", + insertTextFormat: InsertTextFormat.Snippet, + }); + acceptor(context, { + label: "<>--", + kind: CompletionItemKind.Keyword, + detail: "Association", + sortText: "1", + }); + break; + case "[": + completeForCardinality(context, acceptor); + break; + case "(": + acceptor(context, { + label: "( $endName )", + kind: CompletionItemKind.Snippet, + detail: "End name", + sortText: "10", + insertTextFormat: InsertTextFormat.Snippet, + }); + acceptor(context, { + label: "( { ${1:const} } ${2:endName} )", + kind: CompletionItemKind.Snippet, + detail: "Complete end name", + sortText: "10", + insertTextFormat: InsertTextFormat.Snippet, + }); + break; + } } export { completeForElementRelation }; diff --git a/packages/tonto/src/language/lsp/completions/completeForEnumSnippets.ts b/packages/tonto/src/language/lsp/completions/completeForEnumSnippets.ts index adc753c..3a21959 100644 --- a/packages/tonto/src/language/lsp/completions/completeForEnumSnippets.ts +++ b/packages/tonto/src/language/lsp/completions/completeForEnumSnippets.ts @@ -1,18 +1,20 @@ +import { CompletionItemKind } from "vscode-languageserver"; +import { InsertTextFormat } from "vscode-languageserver-types"; -// import { CompletionItemKind } from "vscode-languageserver"; -// import { InsertTextFormat } from "vscode-languageserver-types"; +import { CompletionAcceptor, CompletionContext, NextFeature } from "langium/lsp"; -import { CompletionAcceptor, NextFeature } from "langium/lsp"; - -function completeForEnumSnippets(next: NextFeature, acceptor: CompletionAcceptor) { - // acceptor({ - // label: "enum", - // kind: CompletionItemKind.Snippet, - // detail: "Basic internal association", - // sortText: "100", - // insertText: ["enum ${1:name} {", "$2", "}"].join("\n"), - // insertTextFormat: InsertTextFormat.Snippet, - // }); +function completeForEnumSnippets( + context: CompletionContext, + next: NextFeature, + acceptor: CompletionAcceptor) { + acceptor(context, { + label: "enum", + kind: CompletionItemKind.Snippet, + detail: "Basic internal association", + sortText: "100", + insertText: ["enum ${1:name} {", "$2", "}"].join("\n"), + insertTextFormat: InsertTextFormat.Snippet, + }); } export { completeForEnumSnippets }; diff --git a/packages/tonto/src/language/lsp/completions/completeForGenSet.ts b/packages/tonto/src/language/lsp/completions/completeForGenSet.ts index 84cdb22..8d516b3 100644 --- a/packages/tonto/src/language/lsp/completions/completeForGenSet.ts +++ b/packages/tonto/src/language/lsp/completions/completeForGenSet.ts @@ -1,43 +1,42 @@ -// import { CompletionItemKind } from "vscode-languageserver"; -// import { InsertTextFormat } from "vscode-languageserver"; +import { CompletionItemKind, InsertTextFormat } from "vscode-languageserver"; -import { CompletionAcceptor, NextFeature } from "langium/lsp"; +import { CompletionAcceptor, CompletionContext, NextFeature } from "langium/lsp"; -function completeForGenSetSnippets(next: NextFeature, acceptor: CompletionAcceptor) { - // acceptor({ - // label: "genset", - // kind: CompletionItemKind.Snippet, - // detail: "Basic internal association", - // sortText: "100", - // insertText: ["genset ${1:name} {", "\tgeneral ${2:Superclass}", "\tspecifics ${3:Subclass}", "}"].join("\n"), - // insertTextFormat: InsertTextFormat.Snippet, - // }); +function completeForGenSetSnippets(context: CompletionContext, next: NextFeature, acceptor: CompletionAcceptor) { + acceptor(context, { + label: "genset", + kind: CompletionItemKind.Snippet, + detail: "Basic internal association", + sortText: "100", + insertText: ["genset ${1:name} {", "\tgeneral ${2:Superclass}", "\tspecifics ${3:Subclass}", "}"].join("\n"), + insertTextFormat: InsertTextFormat.Snippet, + }); - // acceptor({ - // label: "complete-genset", - // kind: CompletionItemKind.Snippet, - // detail: "Basic internal association", - // sortText: "100", - // insertText: ["complete genset ${1:name} {", "\tgeneral ${2:Superclass}", "\tspecifics ${3:Subclass}", "}"].join( - // "\n" - // ), - // insertTextFormat: InsertTextFormat.Snippet, - // }); + acceptor(context, { + label: "complete-genset", + kind: CompletionItemKind.Snippet, + detail: "Basic internal association", + sortText: "100", + insertText: ["complete genset ${1:name} {", "\tgeneral ${2:Superclass}", "\tspecifics ${3:Subclass}", "}"].join( + "\n" + ), + insertTextFormat: InsertTextFormat.Snippet, + }); - // acceptor({ - // label: "disjoint-complete-genset", - // kind: CompletionItemKind.Snippet, - // detail: "Basic internal association", - // sortText: "100", - // insertText: [ - // "disjoint complete genset ${1:name} {", - // "\tgeneral ${2:Superclass}", - // "\tspecifics ${3:Subclass}", - // "}", - // ].join("\n"), - // insertTextFormat: InsertTextFormat.Snippet, - // }); + acceptor(context, { + label: "disjoint-complete-genset", + kind: CompletionItemKind.Snippet, + detail: "Basic internal association", + sortText: "100", + insertText: [ + "disjoint complete genset ${1:name} {", + "\tgeneral ${2:Superclass}", + "\tspecifics ${3:Subclass}", + "}", + ].join("\n"), + insertTextFormat: InsertTextFormat.Snippet, + }); } export { completeForGenSetSnippets }; diff --git a/packages/tonto/src/language/lsp/completions/completeFullElementRelationSnippets.ts b/packages/tonto/src/language/lsp/completions/completeFullElementRelationSnippets.ts index c4b8178..7954c81 100644 --- a/packages/tonto/src/language/lsp/completions/completeFullElementRelationSnippets.ts +++ b/packages/tonto/src/language/lsp/completions/completeFullElementRelationSnippets.ts @@ -1,134 +1,133 @@ +import { CompletionAcceptor, CompletionContext } from "langium/lsp"; +import { CompletionItemKind } from "vscode-languageserver"; +import { InsertTextFormat } from "vscode-languageserver-types"; -// import { CompletionItemKind } from "vscode-languageserver"; -// import { InsertTextFormat } from "vscode-languageserver-types"; - -import { CompletionAcceptor } from "langium/lsp"; - -function completeFullElementRelationSnippets(acceptor: CompletionAcceptor) { - // acceptor({ - // label: "basic-internal-association", - // kind: CompletionItemKind.Snippet, - // detail: "Basic internal association", - // sortText: "102", - // insertText: "[${1:*}] -- ${2:relationName} -- [${3:*}] ${4:DeclarationName}", - // insertTextFormat: InsertTextFormat.Snippet, - // }); - // acceptor({ - // label: "internal-association", - // kind: CompletionItemKind.Snippet, - // detail: "internal association", - // sortText: "101", - // insertText: [ - // "@${1:relationStereotype}", - // "(${2:firstEndName}) [${3:*}] -- ${4:relationName} -- [${5:*}] (${6:secondEndName}) ${7:DeclarationName}", - // ].join("\n"), - // insertTextFormat: InsertTextFormat.Snippet, - // }); - // acceptor({ - // label: "full-internal-association", - // kind: CompletionItemKind.Snippet, - // detail: "Full internal association", - // sortText: "103", - // insertText: [ - // "@${1:stereotype}", - // "({ ${2:metaAttributes} } ${3:firstEndName}) [${4:1}] -- ${5:relationName} -- [${6:1}] ({${7:metaAttributes}} ${8:secondEndName}) ${9:Reference}", - // ].join("\n"), - // insertTextFormat: InsertTextFormat.Snippet, - // }); - // acceptor({ - // label: "basic-internal-aggregation", - // kind: CompletionItemKind.Snippet, - // detail: "Basic internal aggregation", - // sortText: "102", - // insertText: "[${1:*}] <>-- ${2:relationName} -- [${3:*}] ${4:DeclarationName}", - // insertTextFormat: InsertTextFormat.Snippet, - // }); - // acceptor({ - // label: "internal-aggregation", - // kind: CompletionItemKind.Snippet, - // detail: "internal aggregation", - // sortText: "101", - // insertText: [ - // "@${1:relationStereotype}", - // "(${2:firstEndName}) [${3:*}] <>-- ${4:relationName} -- [${5:*}] (${7:secondEndName}) ${6:DeclarationName}", - // ].join("\n"), - // insertTextFormat: InsertTextFormat.Snippet, - // }); - // acceptor({ - // label: "full-internal-aggregation", - // kind: CompletionItemKind.Snippet, - // detail: "Full internal aggregation", - // sortText: "103", - // insertText: [ - // "@${1:stereotype}", - // "({ ${2:metaAttributes} } ${3:firstEndName}) [${4:1}] <>-- ${5:relationName} -- [${6:1}] ({${7:metaAttributes}} ${8:secondEndName}) ${9:Reference}", - // ].join("\n"), - // insertTextFormat: InsertTextFormat.Snippet, - // }); +export function completeFullElementRelationSnippets( + context: CompletionContext, + acceptor: CompletionAcceptor) { + acceptor(context, { + label: "basic-internal-association", + kind: CompletionItemKind.Snippet, + detail: "Basic internal association", + sortText: "102", + insertText: "[${1:*}] -- ${2:relationName} -- [${3:*}] ${4:DeclarationName}", + insertTextFormat: InsertTextFormat.Snippet, + }); + acceptor(context, { + label: "internal-association", + kind: CompletionItemKind.Snippet, + detail: "internal association", + sortText: "101", + insertText: [ + "@${1:relationStereotype}", + "(${2:firstEndName}) [${3:*}] -- ${4:relationName} -- [${5:*}] (${6:secondEndName}) ${7:DeclarationName}", + ].join("\n"), + insertTextFormat: InsertTextFormat.Snippet, + }); + acceptor(context, { + label: "full-internal-association", + kind: CompletionItemKind.Snippet, + detail: "Full internal association", + sortText: "103", + insertText: [ + "@${1:stereotype}", + "({ ${2:metaAttributes} } ${3:firstEndName}) [${4:1}] -- ${5:relationName} -- [${6:1}] ({${7:metaAttributes}} ${8:secondEndName}) ${9:Reference}", + ].join("\n"), + insertTextFormat: InsertTextFormat.Snippet, + }); + acceptor(context, { + label: "basic-internal-aggregation", + kind: CompletionItemKind.Snippet, + detail: "Basic internal aggregation", + sortText: "102", + insertText: "[${1:*}] <>-- ${2:relationName} -- [${3:*}] ${4:DeclarationName}", + insertTextFormat: InsertTextFormat.Snippet, + }); + acceptor(context, { + label: "internal-aggregation", + kind: CompletionItemKind.Snippet, + detail: "internal aggregation", + sortText: "101", + insertText: [ + "@${1:relationStereotype}", + "(${2:firstEndName}) [${3:*}] <>-- ${4:relationName} -- [${5:*}] (${7:secondEndName}) ${6:DeclarationName}", + ].join("\n"), + insertTextFormat: InsertTextFormat.Snippet, + }); + acceptor(context, { + label: "full-internal-aggregation", + kind: CompletionItemKind.Snippet, + detail: "Full internal aggregation", + sortText: "103", + insertText: [ + "@${1:stereotype}", + "({ ${2:metaAttributes} } ${3:firstEndName}) [${4:1}] <>-- ${5:relationName} -- [${6:1}] ({${7:metaAttributes}} ${8:secondEndName}) ${9:Reference}", + ].join("\n"), + insertTextFormat: InsertTextFormat.Snippet, + }); } -// function completeFullExternalElementRelationSnippets(acceptor: CompletionAcceptor) { -// acceptor({ -// label: "basic-external-association", -// kind: CompletionItemKind.Snippet, -// detail: "Basic external association", -// sortText: "102", -// insertText: "relation ${1:Reference} [${2:*}] -- ${3:relationName} -- [${4:*}] ${5:DeclarationName}", -// insertTextFormat: InsertTextFormat.Snippet, -// }); -// acceptor({ -// label: "external-association", -// kind: CompletionItemKind.Snippet, -// detail: "external association", -// sortText: "101", -// insertText: [ -// "@${1:relationStereotype}", -// "relation ${2:Reference} (${3:firstEndName}) [${4:*}] -- ${5:relationName} -- [${6:*}] (${7:secondEndName}) ${8:DeclarationName}", -// ].join("\n"), -// insertTextFormat: InsertTextFormat.Snippet, -// }); -// acceptor({ -// label: "full-external-association", -// kind: CompletionItemKind.Snippet, -// detail: "Full external association", -// sortText: "103", -// insertText: [ -// "@${1:stereotype}", -// "relation ${2:Reference} ({ ${3:metaAttributes} } ${4:firstEndName}) [${5:1}] -- ${6:relationName} -- [${7:1}] ({${8:metaAttributes}} ${9:secondEndName}) ${10:Reference}", -// ].join("\n"), -// insertTextFormat: InsertTextFormat.Snippet, -// }); -// acceptor({ -// label: "basic-external-aggregation", -// kind: CompletionItemKind.Snippet, -// detail: "Basic external aggregation", -// sortText: "102", -// insertText: "relation ${1:Reference} [${2:*}] <>-- ${3:relationName} -- [${4:*}] ${5:DeclarationName}", -// insertTextFormat: InsertTextFormat.Snippet, -// }); -// acceptor({ -// label: "external-aggregation", -// kind: CompletionItemKind.Snippet, -// detail: "external aggregation", -// sortText: "101", -// insertText: [ -// "@${1:relationStereotype}", -// "relation ${2:Reference} (${3:firstEndName}) [${4:*}] <>-- ${5:relationName} -- [${6:*}] (${7:secondEndName}) ${8:DeclarationName}", -// ].join("\n"), -// insertTextFormat: InsertTextFormat.Snippet, -// }); -// acceptor({ -// label: "full-internal-aggregation", -// kind: CompletionItemKind.Snippet, -// detail: "Full internal aggregation", -// sortText: "103", -// insertText: [ -// "@${1:stereotype}", -// "relation ${2:Reference} ({ ${3:metaAttributes} } ${4:firstEndName}) [${5:1}] <>-- ${6:relationName} -- [${7:1}] ({${8:metaAttributes}} ${9:secondEndName}) ${10:Reference}", -// ].join("\n"), -// insertTextFormat: InsertTextFormat.Snippet, -// }); -// } - -export { completeFullElementRelationSnippets }; - +export function completeFullExternalElementRelationSnippets( + context: CompletionContext, + acceptor: CompletionAcceptor) { + acceptor(context, { + label: "basic-external-association", + kind: CompletionItemKind.Snippet, + detail: "Basic external association", + sortText: "102", + insertText: "relation ${1:Reference} [${2:*}] -- ${3:relationName} -- [${4:*}] ${5:DeclarationName}", + insertTextFormat: InsertTextFormat.Snippet, + }); + acceptor(context, { + label: "external-association", + kind: CompletionItemKind.Snippet, + detail: "external association", + sortText: "101", + insertText: [ + "@${1:relationStereotype}", + "relation ${2:Reference} (${3:firstEndName}) [${4:*}] -- ${5:relationName} -- [${6:*}] (${7:secondEndName}) ${8:DeclarationName}", + ].join("\n"), + insertTextFormat: InsertTextFormat.Snippet, + }); + acceptor(context, { + label: "full-external-association", + kind: CompletionItemKind.Snippet, + detail: "Full external association", + sortText: "103", + insertText: [ + "@${1:stereotype}", + "relation ${2:Reference} ({ ${3:metaAttributes} } ${4:firstEndName}) [${5:1}] -- ${6:relationName} -- [${7:1}] ({${8:metaAttributes}} ${9:secondEndName}) ${10:Reference}", + ].join("\n"), + insertTextFormat: InsertTextFormat.Snippet, + }); + acceptor(context, { + label: "basic-external-aggregation", + kind: CompletionItemKind.Snippet, + detail: "Basic external aggregation", + sortText: "102", + insertText: "relation ${1:Reference} [${2:*}] <>-- ${3:relationName} -- [${4:*}] ${5:DeclarationName}", + insertTextFormat: InsertTextFormat.Snippet, + }); + acceptor(context, { + label: "external-aggregation", + kind: CompletionItemKind.Snippet, + detail: "external aggregation", + sortText: "101", + insertText: [ + "@${1:relationStereotype}", + "relation ${2:Reference} (${3:firstEndName}) [${4:*}] <>-- ${5:relationName} -- [${6:*}] (${7:secondEndName}) ${8:DeclarationName}", + ].join("\n"), + insertTextFormat: InsertTextFormat.Snippet, + }); + acceptor(context, { + label: "full-internal-aggregation", + kind: CompletionItemKind.Snippet, + detail: "Full internal aggregation", + sortText: "103", + insertText: [ + "@${1:stereotype}", + "relation ${2:Reference} ({ ${3:metaAttributes} } ${4:firstEndName}) [${5:1}] <>-- ${6:relationName} -- [${7:1}] ({${8:metaAttributes}} ${9:secondEndName}) ${10:Reference}", + ].join("\n"), + insertTextFormat: InsertTextFormat.Snippet, + }); +} diff --git a/packages/tonto/src/language/lsp/semantic-token-types.ts b/packages/tonto/src/language/lsp/semantic-token-types.ts new file mode 100644 index 0000000..b23b7b5 --- /dev/null +++ b/packages/tonto/src/language/lsp/semantic-token-types.ts @@ -0,0 +1,68 @@ +import { SemanticTokenModifiers, SemanticTokenTypes, SemanticTokensOptions } from "vscode-languageserver"; + +export const TontoSemanticTokenTypes: Record = { + [SemanticTokenTypes.class]: 0, + [SemanticTokenTypes.comment]: 1, + [SemanticTokenTypes.enum]: 2, + [SemanticTokenTypes.enumMember]: 3, + [SemanticTokenTypes.event]: 4, + [SemanticTokenTypes.function]: 5, + [SemanticTokenTypes.interface]: 6, + [SemanticTokenTypes.keyword]: 7, + [SemanticTokenTypes.macro]: 8, + [SemanticTokenTypes.method]: 9, + [SemanticTokenTypes.modifier]: 10, + [SemanticTokenTypes.namespace]: 11, + [SemanticTokenTypes.number]: 12, + [SemanticTokenTypes.operator]: 13, + [SemanticTokenTypes.parameter]: 14, + [SemanticTokenTypes.property]: 15, + [SemanticTokenTypes.regexp]: 16, + [SemanticTokenTypes.string]: 17, + [SemanticTokenTypes.struct]: 18, + [SemanticTokenTypes.type]: 19, + [SemanticTokenTypes.typeParameter]: 20, + [SemanticTokenTypes.variable]: 21, + [SemanticTokenTypes.decorator]: 22, + ["tontoKind"]: 23, + ["tontoRelatorKind"]: 24, + ["tontoQualityKind"]: 25, + ["tontoQuantityKind"]: 26, + ["tontoCollectiveKind"]: 27, + ["tontoEvent"]: 28, + ["tontoModeKind"]: 29, + ["tontoMode"]: 30, + ["tontoSituation"]: 31, + ["tontoType"]: 32, + ["tontoObjects"]: 33, + ["tontoNone"]: 34, + ["tontoFunctionalComplex"]: 35, + ["tontoRelator"]: 36, + ["tontoQuality"]: 37, + ["tontoQuantity"]: 38, + ["tontoCollective"]: 39 +}; + +export const AllSemanticTokenModifiers: Record = { + [SemanticTokenModifiers.abstract]: 1 << 0, + [SemanticTokenModifiers.async]: 1 << 1, + [SemanticTokenModifiers.declaration]: 1 << 2, + [SemanticTokenModifiers.defaultLibrary]: 1 << 3, + [SemanticTokenModifiers.definition]: 1 << 4, + [SemanticTokenModifiers.deprecated]: 1 << 5, + [SemanticTokenModifiers.documentation]: 1 << 6, + [SemanticTokenModifiers.modification]: 1 << 7, + [SemanticTokenModifiers.readonly]: 1 << 8, + [SemanticTokenModifiers.static]: 1 << 9 +}; + +export const TontoSemanticTokenOptions: SemanticTokensOptions = { + legend: { + tokenTypes: Object.keys(TontoSemanticTokenTypes), + tokenModifiers: Object.keys(AllSemanticTokenModifiers) + }, + full: { + delta: true + }, + range: true +}; diff --git a/packages/tonto/src/language/lsp/tonto-completion-provider.ts b/packages/tonto/src/language/lsp/tonto-completion-provider.ts index 71d1dfa..e089855 100644 --- a/packages/tonto/src/language/lsp/tonto-completion-provider.ts +++ b/packages/tonto/src/language/lsp/tonto-completion-provider.ts @@ -1,115 +1,81 @@ -import { DefaultCompletionProvider } from "langium/lsp"; -// import * as ast from "langium/grammar/generated/ast.js"; -// import { completeForCardinality } from "./completions/completeForCardinality.js"; -// import { completeForElementRelation } from "./completions/completeForElementRelation.js"; -// import { completeForEnumSnippets } from "./completions/completeForEnumSnippets.js"; -// import { completeForAttributeSnippets } from "./completions/completeForAttribute.js"; -// import { completeForDataType } from "./completions/completeForDatatype.js"; -// import { -// completeFullElementRelationSnippets, -// completeFullExternalElementRelationSnippets, -// } from "./completions/completeFullElementRelationSnippets.js"; -// import { completeForGenSetSnippets } from "./completions/completeForGenSet.js"; -// import { isParserRule } from "langium/grammar/generated/ast.js"; +import { AstNode, GrammarAST, MaybePromise } from "langium"; +import { CompletionAcceptor, CompletionContext, DefaultCompletionProvider, NextFeature } from "langium/lsp"; +import { completeForAttributeSnippets } from "./completions/completeForAttribute.js"; +import { completeForCardinality } from "./completions/completeForCardinality.js"; +import { completeForDataType } from "./completions/completeForDatatype.js"; +import { completeForElementRelation } from "./completions/completeForElementRelation.js"; +import { completeForEnumSnippets } from "./completions/completeForEnumSnippets.js"; +import { completeForGenSetSnippets } from "./completions/completeForGenSet.js"; +import { completeFullElementRelationSnippets, completeFullExternalElementRelationSnippets } from "./completions/completeFullElementRelationSnippets.js"; export class TontoCompletionProvider extends DefaultCompletionProvider { - // protected override async completionForRule( - // context: CompletionContext, - // rule: ast.AbstractRule, - // acceptor: CompletionAcceptor - // ): Promise { - // return super.completionForRule(context, rule, acceptor); - // } - // protected override completionFor( - // context: CompletionContext, - // next: NextFeature, - // acceptor: CompletionAcceptor - // ): MaybePromise { - // // Completion for Cardinality in any context - // if (ast.isKeyword(next.feature) && next.type === "Cardinality" && next.feature.value === "[") { - // completeForCardinality(acceptor); - // } + protected override completionFor(context: CompletionContext, next: NextFeature, acceptor: CompletionAcceptor): MaybePromise { + // Completion for Cardinality in any context + if (GrammarAST.isKeyword(next.feature) && next.type === "Cardinality" && next.feature.value === "[") { + completeForCardinality(context, acceptor); + } - // if (ast.isKeyword(next.feature)) { - // switch (next.type) { - // case "Enum": - // completeForEnumSnippets(next, acceptor); - // break; + if (GrammarAST.isKeyword(next.feature)) { + switch (next.type) { + case "Enum": + completeForEnumSnippets(context, next, acceptor); + break; - // case "ComplexDataType": - // completeForDataType(next, acceptor); - // break; + case "ComplexDataType": + completeForDataType(context, next, acceptor); + break; - // case "Attribute": - // completeForAttributeSnippets(next, acceptor); - // break; + case "Attribute": + completeForAttributeSnippets(context, next, acceptor); + break; - // case "ElementRelation": - // completeForElementRelation(next.feature, acceptor); - // if (ast.isKeyword(next.feature) && next.feature.value === "@") { - // if (this.isInternalRelation(next.feature.$container)) { - // completeFullElementRelationSnippets(acceptor); - // } else if (this.isExternalRelation(next.feature.$container)) { - // completeFullExternalElementRelationSnippets(acceptor); - // } - // } - // break; + case "ElementRelation": + completeForElementRelation(context, next, acceptor); + if (GrammarAST.isKeyword(next.feature) && next.feature.value === "@") { + if (this.isInternalRelation(next.feature.$container)) { + completeFullElementRelationSnippets(context, acceptor); + } else if (this.isExternalRelation(next.feature.$container)) { + completeFullExternalElementRelationSnippets(context, acceptor); + } + } + break; - // case "GeneralizationSet": - // if (ast.isKeyword(next.feature) && next.feature.value === "genset") { - // completeForGenSetSnippets(next, acceptor); - // } - // break; - // } - // } + case "GeneralizationSet": + if (GrammarAST.isKeyword(next.feature) && next.feature.value === "genset") { + completeForGenSetSnippets(context, next, acceptor); + } + break; + } + } - // return super.completionFor(context, next, acceptor); - // } + return super.completionFor(context, next, acceptor); + } - // protected override completionForKeyword( - // context: CompletionContext, - // keyword: ast.Keyword, - // acceptor: CompletionAcceptor - // ): MaybePromise { - // // This part gets at what part of the elementRelation the cursor is at - // // and sugests the correct completion - // // this.completeForElementRelation(keyword, acceptor); - // return super.completionForKeyword(context, keyword, acceptor); - // } + private isInternalRelation(container: AstNode): boolean { + if (!container) { + return false; + } - // protected override completionForCrossReference( - // context: CompletionContext, - // crossRef: NextFeature, - // acceptor: CompletionAcceptor - // ): MaybePromise { - // return super.completionForCrossReference(context, crossRef, acceptor); - // } + if (GrammarAST.isParserRule(container) && container.name === "InternalRelation") { + return true; + } + if (container.$container) { + return this.isInternalRelation(container.$container); + } + return false; + } - // private isInternalRelation(container: AstNode): boolean { - // if (!container) { - // return false; - // } - - // if (isParserRule(container) && container.name === "InternalRelation") { - // return true; - // } - // if (container.$container) { - // return this.isInternalRelation(container.$container); - // } - // return false; - // } - - // private isExternalRelation(container: AstNode): boolean { - // if (!container) { - // return false; - // } - // if (isParserRule(container) && container.name === "ExternalRelation") { - // return true; - // } - // if (container.$container) { - // return this.isExternalRelation(container.$container); - // } - // return false; - // } + private isExternalRelation(container: AstNode): boolean { + if (!container) { + return false; + } + if (GrammarAST.isParserRule(container) && container.name === "ExternalRelation") { + return true; + } + if (container.$container) { + return this.isExternalRelation(container.$container); + } + return false; + } } diff --git a/packages/tonto/src/language/lsp/tonto-document-hover-provider.ts b/packages/tonto/src/language/lsp/tonto-document-hover-provider.ts new file mode 100644 index 0000000..7257c7e --- /dev/null +++ b/packages/tonto/src/language/lsp/tonto-document-hover-provider.ts @@ -0,0 +1,8 @@ +import { JSDocDocumentationProvider } from "langium"; +import { TontoServices } from "../tonto-module.js"; + +export class TontoDocumentationProvider extends JSDocDocumentationProvider { + constructor(services: TontoServices) { + super(services); + } +} \ No newline at end of file diff --git a/packages/tonto/src/language/lsp/tonto-highlight-provider.ts b/packages/tonto/src/language/lsp/tonto-highlight-provider.ts new file mode 100644 index 0000000..e69de29 diff --git a/packages/tonto/src/language/lsp/tonto-hover-provider.ts b/packages/tonto/src/language/lsp/tonto-hover-provider.ts new file mode 100644 index 0000000..beea0b0 --- /dev/null +++ b/packages/tonto/src/language/lsp/tonto-hover-provider.ts @@ -0,0 +1,28 @@ +import { AstNode, MaybePromise } from "langium"; +import { AstNodeHoverProvider } from "langium/lsp"; +import { Hover } from "vscode-languageserver"; +import { isClassDeclaration } from "../generated/ast.js"; +import { TontoServices } from "../tonto-module.js"; +import { getTontoNature } from "../utils/getTontoNature.js"; + +export class TontoHoverProvider extends AstNodeHoverProvider { + constructor(services: TontoServices) { + super(services); + } + + protected override getAstNodeHoverContent(node: AstNode): MaybePromise { + if (isClassDeclaration(node)) { + const nature = getTontoNature(node); + return { + contents: { + kind: "markdown", + value: `Ontological Category: ${node.classElementType.ontologicalCategory}\n +Name: ${node.name}\n +Ontological Nature: ${nature.nature} + ` + } + }; + } + return undefined; + } +} \ No newline at end of file diff --git a/packages/tonto/src/language/lsp/tonto-language-server.ts b/packages/tonto/src/language/lsp/tonto-language-server.ts new file mode 100644 index 0000000..c0d282b --- /dev/null +++ b/packages/tonto/src/language/lsp/tonto-language-server.ts @@ -0,0 +1,12 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ +import { DefaultLanguageServer } from "langium/lsp"; +import { InitializeParams, InitializeResult } from "vscode-languageserver"; +import { TontoSemanticTokenOptions } from "./semantic-token-types.js"; + +export class TontoLanguageServer extends DefaultLanguageServer { + protected override buildInitializeResult(_params: InitializeParams): InitializeResult { + const result = super.buildInitializeResult(_params); + result.capabilities.semanticTokensProvider = TontoSemanticTokenOptions; + return result; + } +} \ No newline at end of file diff --git a/packages/tonto/src/language/lsp/tonto-semantic-token-provider.ts b/packages/tonto/src/language/lsp/tonto-semantic-token-provider.ts index 30f0917..b911f26 100644 --- a/packages/tonto/src/language/lsp/tonto-semantic-token-provider.ts +++ b/packages/tonto/src/language/lsp/tonto-semantic-token-provider.ts @@ -1,74 +1,128 @@ - - -import { AstNode } from "langium"; -import { AbstractSemanticTokenProvider, SemanticTokenAcceptor } from "langium/lsp"; +import { AstNode, CstUtils } from "langium"; +import { AbstractSemanticTokenProvider, AllSemanticTokenModifiers, SemanticTokenAcceptor, SemanticTokenRangeOptions } from "langium/lsp"; import { SemanticTokenModifiers, SemanticTokenTypes } from "vscode-languageserver"; -import { - Attribute, - ClassDeclaration, - ContextModule, - DataType, - ElementRelation, - EnumElement, - GeneralizationSet, - OntologicalCategory, - RelationMetaAttribute, - RelationMetaAttributes, - isAttribute, - isClassDeclaration, - isContextModule, - isDataType, - isElementRelation, - isEnumElement, - isGeneralizationSet, - isOntologicalCategory, - isRelationMetaAttribute, - isRelationMetaAttributes, -} from "../generated/ast.js"; +import * as ast from "../generated/ast.js"; +import { TontoNatureResult, getTontoNature } from "../utils/getTontoNature.js"; +import { TontoSemanticTokenTypes } from "./semantic-token-types.js"; /* * This SemanticTokenProvider extension is made so we can create our own SemanticToken * definitions for the members of the Tonto AST */ export class TontoSemanticTokenProvider extends AbstractSemanticTokenProvider { + protected override highlightToken(options: SemanticTokenRangeOptions): void { + const { range, type } = options; + let modifiers = options.modifier; + if ((this.currentRange && !CstUtils.inRange(range, this.currentRange)) || !this.currentDocument || !this.currentTokensBuilder) { + return; + } + const intType = TontoSemanticTokenTypes[type]; + let totalModifier = 0; + if (modifiers !== undefined) { + if (typeof modifiers === "string") { + modifiers = [modifiers]; + } + for (const modifier of modifiers) { + const intModifier = AllSemanticTokenModifiers[modifier]; + totalModifier |= intModifier; + } + } + const startLine = range.start.line; + const endLine = range.end.line; + if (startLine === endLine) { + // Token only spans a single line + const char = range.start.character; + const length = range.end.character - char; + this.currentTokensBuilder.push(startLine, char, length, intType, totalModifier); + } else if (this.clientCapabilities?.multilineTokenSupport) { + // Let token span multiple lines + const startChar = range.start.character; + const startOffset = this.currentDocument.textDocument.offsetAt(range.start); + const endOffset = this.currentDocument.textDocument.offsetAt(range.end); + this.currentTokensBuilder.push(startLine, startChar, endOffset - startOffset, intType, totalModifier); + } else { + // Token spans multiple lines, but the client doesn't support it + // Split the range into multiple semantic tokens + const firstLineStart = range.start; + let nextLineOffset = this.currentDocument.textDocument.offsetAt({ + line: startLine + 1, + character: 0 + }); + // Build first line + this.currentTokensBuilder.push( + firstLineStart.line, + firstLineStart.character, + nextLineOffset - firstLineStart.character - 1, + intType, + totalModifier + ); + // Build all lines in between first and last + for (let i = startLine + 1; i < endLine; i++) { + const currentLineOffset = nextLineOffset; + nextLineOffset = this.currentDocument.textDocument.offsetAt({ + line: i + 1, + character: 0 + }); + this.currentTokensBuilder.push( + i, + 0, + nextLineOffset - currentLineOffset - 1, + intType, totalModifier + ); + } + // Build last line + this.currentTokensBuilder.push( + endLine, + 0, + range.end.character, + intType, + totalModifier + ); + } + } protected highlightElement(node: AstNode, acceptor: SemanticTokenAcceptor): void { - if (isContextModule(node)) { + if (ast.isContextModule(node)) { this.contextModuleTokens(node, acceptor); } - if (isClassDeclaration(node)) { + if (ast.isClassDeclaration(node)) { this.classElementTokens(node, acceptor); } - if (isOntologicalCategory(node)) { - this.ontologicalCategoryTokens(node, acceptor); - } - if (isAttribute(node)) { - this.attributeTokens(node, acceptor); - } - if (isElementRelation(node)) { + if (ast.isElementRelation(node)) { this.elementRelationTokens(node, acceptor); } - if (isDataType(node) && node.isEnum) { + if (ast.isDataType(node)) { + this.datatypeTokens(node, acceptor); + } + if (ast.isDataType(node) && node.isEnum) { this.enumTokens(node, acceptor); } - if (isEnumElement(node)) { + if (ast.isEnumElement(node)) { this.enumElementTokens(node, acceptor); } - if (isRelationMetaAttributes(node)) { + if (ast.isRelationMetaAttributes(node)) { this.relationMetaAttributesTokens(node, acceptor); } - if (isRelationMetaAttribute(node)) { + if (ast.isRelationMetaAttribute(node)) { this.relationMetaAttributeTokens(node, acceptor); } - if (isGeneralizationSet(node)) { + if (ast.isGeneralizationSet(node)) { this.generalizationSetTokens(node, acceptor); } } + datatypeTokens(node: ast.DataType, acceptor: SemanticTokenAcceptor) { + acceptor({ + node, + property: "ontologicalCategory", + type:"tontoNone", + }); + } + /* * ---- HELPERS ---- */ - private contextModuleTokens(node: ContextModule, acceptor: SemanticTokenAcceptor) { + private contextModuleTokens(node: ast.ContextModule, acceptor: SemanticTokenAcceptor) { acceptor({ node, property: "name", @@ -76,54 +130,63 @@ export class TontoSemanticTokenProvider extends AbstractSemanticTokenProvider { }); } - private classElementTokens(node: ClassDeclaration, acceptor: SemanticTokenAcceptor) { + private classElementTokens(node: ast.ClassDeclaration, acceptor: SemanticTokenAcceptor) { acceptor({ node, property: "name", type: SemanticTokenTypes.class, modifier: SemanticTokenModifiers.declaration, + keyword: "ClassTonto" }); - acceptor({ - node, - property: "specializationEndurants", - type: SemanticTokenTypes.variable, - }); + this.ontologicalCategoryTokens(node, node.classElementType, acceptor); } - private ontologicalCategoryTokens(node: OntologicalCategory, acceptor: SemanticTokenAcceptor) { + private ontologicalCategoryTokens(container: ast.ClassDeclaration, node: ast.OntologicalCategory, acceptor: SemanticTokenAcceptor) { + const result = getTontoNature(container); + const type = this.getTypeFromNature(result); acceptor({ node, property: "ontologicalCategory", - type: SemanticTokenTypes.decorator, + type: type }); } - private attributeTokens(node: Attribute, acceptor: SemanticTokenAcceptor) { - acceptor({ - node, - property: "attributeTypeRef", - type: SemanticTokenTypes.type, - }); - acceptor({ - node, - property: "name", - type: SemanticTokenTypes.property, - modifier: SemanticTokenModifiers.declaration, - }); + private getTypeFromNature(nature: TontoNatureResult): string { + switch (nature.nature) { + case "functional-complexes": + if (nature.isKind) return "tontoKind"; + return "tontoFunctionalComplex"; + case "relators": + if (nature.isKind) return "tontoRelatorKind"; + return "tontoRelator"; + case "qualities": + if (nature.isKind) return "tontoQualityKind"; + return "tontoQuality"; + case "quantities": + if (nature.isKind) return "tontoQuantityKind"; + return "tontoQuantity"; + case "collectives": + if (nature.isKind) return "tontoCollectiveKind"; + return "tontoCollective"; + case "modes": + if (nature.isKind) return "tontoModeKind"; + return "tontoMode"; + case "events": + return "tontoEvent"; + case "situations": + return "tontoSituation"; + case "types": + return "tontoType"; + } + return "tontoNone"; } - private elementRelationTokens(node: ElementRelation, acceptor: SemanticTokenAcceptor) { + private elementRelationTokens(node: ast.ElementRelation, acceptor: SemanticTokenAcceptor) { acceptor({ node, property: "relationType", type: SemanticTokenTypes.class, }); - acceptor({ - node, - property: "name", - type: SemanticTokenTypes.variable, - }); - acceptor({ node, property: "firstEndMetaAttributes", @@ -131,7 +194,7 @@ export class TontoSemanticTokenProvider extends AbstractSemanticTokenProvider { }); } - private relationMetaAttributesTokens(node: RelationMetaAttributes, acceptor: SemanticTokenAcceptor) { + private relationMetaAttributesTokens(node: ast.RelationMetaAttributes, acceptor: SemanticTokenAcceptor) { acceptor({ node, property: "endName", @@ -139,7 +202,7 @@ export class TontoSemanticTokenProvider extends AbstractSemanticTokenProvider { }); } - private relationMetaAttributeTokens(node: RelationMetaAttribute, acceptor: SemanticTokenAcceptor) { + private relationMetaAttributeTokens(node: ast.RelationMetaAttribute, acceptor: SemanticTokenAcceptor) { acceptor({ node, property: "subsetRelation", @@ -147,15 +210,15 @@ export class TontoSemanticTokenProvider extends AbstractSemanticTokenProvider { }); } - private enumTokens(node: DataType, acceptor: SemanticTokenAcceptor) { + private enumTokens(node: ast.DataType, acceptor: SemanticTokenAcceptor) { acceptor({ node, - property: "name", - type: SemanticTokenTypes.enum, + property: "isEnum", + type: "tontoNone", }); } - private enumElementTokens(node: EnumElement, acceptor: SemanticTokenAcceptor) { + private enumElementTokens(node: ast.EnumElement, acceptor: SemanticTokenAcceptor) { acceptor({ node, property: "name", @@ -163,11 +226,6 @@ export class TontoSemanticTokenProvider extends AbstractSemanticTokenProvider { }); } - private generalizationSetTokens(node: GeneralizationSet, acceptor: SemanticTokenAcceptor) { - acceptor({ - node, - property: "name", - type: SemanticTokenTypes.variable, - }); + private generalizationSetTokens(node: ast.GeneralizationSet, acceptor: SemanticTokenAcceptor) { } } diff --git a/packages/tonto/src/language/models/OntologicalCategory.ts b/packages/tonto/src/language/models/OntologicalCategory.ts index 97a5fbe..8f82ceb 100644 --- a/packages/tonto/src/language/models/OntologicalCategory.ts +++ b/packages/tonto/src/language/models/OntologicalCategory.ts @@ -25,6 +25,10 @@ enum OntologicalCategoryEnum { ABSTRACT = "abstract", } +export type TontoNatures = "objects" | "functional-complexes" | "collectives" +| "quantities" | "relators" | "modes" | "qualities" |"events" | "situations" +| "types" | "abstract-individuals" | "none" + const UltimateSortalOntoCategories = [ OntologicalCategoryEnum.KIND, OntologicalCategoryEnum.COLLECTIVE, @@ -183,13 +187,8 @@ function getOntologicalCategory(stereotype: string): OntologicalCategoryEnum | u } export { - OntologicalCategoryEnum, - UltimateSortalOntoCategories, - BaseSortalOntoCategories, - SortalOntoCategories, - isSortalOntoCategory, - isUltimateSortalOntoCategory, - isBaseSortalOntoCategory, - isNonSortalOntoCategory, - getOntologicalCategory, + BaseSortalOntoCategories, OntologicalCategoryEnum, SortalOntoCategories, UltimateSortalOntoCategories, getOntologicalCategory, isBaseSortalOntoCategory, + isNonSortalOntoCategory, isSortalOntoCategory, + isUltimateSortalOntoCategory }; + diff --git a/packages/tonto/src/language/references/tonto-name-provider.ts b/packages/tonto/src/language/references/tonto-name-provider.ts index 61cde46..e497fb2 100644 --- a/packages/tonto/src/language/references/tonto-name-provider.ts +++ b/packages/tonto/src/language/references/tonto-name-provider.ts @@ -38,6 +38,8 @@ export class TontoQualifiedNameProvider extends DefaultNameProvider { const parent = node.$container; if (isClassDeclaration(parent)) { return `${parent.name}.${node.name}`; + } else if (isContextModule(parent)) { + return `${node.firstEnd?.$refText}.${node.name}`; } return node.name; } diff --git a/packages/tonto/src/language/references/tonto-scope-computation.ts b/packages/tonto/src/language/references/tonto-scope-computation.ts index d789aab..64b6c6e 100644 --- a/packages/tonto/src/language/references/tonto-scope-computation.ts +++ b/packages/tonto/src/language/references/tonto-scope-computation.ts @@ -44,7 +44,7 @@ export class TontoScopeComputation extends DefaultScopeComputation { const contextModule = this.getContextModuleFromContainer(childNode); let name: string | undefined; - if (isClassDeclaration(childNode.$container)) { + if (isClassDeclaration(childNode.$container) || isElementRelation(childNode.$container)) { name = this.qualifiedNameProvider.getName(childNode); } else { name = childNode.name; diff --git a/packages/tonto/src/language/tonto-module.ts b/packages/tonto/src/language/tonto-module.ts index f6d5684..cc3ebef 100644 --- a/packages/tonto/src/language/tonto-module.ts +++ b/packages/tonto/src/language/tonto-module.ts @@ -2,14 +2,15 @@ import { Module, inject } from "langium"; import { DefaultSharedModuleContext, LangiumServices, LangiumSharedServices, PartialLangiumServices, PartialLangiumSharedServices, createDefaultModule, createDefaultSharedModule } from "langium/lsp"; import { TontoGeneratedModule, TontoGeneratedSharedModule } from "./index.js"; import { TontoActionProvider } from "./lsp/tonto-code-actions.js"; +import { TontoCompletionProvider } from "./lsp/tonto-completion-provider.js"; +import { TontoHoverProvider } from "./lsp/tonto-hover-provider.js"; +import { TontoSemanticTokenProvider } from "./lsp/tonto-semantic-token-provider.js"; import { TontoQualifiedNameProvider } from "./references/tonto-name-provider.js"; import { TontoScopeComputation } from "./references/tonto-scope-computation.js"; import { TontoScopeProvider } from "./references/tonto-scope-provider.js"; import { TontoValidationRegistry } from "./tonto-validator.js"; import { TontoValidator } from "./validators/TontoValidator.js"; - - /** * Declaration of custom services - add your own service classes here. */ @@ -19,7 +20,7 @@ export type TontoAddedServices = { } validation: { TontoValidator: TontoValidator - } + }, } /** @@ -46,12 +47,13 @@ export const TontoModule: Module new TontoActionProvider(), // Formatter: () => new TontoFormatter(), - // SemanticTokenProvider: (services) => new TontoSemanticTokenProvider(services), - // CompletionProvider: (services) => new TontoCompletionProvider(services), + SemanticTokenProvider: (services) => new TontoSemanticTokenProvider(services), + CompletionProvider: (services) => new TontoCompletionProvider(services), + HoverProvider: (services) => new TontoHoverProvider(services), }, }; -export type TontoSharedServices = LangiumSharedServices +export type TontoSharedServices = LangiumSharedServices; /** * Create the full set of services required by Langium. @@ -70,10 +72,10 @@ export type TontoSharedServices = LangiumSharedServices */ export function createTontoServices( context: DefaultSharedModuleContext, - sharedModule?: Module + sharedModule?: Module ) { const shared = inject(createDefaultSharedModule(context), TontoGeneratedSharedModule, sharedModule); - const services = inject(createDefaultModule({ shared }), TontoGeneratedModule, TontoModule); - shared.ServiceRegistry.register(services); - return { shared, Tonto: services }; + const Tonto = inject(createDefaultModule({ shared }), TontoGeneratedModule, TontoModule); + shared.ServiceRegistry.register(Tonto); + return { shared, Tonto: Tonto }; } diff --git a/packages/tonto/src/language/utils/getTontoNature.ts b/packages/tonto/src/language/utils/getTontoNature.ts new file mode 100644 index 0000000..e0b757e --- /dev/null +++ b/packages/tonto/src/language/utils/getTontoNature.ts @@ -0,0 +1,74 @@ +import * as ast from "../generated/ast.js"; +import { TontoNatures } from "../models/OntologicalCategory.js"; + +export type TontoNatureResult = { + nature: TontoNatures; + isKind: boolean; +} + +export function getTontoNature(container: ast.ClassDeclaration): TontoNatureResult { + switch (container.classElementType.ontologicalCategory) { + case "kind": + return { nature: "functional-complexes", isKind: true }; + case "collective": + return { nature: "collectives", isKind: true }; + case "quantity": + return { nature: "quantities", isKind: true }; + case "relator": + return { nature: "relators", isKind: true }; + case "quality": + return { nature: "qualities", isKind: true }; + case "mode": + case "intrinsicMode": + case "extrinsicMode": + return { nature: "modes", isKind: true }; + case "type": + case "powertype": + return { nature: "types", isKind: false };; + + case "event": + case "process": + return { nature: "events", isKind: false }; + case "situation": + return { nature: "situations", isKind: false }; + + // Base Sortals that specialize an ultimate sortal + case "subkind": + case "phase": + case "role": + case "historicalRole": + if (container.specializationEndurants.length > 0) { + let specializationNature: TontoNatures = "abstract-individuals"; + container.specializationEndurants.forEach(item => { + if (item.ref && item.ref.name !== container.name) { + specializationNature = getTontoNature(item.ref).nature; + } + }); + return { nature: specializationNature, isKind: false };; + } + break; + + // Non Sortals + case "category": + case "mixin": + case "phaseMixin": + case "roleMixin": + case "historicalRoleMixin": + if (container.ontologicalNatures && container.ontologicalNatures?.natures.length > 0) { + const firstNature = container.ontologicalNatures.natures[0]; + if (firstNature === "extrinsic-modes" || firstNature === "intrinsic-modes") { + return { nature: "modes", isKind: false }; + } + return { nature: firstNature, isKind: false }; + } else if (container.specializationEndurants.length > 0) { + let specializationNature: TontoNatures = "abstract-individuals"; + container.specializationEndurants.forEach(item => { + if (item.ref && item.ref.name !== container.name) { + specializationNature = getTontoNature(item.ref).nature; + } + }); + return { nature: specializationNature, isKind: false };; + } + } + return {nature: "none", isKind: false}; +} \ No newline at end of file diff --git a/packages/tonto/test/language-server/validators/ClassDeclarationValidators/class.checkClassDeclarationShouldSpecializeUltimateSortal.test.ts b/packages/tonto/test/language-server/validators/ClassDeclarationValidators/class.checkClassDeclarationShouldSpecializeUltimateSortal.test.ts index c9ac951..fc1d50b 100644 --- a/packages/tonto/test/language-server/validators/ClassDeclarationValidators/class.checkClassDeclarationShouldSpecializeUltimateSortal.test.ts +++ b/packages/tonto/test/language-server/validators/ClassDeclarationValidators/class.checkClassDeclarationShouldSpecializeUltimateSortal.test.ts @@ -1,7 +1,7 @@ import { EmptyFileSystem } from "langium"; -import { ErrorMessages } from "../../../../src/language-server/models/ErrorMessages"; -import { validationHelper } from "../../../../src/test/tonto-test"; -import { createTontoServices } from "../../../../src/language-server/tonto-module"; +import { ErrorMessages } from "../../../../src/language/models/ErrorMessages.js"; +import { createTontoServices } from "../../../../src/language/tonto-module.js"; +import { validationHelper } from "../../../../src/test/tonto-test.js"; describe("checkClassDeclarationShouldSpecializeUltimateSortal", async () => { const services = createTontoServices(EmptyFileSystem); diff --git a/packages/tonto/test/language-server/validators/ClassDeclarationValidators/class.checkClassWithoutStereotype.test.ts b/packages/tonto/test/language-server/validators/ClassDeclarationValidators/class.checkClassWithoutStereotype.test.ts index 95dd186..df3e8b0 100644 --- a/packages/tonto/test/language-server/validators/ClassDeclarationValidators/class.checkClassWithoutStereotype.test.ts +++ b/packages/tonto/test/language-server/validators/ClassDeclarationValidators/class.checkClassWithoutStereotype.test.ts @@ -1,5 +1,5 @@ import { EmptyFileSystem } from "langium"; -import { createTontoServices } from "../../../../src/language-server/tonto-module"; +import { createTontoServices } from "../../../../src/language/tonto-module.js"; import { validationHelper } from "../../../../src/test/tonto-test"; describe("checkClassWithoutStereotype", async () => { diff --git a/packages/tonto/test/language-server/validators/ClassDeclarationValidators/class.checkCompatibleNatures.test.ts b/packages/tonto/test/language-server/validators/ClassDeclarationValidators/class.checkCompatibleNatures.test.ts index f505572..b033a95 100644 --- a/packages/tonto/test/language-server/validators/ClassDeclarationValidators/class.checkCompatibleNatures.test.ts +++ b/packages/tonto/test/language-server/validators/ClassDeclarationValidators/class.checkCompatibleNatures.test.ts @@ -1,6 +1,6 @@ /* eslint-disable max-len */ import { EmptyFileSystem } from "langium"; -import { createTontoServices } from "../../../../src/language-server/tonto-module"; +import { createTontoServices } from "../../../../src/language/tonto-module.js"; import { validationHelper } from "../../../../src/test/tonto-test"; describe("checkClassWithoutStereotype", async () => { diff --git a/packages/tonto/test/language-server/validators/ClassDeclarationValidators/class.checkGeneralizationRigidity.test.ts b/packages/tonto/test/language-server/validators/ClassDeclarationValidators/class.checkGeneralizationRigidity.test.ts index 94094a2..17923b3 100644 --- a/packages/tonto/test/language-server/validators/ClassDeclarationValidators/class.checkGeneralizationRigidity.test.ts +++ b/packages/tonto/test/language-server/validators/ClassDeclarationValidators/class.checkGeneralizationRigidity.test.ts @@ -1,6 +1,6 @@ /* eslint-disable max-len */ import { EmptyFileSystem } from "langium"; -import { createTontoServices } from "../../../../src/language-server/tonto-module"; +import { createTontoServices } from "../../../../src/language/tonto-module.js"; import { validationHelper } from "../../../../src/test/tonto-test"; describe("CheckGeneralizationRigidity", async () => { diff --git a/packages/tonto/test/language-server/validators/ClassDeclarationValidators/class.checkGeneralizationSortality.test.ts b/packages/tonto/test/language-server/validators/ClassDeclarationValidators/class.checkGeneralizationSortality.test.ts index de6a3b3..c7682dc 100644 --- a/packages/tonto/test/language-server/validators/ClassDeclarationValidators/class.checkGeneralizationSortality.test.ts +++ b/packages/tonto/test/language-server/validators/ClassDeclarationValidators/class.checkGeneralizationSortality.test.ts @@ -1,5 +1,5 @@ import { EmptyFileSystem } from "langium"; -import { createTontoServices } from "../../../../src/language-server/tonto-module"; +import { createTontoServices } from "../../../../src/language/tonto-module.js"; import { validationHelper } from "../../../../src/test/tonto-test"; describe("checkGeneralizationSortality", async () => { diff --git a/packages/tonto/test/language-server/validators/ClassDeclarationValidators/class.checkRigidSpecializesAntiRigid.test.ts b/packages/tonto/test/language-server/validators/ClassDeclarationValidators/class.checkRigidSpecializesAntiRigid.test.ts index 70c51c7..3deafa1 100644 --- a/packages/tonto/test/language-server/validators/ClassDeclarationValidators/class.checkRigidSpecializesAntiRigid.test.ts +++ b/packages/tonto/test/language-server/validators/ClassDeclarationValidators/class.checkRigidSpecializesAntiRigid.test.ts @@ -1,5 +1,5 @@ import { EmptyFileSystem } from "langium"; -import { createTontoServices } from "../../../../src/language-server/tonto-module"; +import { createTontoServices } from "../../../../src/language/tonto-module.js"; import { validationHelper } from "../../../../src/test/tonto-test"; describe("checkRigidSpecializesAntiRigid", async () => { diff --git a/packages/tonto/test/language-server/validators/ClassDeclarationValidators/class.checkUltimateSortalSpecializeUltimateSortal.test.ts b/packages/tonto/test/language-server/validators/ClassDeclarationValidators/class.checkUltimateSortalSpecializeUltimateSortal.test.ts index e0a1638..c2a840a 100644 --- a/packages/tonto/test/language-server/validators/ClassDeclarationValidators/class.checkUltimateSortalSpecializeUltimateSortal.test.ts +++ b/packages/tonto/test/language-server/validators/ClassDeclarationValidators/class.checkUltimateSortalSpecializeUltimateSortal.test.ts @@ -1,6 +1,6 @@ import { EmptyFileSystem } from "langium"; -import { ErrorMessages } from "../../../../src/language-server/models/ErrorMessages"; -import { createTontoServices } from "../../../../src/language-server/tonto-module"; +import { ErrorMessages } from "../../../../src/language/models/ErrorMessages.js"; +import { createTontoServices } from "../../../../src/language/tonto-module.js"; import { validationHelper } from "../../../../src/test/tonto-test"; describe("checkUltimateSortalSpecializeUltimateSortal", async () => { diff --git a/packages/tonto/test/language-server/validators/ContextModuleValidators/contextModule.checkCircularSpecialization.test.ts b/packages/tonto/test/language-server/validators/ContextModuleValidators/contextModule.checkCircularSpecialization.test.ts index db67337..db2d8e4 100644 --- a/packages/tonto/test/language-server/validators/ContextModuleValidators/contextModule.checkCircularSpecialization.test.ts +++ b/packages/tonto/test/language-server/validators/ContextModuleValidators/contextModule.checkCircularSpecialization.test.ts @@ -1,8 +1,8 @@ -import { ErrorMessages } from "../../../../src/language-server/models/ErrorMessages"; import { EmptyFileSystem } from "langium"; +import { ErrorMessages } from "../../../../src/language/models/ErrorMessages.js"; +import { createTontoServices } from "../../../../src/language/tonto-module.js"; import { validationHelper } from "../../../../src/test/tonto-test"; -import { createTontoServices } from "../../../../src/language-server/tonto-module"; describe("CheckCircularSpecialization", () => { const services = createTontoServices(EmptyFileSystem); diff --git a/packages/tonto/test/language-server/validators/GeneralizationValidators/genset.checkCircularGeneralization.test.ts b/packages/tonto/test/language-server/validators/GeneralizationValidators/genset.checkCircularGeneralization.test.ts index 5b0ea99..b05beb1 100644 --- a/packages/tonto/test/language-server/validators/GeneralizationValidators/genset.checkCircularGeneralization.test.ts +++ b/packages/tonto/test/language-server/validators/GeneralizationValidators/genset.checkCircularGeneralization.test.ts @@ -1,6 +1,6 @@ import { EmptyFileSystem } from "langium"; -import { ErrorMessages } from "../../../../src/language-server/models/ErrorMessages"; -import { createTontoServices } from "../../../../src/language-server/tonto-module"; +import { ErrorMessages } from "../../../../src/language/models/ErrorMessages.js"; +import { createTontoServices } from "../../../../src/language/tonto-module.js"; import { validationHelper } from "../../../../src/test/tonto-test"; describe("checkCircularGeneralization", async () => { diff --git a/packages/tonto/test/language-server/validators/GeneralizationValidators/genset.checkGeneralizationSetConsistency.test.ts b/packages/tonto/test/language-server/validators/GeneralizationValidators/genset.checkGeneralizationSetConsistency.test.ts index 4b72b20..e41f942 100644 --- a/packages/tonto/test/language-server/validators/GeneralizationValidators/genset.checkGeneralizationSetConsistency.test.ts +++ b/packages/tonto/test/language-server/validators/GeneralizationValidators/genset.checkGeneralizationSetConsistency.test.ts @@ -1,7 +1,7 @@ import { EmptyFileSystem } from "langium"; -import { ErrorMessages } from "../../../../src/language-server/models/ErrorMessages"; -import { createTontoServices } from "../../../../src/language-server/tonto-module"; -import { validationHelper } from "../../../../src/test/tonto-test"; +import { ErrorMessages } from "../../../../src/language/models/ErrorMessages.js"; +import { createTontoServices } from "../../../../src/language/tonto-module.js"; +import { validationHelper } from "../../../../src/test/tonto-test.js"; describe("checkGeneralizationSetConsistency", async () => { const services = createTontoServices(EmptyFileSystem); diff --git a/packages/tonto/test/language-server/validators/GeneralizationValidators/genset.checkGeneralizationSortality.test.ts b/packages/tonto/test/language-server/validators/GeneralizationValidators/genset.checkGeneralizationSortality.test.ts index 83c310e..fc36c5d 100644 --- a/packages/tonto/test/language-server/validators/GeneralizationValidators/genset.checkGeneralizationSortality.test.ts +++ b/packages/tonto/test/language-server/validators/GeneralizationValidators/genset.checkGeneralizationSortality.test.ts @@ -1,5 +1,5 @@ import { EmptyFileSystem } from "langium"; -import { createTontoServices } from "../../../../src/language-server/tonto-module"; +import { createTontoServices } from "../../../../src/language/tonto-module.js"; import { validationHelper } from "../../../../src/test/tonto-test"; describe("checkGeneralizationSortality", async () => { diff --git a/packages/tonto/test/main.test.ts b/packages/tonto/test/main.test.ts index 2845142..3f06495 100644 --- a/packages/tonto/test/main.test.ts +++ b/packages/tonto/test/main.test.ts @@ -1,7 +1,7 @@ import { EmptyFileSystem } from "langium"; -import { createTontoServices } from "../src/language-server/tonto-module"; +import { Model } from "../src/language/generated/ast"; +import { createTontoServices } from "../src/language/tonto-module"; import { validationHelper } from "../src/test/tonto-test"; -import { Model } from "../src/language-server/generated/ast"; describe("A", () => { const tontoStub = ` diff --git a/tsconfig.json b/tsconfig.json index de1b3f4..9b9c7bc 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,7 @@ "compilerOptions": { "target": "ES2022", "module": "Node16", - "lib": ["ESNext"] /* Specify library files to be included in the compilation. */, + "lib": ["ESNext", "DOM", "WebWorker"] /* Specify library files to be included in the compilation. */, "allowJs": true /* Allow javascript files to be compiled. */, "declaration": true /* Generates corresponding '.d.ts' file. */, "declarationMap": true /* Generates a sourcemap for each corresponding '.d.ts' file. */,