├── packages ├── syside-languageserver │ ├── node.d.ts │ ├── scripts │ │ └── expected-diagnostics.json │ ├── browser.d.ts │ ├── .gitignore │ ├── node.js │ ├── browser.js │ ├── README.md │ ├── src │ │ ├── services │ │ │ ├── shared │ │ │ │ ├── __tests__ │ │ │ │ │ └── samples │ │ │ │ │ │ ├── sample2.js │ │ │ │ │ │ └── sample.js │ │ │ │ ├── index.ts │ │ │ │ ├── workspace │ │ │ │ │ └── index.ts │ │ │ │ └── service-registry.ts │ │ │ ├── parser │ │ │ │ └── index.ts │ │ │ ├── references │ │ │ │ ├── index.ts │ │ │ │ └── name-provider.ts │ │ │ ├── lsp │ │ │ │ └── index.ts │ │ │ ├── validation │ │ │ │ ├── index.ts │ │ │ │ ├── kerml-validation-registry.ts │ │ │ │ └── sysml-validation-registry.ts │ │ │ └── index.ts │ │ ├── model │ │ │ ├── printer │ │ │ │ ├── .eslintrc │ │ │ │ └── index.ts │ │ │ ├── notes │ │ │ │ └── index.ts │ │ │ ├── SysML │ │ │ │ ├── references │ │ │ │ │ ├── index.ts │ │ │ │ │ └── conjugated-port-reference.ts │ │ │ │ ├── expressions │ │ │ │ │ └── index.ts │ │ │ │ ├── control-node.ts │ │ │ │ ├── for-node.ts │ │ │ │ ├── join-node.ts │ │ │ │ ├── merge-node.ts │ │ │ │ ├── loop-action-usage.ts │ │ │ │ ├── decision-node.ts │ │ │ │ ├── part-definition.ts │ │ │ │ ├── view-definition.ts │ │ │ │ ├── case-definition.ts │ │ │ │ ├── use-case-definition.ts │ │ │ │ ├── life-class.ts │ │ │ │ ├── rendering-definition.ts │ │ │ │ ├── interface-usage.ts │ │ │ │ ├── allocation-usage.ts │ │ │ │ ├── relationships │ │ │ │ │ └── index.ts │ │ │ │ ├── concern-definition.ts │ │ │ │ ├── analysis-case-definition.ts │ │ │ │ ├── requirement-definition.ts │ │ │ │ ├── viewpoint-definition.ts │ │ │ │ ├── interface-definition.ts │ │ │ │ ├── verification-case-definition.ts │ │ │ │ ├── allocation-definition.ts │ │ │ │ ├── enumeration-usage.ts │ │ │ │ ├── attribute-definition.ts │ │ │ │ ├── attribute-usage.ts │ │ │ │ ├── item-definition.ts │ │ │ │ ├── action-definition.ts │ │ │ │ ├── metadata-definition.ts │ │ │ │ ├── view-usage.ts │ │ │ │ └── enumeration-definition.ts │ │ │ ├── expressions │ │ │ │ ├── index.ts │ │ │ │ ├── functions │ │ │ │ │ └── index.ts │ │ │ │ └── __tests__ │ │ │ │ │ ├── numerical.test.ts │ │ │ │ │ └── boolean.test.ts │ │ │ ├── mixins │ │ │ │ └── index.ts │ │ │ ├── KerML │ │ │ │ ├── references │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── type-reference.ts │ │ │ │ │ ├── feature-reference.ts │ │ │ │ │ ├── metaclass-reference.ts │ │ │ │ │ ├── namespace-reference.ts │ │ │ │ │ ├── classifier-reference.ts │ │ │ │ │ └── membership-reference.ts │ │ │ │ ├── relationships │ │ │ │ │ ├── redefinition.ts │ │ │ │ │ ├── cross-subsetting.ts │ │ │ │ │ └── reference-subsetting.ts │ │ │ │ ├── documentation.ts │ │ │ │ ├── expressions │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── select-expression.ts │ │ │ │ │ ├── index-expression.ts │ │ │ │ │ └── literal-infinity.ts │ │ │ │ ├── behavior.ts │ │ │ │ ├── metaclass.ts │ │ │ │ ├── predicate.ts │ │ │ │ ├── succession.ts │ │ │ │ ├── interaction.ts │ │ │ │ ├── package.ts │ │ │ │ ├── library-package.ts │ │ │ │ ├── binding-connector.ts │ │ │ │ ├── class.ts │ │ │ │ ├── structure.ts │ │ │ │ ├── boolean-expression.ts │ │ │ │ └── data-type.ts │ │ │ ├── index.ts │ │ │ └── __tests__ │ │ │ │ └── naming.test.ts │ │ ├── launch │ │ │ ├── index.ts │ │ │ └── server.ts │ │ ├── utils │ │ │ ├── comments │ │ │ │ └── index.ts │ │ │ ├── printer │ │ │ │ └── index.ts │ │ │ ├── index.ts │ │ │ └── containers.ts │ │ ├── browser │ │ │ ├── main.ts │ │ │ ├── index.ts │ │ │ └── server.ts │ │ ├── testing │ │ │ └── index.ts │ │ ├── node │ │ │ ├── index.ts │ │ │ ├── main.ts │ │ │ ├── arg-parser.ts │ │ │ └── server.ts │ │ ├── index.ts │ │ ├── __tests__ │ │ │ └── kerml │ │ │ │ ├── core │ │ │ │ └── classifiers.test.ts │ │ │ │ └── root │ │ │ │ └── relationships.test.ts │ │ └── generated │ │ │ └── module.ts │ ├── bin │ │ └── syside-languageserver │ ├── tsconfig.json │ ├── jest.config.js │ ├── tsconfig.test.json │ ├── langium-config.json │ └── syntaxes │ │ ├── sysml.md.tmLanguage.json │ │ └── kerml.md.tmLanguage.json ├── syside-cli │ ├── README.md │ ├── jest.config.js │ ├── bin │ │ └── cli │ ├── tsconfig.test.json │ ├── tsconfig.json │ ├── package.json │ └── src │ │ └── index.ts ├── syside-vscode │ ├── .gitignore │ ├── README.md │ ├── tsconfig.json │ ├── src │ │ ├── node │ │ │ └── language-server │ │ │ │ └── main.ts │ │ ├── browser │ │ │ ├── language-server │ │ │ │ └── main.ts │ │ │ └── vscode.ts │ │ └── configuration-schema.ts │ ├── .vscodeignore │ ├── language-configuration.json │ └── scripts │ │ └── publish.mjs ├── syside-base │ ├── README.md │ ├── jest.config.js │ ├── tsconfig.json │ ├── tsconfig.test.json │ ├── src │ │ ├── index.ts │ │ └── uri.ts │ └── package.json ├── syside-languageclient │ ├── README.md │ ├── jest.config.js │ ├── tsconfig.test.json │ ├── tsconfig.json │ ├── src │ │ ├── index.ts │ │ └── __tests__ │ │ │ ├── download.test.ts │ │ │ └── api.test.ts │ └── package.json └── syside-protocol │ ├── README.md │ ├── jest.config.js │ ├── tsconfig.json │ ├── tsconfig.test.json │ ├── src │ └── index.ts │ └── package.json ├── docs ├── images │ ├── hover.gif │ ├── logo.png │ ├── folding.gif │ ├── renaming.gif │ ├── symbols.gif │ ├── completion.gif │ ├── formatting.gif │ ├── logo-full.png │ ├── logo-large.png │ ├── navigation.gif │ ├── references.gif │ ├── indentation.gif │ ├── library-prompt.png │ ├── validation_dark.gif │ ├── comment-formatting.gif │ ├── library-settings.png │ └── semantic-highlighting.png ├── known_limitations.md └── releasing.md ├── .gitattributes ├── .editorconfig ├── .git-blame-ignore-revs ├── tsconfig.eslint.json ├── pnpm-workspace.yaml ├── .prettierrc ├── jest.config.js ├── .vscode ├── extensions.json ├── tasks.json └── settings.json ├── .gitlab ├── issue_templates │ ├── feature_request.md │ └── bug_report.md └── merge_request_templates │ └── merge_request.md ├── .github ├── ISSUE_TEMPLATE │ ├── feature_request.md │ └── bug_report.md └── PULL_REQUEST_TEMPLATE │ └── pull_request_template.md ├── tsconfig.build.json ├── jest.config.base.js └── DCO /packages/syside-languageserver/node.d.ts: -------------------------------------------------------------------------------- 1 | export * from "./lib/node"; 2 | -------------------------------------------------------------------------------- /packages/syside-languageserver/scripts/expected-diagnostics.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /packages/syside-languageserver/browser.d.ts: -------------------------------------------------------------------------------- 1 | export * from "./lib/browser"; 2 | -------------------------------------------------------------------------------- /docs/images/hover.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensmetry/sysml-2ls/HEAD/docs/images/hover.gif -------------------------------------------------------------------------------- /docs/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensmetry/sysml-2ls/HEAD/docs/images/logo.png -------------------------------------------------------------------------------- /docs/images/folding.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensmetry/sysml-2ls/HEAD/docs/images/folding.gif -------------------------------------------------------------------------------- /docs/images/renaming.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensmetry/sysml-2ls/HEAD/docs/images/renaming.gif -------------------------------------------------------------------------------- /docs/images/symbols.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensmetry/sysml-2ls/HEAD/docs/images/symbols.gif -------------------------------------------------------------------------------- /docs/images/completion.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensmetry/sysml-2ls/HEAD/docs/images/completion.gif -------------------------------------------------------------------------------- /docs/images/formatting.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensmetry/sysml-2ls/HEAD/docs/images/formatting.gif -------------------------------------------------------------------------------- /docs/images/logo-full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensmetry/sysml-2ls/HEAD/docs/images/logo-full.png -------------------------------------------------------------------------------- /docs/images/logo-large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensmetry/sysml-2ls/HEAD/docs/images/logo-large.png -------------------------------------------------------------------------------- /docs/images/navigation.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensmetry/sysml-2ls/HEAD/docs/images/navigation.gif -------------------------------------------------------------------------------- /docs/images/references.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensmetry/sysml-2ls/HEAD/docs/images/references.gif -------------------------------------------------------------------------------- /docs/images/indentation.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensmetry/sysml-2ls/HEAD/docs/images/indentation.gif -------------------------------------------------------------------------------- /docs/images/library-prompt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensmetry/sysml-2ls/HEAD/docs/images/library-prompt.png -------------------------------------------------------------------------------- /docs/images/validation_dark.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensmetry/sysml-2ls/HEAD/docs/images/validation_dark.gif -------------------------------------------------------------------------------- /packages/syside-cli/README.md: -------------------------------------------------------------------------------- 1 | # _SysIDE_ CLI 2 | 3 | This package contains command line interface for _SysIDE_. 4 | -------------------------------------------------------------------------------- /docs/images/comment-formatting.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensmetry/sysml-2ls/HEAD/docs/images/comment-formatting.gif -------------------------------------------------------------------------------- /docs/images/library-settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensmetry/sysml-2ls/HEAD/docs/images/library-settings.png -------------------------------------------------------------------------------- /packages/syside-languageserver/.gitignore: -------------------------------------------------------------------------------- 1 | # local grammar reference files from the pilot implementation 2 | src/grammar/reference -------------------------------------------------------------------------------- /packages/syside-languageserver/node.js: -------------------------------------------------------------------------------- 1 | // eslint-disable-next-line no-undef 2 | module.exports = require("./lib/node"); 3 | -------------------------------------------------------------------------------- /docs/images/semantic-highlighting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sensmetry/sysml-2ls/HEAD/docs/images/semantic-highlighting.png -------------------------------------------------------------------------------- /packages/syside-languageserver/browser.js: -------------------------------------------------------------------------------- 1 | // eslint-disable-next-line no-undef 2 | module.exports = require("./lib/browser"); 3 | -------------------------------------------------------------------------------- /packages/syside-vscode/.gitignore: -------------------------------------------------------------------------------- 1 | # copied files 2 | syntaxes 3 | LICENSE 4 | .README 5 | CHANGELOG.md 6 | icons 7 | sysml.library -------------------------------------------------------------------------------- /packages/syside-languageserver/README.md: -------------------------------------------------------------------------------- 1 | # _SysIDE_ Language Server 2 | 3 | This package contains the _SysIDE_ SysML v2 language server. 4 | -------------------------------------------------------------------------------- /packages/syside-base/README.md: -------------------------------------------------------------------------------- 1 | # _SysIDE_ Base 2 | 3 | This package contains common LSP utilities shared by the _SysIDE_ language server and client. 4 | -------------------------------------------------------------------------------- /packages/syside-languageclient/README.md: -------------------------------------------------------------------------------- 1 | # _SysIDE_ Language Client Extensions 2 | 3 | This package contains extensions for _SysIDE_ language clients. 4 | -------------------------------------------------------------------------------- /packages/syside-vscode/README.md: -------------------------------------------------------------------------------- 1 | # _SysIDE Editor Legacy_ VS Code Extension 2 | 3 | This package contains the _SysIDE Editor Legacy_ VS Code extension. 4 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # https://stackoverflow.com/a/44048077/20107711 2 | # try ignoring diffs on generated files 3 | packages/syside-languageserver/src/generated/** -diff -------------------------------------------------------------------------------- /packages/syside-protocol/README.md: -------------------------------------------------------------------------------- 1 | # _SysIDE_ LSP Extensions 2 | 3 | This package contains additional LSP messages shared by the _SysIDE_ language server and client. 4 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 4 6 | end_of_line = lf 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | -------------------------------------------------------------------------------- /.git-blame-ignore-revs: -------------------------------------------------------------------------------- 1 | # formatting 2 | 43a9211c5d70b2c2bbd34c3433f515d7a440c632 3 | 4 | # eslint 5 | 7c57be7aa2f0663c5a98bb45ae6cb60067d1aae5 6 | 7 | # naming 8 | 7aef01d8b602fc13d5f58360ec860a24ae7bd7b3 -------------------------------------------------------------------------------- /packages/syside-languageserver/src/services/shared/__tests__/samples/sample2.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/explicit-function-return-type */ 2 | 3 | export function activate(_context) { 4 | /* empty */ 5 | } 6 | -------------------------------------------------------------------------------- /tsconfig.eslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "noEmit": true, 4 | "allowJs": true 5 | }, 6 | "extends": "./tsconfig.json", 7 | "include": [ 8 | "packages/**/*.ts", 9 | ] 10 | } -------------------------------------------------------------------------------- /pnpm-workspace.yaml: -------------------------------------------------------------------------------- 1 | packages: 2 | - "packages/syside-base" 3 | - "packages/syside-languageserver" 4 | - "packages/syside-cli" 5 | - "packages/syside-languageclient" 6 | - "packages/syside-protocol" 7 | - "packages/syside-vscode" -------------------------------------------------------------------------------- /packages/syside-base/jest.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-undef */ 2 | // eslint-disable-next-line @typescript-eslint/no-var-requires 3 | 4 | /** @type {import('jest').Config} */ 5 | module.exports = { 6 | ...require("../../jest.config.base"), 7 | roots: ["/src"], 8 | }; 9 | -------------------------------------------------------------------------------- /packages/syside-cli/jest.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-undef */ 2 | // eslint-disable-next-line @typescript-eslint/no-var-requires 3 | 4 | /** @type {import('jest').Config} */ 5 | module.exports = { 6 | ...require("../../jest.config.base"), 7 | roots: ["/src"], 8 | }; 9 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/printer/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/eslintrc.json", 3 | "rules": { 4 | "unused-imports/no-unused-vars": [ 5 | "off" 6 | ] 7 | } 8 | } -------------------------------------------------------------------------------- /packages/syside-protocol/jest.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-undef */ 2 | // eslint-disable-next-line @typescript-eslint/no-var-requires 3 | 4 | /** @type {import('jest').Config} */ 5 | module.exports = { 6 | ...require("../../jest.config.base"), 7 | roots: ["/src"], 8 | }; 9 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "tabWidth": 4, 3 | "useTabs": false, 4 | "trailingComma": "es5", 5 | "printWidth": 100, 6 | "overrides": [ 7 | { 8 | "files": [ 9 | "*yml" 10 | ], 11 | "options": { 12 | "tabWidth": 2 13 | } 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /packages/syside-languageclient/jest.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-undef */ 2 | // eslint-disable-next-line @typescript-eslint/no-var-requires 3 | 4 | /** @type {import('jest').Config} */ 5 | module.exports = { 6 | ...require("../../jest.config.base"), 7 | roots: ["/src"], 8 | }; 9 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/services/shared/__tests__/samples/sample.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/explicit-function-return-type */ 2 | 3 | let mock = undefined; 4 | 5 | export function setMock(fn) { 6 | mock = fn; 7 | } 8 | 9 | export function activate(context) { 10 | mock.call(undefined, context); 11 | } 12 | -------------------------------------------------------------------------------- /packages/syside-base/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "rootDir": "src", 5 | "outDir": "lib" 6 | }, 7 | "include": [ 8 | "src/**/*.ts" 9 | ], 10 | "exclude": [ 11 | "lib", 12 | "node_modules", 13 | "**/__test__", 14 | "**/__tests__" 15 | ] 16 | } -------------------------------------------------------------------------------- /packages/syside-protocol/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "rootDir": "src", 5 | "outDir": "lib" 6 | }, 7 | "include": [ 8 | "src/**/*.ts" 9 | ], 10 | "exclude": [ 11 | "lib", 12 | "node_modules", 13 | "**/__test__", 14 | "**/__tests__" 15 | ] 16 | } -------------------------------------------------------------------------------- /packages/syside-base/tsconfig.test.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "noEmit": true, 5 | "rootDir": "src", 6 | "types": [ 7 | "jest" 8 | ] 9 | }, 10 | "references": [ 11 | { 12 | "path": "tsconfig.json" 13 | } 14 | ], 15 | "include": [ 16 | "src/*.ts", 17 | ] 18 | } -------------------------------------------------------------------------------- /packages/syside-cli/bin/cli: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | /* eslint-disable no-undef */ 3 | /* eslint-disable @typescript-eslint/no-var-requires */ 4 | 5 | try { 6 | // prefer esbuild packaged module for better performance 7 | require("../out").default(); 8 | } catch (e) { 9 | if (!(e instanceof Error) || !e.message.startsWith("Cannot find module")) throw e; 10 | require("../lib").default(); 11 | } 12 | -------------------------------------------------------------------------------- /packages/syside-protocol/tsconfig.test.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "noEmit": true, 5 | "rootDir": "src", 6 | "types": [ 7 | "jest" 8 | ] 9 | }, 10 | "references": [ 11 | { 12 | "path": "tsconfig.json" 13 | } 14 | ], 15 | "include": [ 16 | "src/*.ts", 17 | ] 18 | } -------------------------------------------------------------------------------- /packages/syside-cli/tsconfig.test.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "noEmit": true, 5 | "rootDir": "src", 6 | "types": [ 7 | "jest", 8 | "node" 9 | ] 10 | }, 11 | "references": [ 12 | { 13 | "path": "tsconfig.json" 14 | } 15 | ], 16 | "include": [ 17 | "src/*.ts", 18 | ] 19 | } -------------------------------------------------------------------------------- /packages/syside-languageserver/bin/syside-languageserver: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | /* eslint-disable no-undef */ 3 | /* eslint-disable @typescript-eslint/no-var-requires */ 4 | 5 | try { 6 | // prefer esbuild packaged module for better performance 7 | require("../out/main"); 8 | } catch (e) { 9 | if (!(e instanceof Error) || !e.message.startsWith("Cannot find module")) throw e; 10 | require("../lib/main"); 11 | } 12 | -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-undef */ 2 | /** @type {import('jest').Config} */ 3 | module.exports = { 4 | ...require("./jest.config.base"), 5 | projects: [ 6 | "/packages/syside-base", 7 | "/packages/syside-protocol", 8 | "/packages/syside-languageclient", 9 | "/packages/syside-languageserver", 10 | "/packages/syside-cli", 11 | ], 12 | }; 13 | -------------------------------------------------------------------------------- /packages/syside-languageclient/tsconfig.test.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "noEmit": true, 5 | "rootDir": "src", 6 | "types": [ 7 | "node", 8 | "jest" 9 | ] 10 | }, 11 | "references": [ 12 | { 13 | "path": "tsconfig.json" 14 | } 15 | ], 16 | "include": [ 17 | "src/**/*.ts", 18 | ] 19 | } -------------------------------------------------------------------------------- /packages/syside-cli/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "rootDir": "src", 5 | "outDir": "lib" 6 | }, 7 | "include": [ 8 | "src/**/*.ts" 9 | ], 10 | "exclude": [ 11 | "lib", 12 | "node_modules", 13 | "**/__test__", 14 | "**/__tests__" 15 | ], 16 | "references": [ 17 | { 18 | "path": "../syside-languageserver" 19 | } 20 | ] 21 | } -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations. 3 | // Extension identifier format: ${publisher}.${name}. Example: vscode.csharp 4 | 5 | // List of extensions which should be recommended for users of this workspace. 6 | "recommendations": [ 7 | "langium.langium-vscode", 8 | "esbenp.prettier-vscode", 9 | "Orta.vscode-jest", 10 | "dbaeumer.vscode-eslint", 11 | "DavidAnson.vscode-markdownlint" 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /packages/syside-languageclient/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "rootDir": "src", 5 | "outDir": "lib" 6 | }, 7 | "include": [ 8 | "src/**/*.ts" 9 | ], 10 | "exclude": [ 11 | "lib", 12 | "node_modules", 13 | "**/__test__", 14 | "**/__tests__" 15 | ], 16 | "references": [ 17 | { 18 | "path": "../syside-base" 19 | }, 20 | { 21 | "path": "../syside-protocol" 22 | } 23 | ] 24 | } -------------------------------------------------------------------------------- /packages/syside-languageserver/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "rootDir": "src", 5 | "outDir": "lib", 6 | }, 7 | "include": [ 8 | "src/**/*.ts" 9 | ], 10 | "exclude": [ 11 | "lib", 12 | "node_modules", 13 | "**/__test__", 14 | "**/__tests__" 15 | ], 16 | "references": [ 17 | { 18 | "path": "../syside-base" 19 | }, 20 | { 21 | "path": "../syside-protocol" 22 | } 23 | ] 24 | } -------------------------------------------------------------------------------- /packages/syside-vscode/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "rootDir": ".", 5 | "outDir": "lib" 6 | }, 7 | "files": [ 8 | "package.json" 9 | ], 10 | "include": [ 11 | "src/**/*.ts" 12 | ], 13 | "exclude": [ 14 | "lib", 15 | "node_modules", 16 | "__test__", 17 | "__tests__" 18 | ], 19 | "references": [ 20 | { 21 | "path": "../syside-protocol" 22 | }, 23 | { 24 | "path": "../syside-languageclient" 25 | } 26 | ] 27 | } -------------------------------------------------------------------------------- /packages/syside-languageserver/jest.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-undef */ 2 | // eslint-disable-next-line @typescript-eslint/no-var-requires 3 | 4 | /** @type {import('jest').Config} */ 5 | module.exports = { 6 | ...require("../../jest.config.base"), 7 | roots: ["/src"], 8 | setupFilesAfterEnv: ["/src/testing/setup-jest.ts"], 9 | coveragePathIgnorePatterns: [ 10 | "node_modules", 11 | "__tests__", 12 | "/src/testing", 13 | // auto-generated 14 | "/src/generated", 15 | // server CLI entry point 16 | "/src/node/main.ts", 17 | ], 18 | }; -------------------------------------------------------------------------------- /packages/syside-languageserver/tsconfig.test.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "noEmit": true, 5 | "rootDir": "..", 6 | "types": [ 7 | "jest" 8 | ] 9 | }, 10 | "references": [ 11 | { 12 | "path": "tsconfig.json" 13 | }, 14 | { 15 | "path": "../syside-languageclient" 16 | } 17 | ], 18 | "files": [ 19 | "../syside-vscode/package.json", 20 | "scripts/expected-diagnostics.json", 21 | ], 22 | "include": [ 23 | "src/**/*.ts", 24 | // "scripts/**/*.ts", 25 | ] 26 | } -------------------------------------------------------------------------------- /.gitlab/issue_templates/feature_request.md: -------------------------------------------------------------------------------- 1 | ## Checklist before submitting a feature request 2 | 3 | - [ ] I have reviewed `CONTRIBUTING.md` document 4 | - [ ] I have done a quick search on the issue tracker to check if the feature request is not redundant 5 | 6 | ## Is your feature request related to a problem? If yes, describe the problem 7 | 8 | [If your feature is related to some problem, please describe it. E.g. _I am annoyed that whenever I do X, I need to..._ ] 9 | 10 | ## Describe the desired feature 11 | 12 | [Clearly and concisely describe the functionality that you would like to see] 13 | 14 | ## Additional context 15 | 16 | [Any additional context] 17 | 18 | /label ~"feature request" 19 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | ## Checklist before submitting a feature request 11 | 12 | - [ ] I have reviewed `CONTRIBUTING.md` document 13 | - [ ] I have done a quick search on the issue tracker to check if the feature request is not redundant 14 | 15 | ## Is your feature request related to a problem? If yes, describe the problem 16 | 17 | [If your feature is related to some problem, please describe it. E.g. _I am annoyed that whenever I do X, I need to..._ ] 18 | 19 | ## Describe the desired feature 20 | 21 | [Clearly and concisely describe the functionality that you would like to see] 22 | 23 | ## Additional context 24 | 25 | [Any additional context] 26 | 27 | /label ~"feature request" 28 | -------------------------------------------------------------------------------- /.gitlab/merge_request_templates/merge_request.md: -------------------------------------------------------------------------------- 1 | ## Checklist before submitting a merge request 2 | 3 | - [ ] I have reviewed `CONTRIBUTING.md` document 4 | - [ ] All commits have been signed-off for the Developer Certificate of Origin. See [here](/CONTRIBUTING.md#developer-certificate-of-origin). 5 | - [ ] I have added my contribution to `CHANGELOG.md` 6 | 7 | ## Description of contribution 8 | 9 | [Describe your contribution, link to any existing relevant issues] 10 | 11 | ## Testing performed 12 | 13 | 14 | 15 | - [ ] I have added unit tests to cover additional functionality 16 | 17 | 18 | ## Expected functionality changes 19 | 20 | [Describe expected behaviour changes] 21 | 22 | ## Additional context 23 | 24 | [If needed, you may add additional context] 25 | -------------------------------------------------------------------------------- /packages/syside-languageserver/langium-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "projectName": "SysML", 3 | "languages": [ 4 | { 5 | "id": "kerml", 6 | "grammar": "src/grammar/KerML.langium", 7 | "fileExtensions": [ 8 | ".kerml" 9 | ], 10 | "textMate": { 11 | "out": "syntaxes/kerml.tmLanguage.json" 12 | } 13 | }, 14 | { 15 | "id": "sysml", 16 | "grammar": "src/grammar/SysML.langium", 17 | "fileExtensions": [ 18 | ".sysml" 19 | ], 20 | "textMate": { 21 | "out": "syntaxes/sysml.tmLanguage.json" 22 | } 23 | } 24 | ], 25 | "out": "src/generated", 26 | "chevrotainParserConfig": { 27 | "recoveryEnabled": true, 28 | "nodeLocationTracking": "none" 29 | } 30 | } -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | // See https://go.microsoft.com/fwlink/?LinkId=733558 3 | // for the documentation about the tasks.json format 4 | "version": "2.0.0", 5 | "tasks": [ 6 | { 7 | "label": "Kill used ports", 8 | "type": "shell", 9 | "command": "kill -9 $(lsof -i tcp:8008 | grep -i code | awk '{print $2}')", 10 | "windows": { 11 | // TODO: 12 | "command": "" 13 | }, 14 | "presentation": { 15 | "echo": false, 16 | "reveal": "never", 17 | "focus": false, 18 | "panel": "shared", 19 | "showReuseMessage": false, 20 | "clear": false, 21 | "revealProblems": "never", 22 | "close": false 23 | }, 24 | "hide": true, 25 | } 26 | ] 27 | } -------------------------------------------------------------------------------- /packages/syside-languageserver/src/launch/index.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | export * from "./server"; 18 | -------------------------------------------------------------------------------- /packages/syside-protocol/src/index.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | export * from "./protocol-extensions"; 18 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/notes/index.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | export * from "./attach"; 18 | -------------------------------------------------------------------------------- /packages/syside-base/src/index.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | export * from "./stdlib"; 18 | export * from "./uri"; 19 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/utils/comments/index.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | export * from "./comments"; 18 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE/pull_request_template.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Pull request 3 | about: Improve this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | ## Checklist before submitting a merge request 11 | 12 | - [ ] I have reviewed `CONTRIBUTING.md` document 13 | - [ ] All commits have been signed-off for the Developer Certificate of Origin. See [here](/CONTRIBUTING.md#developer-certificate-of-origin). 14 | - [ ] I have added my contribution to `CHANGELOG.md` 15 | 16 | ## Description of contribution 17 | 18 | [Describe your contribution, link to any existing relevant issues] 19 | 20 | ## Testing performed 21 | 22 | 23 | 24 | - [ ] I have added unit tests to cover additional functionality 25 | 26 | 27 | ## Expected functionality changes 28 | 29 | [Describe expected behaviour changes] 30 | 31 | ## Additional context 32 | 33 | [If needed, you may add additional context] 34 | -------------------------------------------------------------------------------- /packages/syside-vscode/src/node/language-server/main.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import "syside-languageserver/lib/node/main"; 18 | -------------------------------------------------------------------------------- /packages/syside-vscode/src/browser/language-server/main.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import "syside-languageserver/lib/browser/main"; 18 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/SysML/references/index.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | export * from "./conjugated-port-reference"; 18 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/utils/printer/index.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | export * from "./doc"; 18 | export * from "./print"; 19 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/browser/main.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { startServer } from "./server"; 18 | 19 | startServer({}); 20 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/SysML/expressions/index.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | export * from "./trigger-invocation-expression"; 18 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/services/parser/index.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | export * from "./grammar-config"; 18 | export * from "./parser"; 19 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/browser/index.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | export * from "./server"; 18 | export * from "./virtual-file-system-provider"; 19 | -------------------------------------------------------------------------------- /tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "files": [], 4 | "references": [ 5 | { 6 | "path": "packages/syside-protocol" 7 | }, 8 | { 9 | "path": "packages/syside-protocol/tsconfig.test.json" 10 | }, 11 | { 12 | "path": "packages/syside-base" 13 | }, 14 | { 15 | "path": "packages/syside-base/tsconfig.test.json" 16 | }, 17 | { 18 | "path": "packages/syside-languageclient" 19 | }, 20 | { 21 | "path": "packages/syside-languageclient/tsconfig.test.json" 22 | }, 23 | { 24 | "path": "packages/syside-languageserver" 25 | }, 26 | { 27 | "path": "packages/syside-languageserver/tsconfig.test.json" 28 | }, 29 | { 30 | "path": "packages/syside-cli" 31 | }, 32 | { 33 | "path": "packages/syside-cli/tsconfig.test.json" 34 | } 35 | ] 36 | } -------------------------------------------------------------------------------- /packages/syside-languageclient/src/index.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | export * from "./api"; 18 | export * from "./download"; 19 | export * from "./sysml-language-client"; 20 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/testing/index.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | export * from "./server-initialize-params"; 18 | export * from "./setup-jest"; 19 | export * from "./utils"; 20 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/expressions/index.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | export * from "./evaluator"; 18 | export * from "./functions"; 19 | export * from "./range"; 20 | export * from "./util"; 21 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/node/index.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | export * from "./arg-parser"; 18 | export * from "./cli"; 19 | export * from "./node-file-system-provider"; 20 | export * from "./server"; 21 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/mixins/index.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | export * from "./connector"; 18 | export * from "./function"; 19 | export * from "./input-parameters"; 20 | export * from "./positional-features"; 21 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/services/references/index.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | export * from "./linker"; 18 | export * from "./name-provider"; 19 | export * from "./scope-computation"; 20 | export * from "./scope-provider"; 21 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/services/shared/index.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | export * from "./evaluator"; 18 | export * from "./extension-manager"; 19 | export * from "./model-utils"; 20 | export * from "./service-registry"; 21 | export * from "./workspace"; 22 | -------------------------------------------------------------------------------- /jest.config.base.js: -------------------------------------------------------------------------------- 1 | /** @type {import('@swc/core').Config} */ 2 | const swcConfig = { 3 | jsc: { 4 | parser: { 5 | syntax: "typescript", 6 | decorators: true, 7 | }, 8 | target: "es2022", 9 | loose: false, 10 | externalHelpers: false, 11 | // Requires v1.2.50 or upper and requires target to be es2016 or upper. 12 | keepClassNames: false, 13 | }, 14 | minify: false, 15 | }; 16 | 17 | /** @type {import('jest').Config} */ 18 | // eslint-disable-next-line no-undef 19 | module.exports = { 20 | transform: { 21 | "^.+\\.(t|j)sx?$": ["@swc/jest", swcConfig], 22 | }, 23 | transformIgnorePatterns: ["/node_modules/"], 24 | testEnvironment: "node", 25 | testTimeout: 10000, 26 | collectCoverage: true, 27 | collectCoverageFrom: ["src/**/*.ts"], 28 | coveragePathIgnorePatterns: ["node_modules", "__tests__", "__test__", "testing"], 29 | coverageReporters: ["html", "text", "text-summary", "cobertura"], 30 | testRegex: "(\\.|/)(test|spec)\\.[jt]sx?$", 31 | // v3.0 is broken so disable it 32 | prettierPath: null, 33 | }; 34 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/node/main.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { createArgParser, DefaultNodeLauncherOptions } from "./cli"; 18 | import { startServer } from "./server"; 19 | 20 | const options = createArgParser(DefaultNodeLauncherOptions).parse(); 21 | 22 | startServer(options); 23 | -------------------------------------------------------------------------------- /.gitlab/issue_templates/bug_report.md: -------------------------------------------------------------------------------- 1 | ## Checklist before submitting a bug report 2 | 3 | - [ ] I have reviewed `CONTRIBUTING.md` document 4 | - [ ] I have done a quick search on the issue tracker to check if the bug report is not redundant 5 | 6 | ## Context 7 | 8 | [Give a concise summary of the bug that you have encountered] 9 | 10 | ## Steps to reproduce the bug 11 | 12 | [List of the steps to reproduce the bug. If relevant, you may add SysMLv2 or KerML code snippets or files that exhibit the bug.] 13 | 14 | ## Current result 15 | 16 | [What currently happens] 17 | 18 | ## Expected result 19 | 20 | [What is expected to happen instead] 21 | 22 | ## Additional context 23 | 24 | [Any additional context. If applicable, you may provide screenshots and/or error logs.] 25 | 26 | ## Possible fix 27 | 28 | [Not required but you can suggest possible fixes for the bug or link a place in the code that could possibly be causing the bug] 29 | 30 | ## Technical data 31 | 32 | - Operating system: [What is the OS] 33 | - Version of the repo: [What is the release version or a commit of the repo] 34 | - VSCode version: [What is the VSCode version] 35 | 36 | /label ~"bug report" 37 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/expressions/functions/index.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | export * from "./arithmetic"; 18 | export * from "./base"; 19 | export * from "./boolean"; 20 | export * from "./control"; 21 | export * from "./numerical"; 22 | export * from "./sequence"; 23 | export * from "./string"; 24 | -------------------------------------------------------------------------------- /packages/syside-vscode/.vscodeignore: -------------------------------------------------------------------------------- 1 | .vscode/** 2 | .vscode-test/** 3 | .gitignore 4 | .git-blame-ignore-revs 5 | .gitmodules 6 | .prettierrc 7 | .gitlab-ci.yml 8 | .VSCodeCounter 9 | .gitlab 10 | .github 11 | .swcrc 12 | .pnpm-store 13 | .vscode-tests-web 14 | 15 | # CI artifacts 16 | release.env 17 | release.description 18 | 19 | # local testing files 20 | ast.json 21 | test.kerml 22 | test.sysml 23 | 24 | # tool configs 25 | jest.config.js 26 | langium-config.json 27 | **/tsconfig*.json 28 | **/.eslintrc.json 29 | 30 | # esbuild packs all dependencies into a single output file already, no need for 31 | # node_modules 32 | node_modules 33 | 34 | # source files 35 | src/** 36 | scripts/** 37 | **/*.map 38 | **/*.ts 39 | bin/** 40 | 41 | # build artefacts 42 | out/** 43 | lib/** 44 | *.tsbuildinfo 45 | !out/extension.js 46 | !out/language-server/main.js 47 | *.zip 48 | *.vsix 49 | 50 | # other files 51 | coverage 52 | # no reason to bundle docs as they will not be seen via the extension, image 53 | # links are replaced by links to the repo 54 | docs 55 | !docs/images/logo.png 56 | trace 57 | CONTRIBUTE.md 58 | CONTRIBUTING.md 59 | pnpm-lock.yaml 60 | SysML-v2-Release 61 | .README -------------------------------------------------------------------------------- /packages/syside-languageserver/src/services/lsp/index.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | export * from "./completion-provider"; 18 | export * from "./execute-command-handler"; 19 | export * from "./formatter"; 20 | export * from "./hover-provider"; 21 | export * from "./language-server"; 22 | export * from "./semantic-token-provider"; 23 | -------------------------------------------------------------------------------- /packages/syside-languageserver/syntaxes/sysml.md.tmLanguage.json: -------------------------------------------------------------------------------- 1 | { 2 | "fileTypes": [], 3 | "injectionSelector": "L:text.html.markdown", 4 | "patterns": [ 5 | { 6 | "include": "#sysml-code-block" 7 | } 8 | ], 9 | "repository": { 10 | "sysml-code-block": { 11 | "begin": "(^|\\G)(\\s*)(\\`{3,}|~{3,})\\s*(?i:(sysml)(\\s+[^`~]*)?$)", 12 | "name": "markup.fenced_code.block.markdown", 13 | "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", 14 | "beginCaptures": { 15 | "3": { 16 | "name": "punctuation.definition.markdown" 17 | }, 18 | "4": { 19 | "name": "fenced_code.block.language.markdown" 20 | }, 21 | "5": { 22 | "name": "fenced_code.block.language.attributes.markdown" 23 | } 24 | }, 25 | "endCaptures": { 26 | "3": { 27 | "name": "punctuation.definition.markdown" 28 | } 29 | }, 30 | "patterns": [ 31 | { 32 | "begin": "(^|\\G)(\\s*)(.*)", 33 | "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", 34 | "contentName": "meta.embedded.block.sysml", 35 | "patterns": [ 36 | { 37 | "include": "source.sysml" 38 | } 39 | ] 40 | } 41 | ] 42 | } 43 | }, 44 | "scopeName": "markdown.sysml.codeblock" 45 | } -------------------------------------------------------------------------------- /packages/syside-languageserver/src/services/validation/index.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | export * from "./document-validator"; 18 | export * from "./kerml-validation-registry"; 19 | export * from "./kerml-validator"; 20 | export * from "./sysml-validation-registry"; 21 | export * from "./sysml-validator"; 22 | export * from "./validation-registry"; 23 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/KerML/references/index.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | export * from "./classifier-reference"; 18 | export * from "./element-reference"; 19 | export * from "./feature-reference"; 20 | export * from "./membership-reference"; 21 | export * from "./metaclass-reference"; 22 | export * from "./namespace-reference"; 23 | export * from "./type-reference"; 24 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/utils/index.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | export * from "./ast-to-model"; 18 | export * from "./ast-util"; 19 | export * from "./comments"; 20 | export * from "./common"; 21 | export * from "./containers"; 22 | export * from "./cst-util"; 23 | export * from "./global-scope"; 24 | export * from "./printer"; 25 | export * from "./scope-util"; 26 | export * from "./scopes"; 27 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/services/index.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | export * from "./config"; 18 | export * from "./events"; 19 | export * from "./lsp"; 20 | export * from "./parser"; 21 | export * from "./references"; 22 | export * from "./services"; 23 | export * from "./shared"; 24 | export * from "./sysml-ast-reflection"; 25 | export * from "./sysml-validation"; 26 | export * from "./validation"; 27 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/services/shared/workspace/index.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | export * from "./ast-descriptions"; 18 | export * from "./configuration-provider"; 19 | export * from "./document-builder"; 20 | export * from "./documents"; 21 | export * from "./file-system-provider"; 22 | export * from "./index-manager"; 23 | export * from "./metamodel-builder"; 24 | export * from "./workspace-manager"; 25 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/node/arg-parser.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { Command, ParseOptions } from "commander"; 18 | import { LauncherOptions } from "../launch"; 19 | 20 | export const DefaultLauncherOptions: Required = {}; 21 | 22 | export interface ArgParser { 23 | command: Command; 24 | parse(argv?: readonly string[], options?: ParseOptions): O; 25 | } 26 | -------------------------------------------------------------------------------- /packages/syside-vscode/src/configuration-schema.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import type { SysMLConfig } from "syside-languageserver"; 18 | import type { ClientConfig } from "./common/extension"; 19 | import type { ServerConfig } from "syside-languageclient"; 20 | 21 | /** 22 | * SysIDE configuration. 23 | */ 24 | export interface ConfigurationSchema extends SysMLConfig { 25 | client: ClientConfig; 26 | server: ServerConfig; 27 | } 28 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | ## Checklist before submitting a bug report 11 | 12 | - [ ] I have reviewed `CONTRIBUTING.md` document 13 | - [ ] I have done a quick search on the issue tracker to check if the bug report is not redundant 14 | 15 | ## Context 16 | 17 | [Give a concise summary of the bug that you have encountered] 18 | 19 | ## Steps to reproduce the bug 20 | 21 | [List of the steps to reproduce the bug. If relevant, you may add SysMLv2 or KerML code snippets or files that exhibit the bug.] 22 | 23 | ## Current result 24 | 25 | [What currently happens] 26 | 27 | ## Expected result 28 | 29 | [What is expected to happen instead] 30 | 31 | ## Additional context 32 | 33 | [Any additional context. If applicable, you may provide screenshots and/or error logs.] 34 | 35 | ## Possible fix 36 | 37 | [Not required but you can suggest possible fixes for the bug or link a place in the code that could possibly be causing the bug] 38 | 39 | ## Technical data 40 | 41 | - Operating system: [What is the OS] 42 | - Version of the repo: [What is the release version or a commit of the repo] 43 | - VSCode version: [What is the VSCode version] 44 | 45 | /label ~"bug report" 46 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/printer/index.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | export * from "./actions"; 18 | export * from "./annotating-elements"; 19 | export * from "./connectors"; 20 | export * from "./definition-usages"; 21 | export * from "./edges"; 22 | export * from "./expressions"; 23 | export * from "./format-options"; 24 | export * from "./namespaces"; 25 | export * from "./print"; 26 | export * from "./successions"; 27 | export * from "./utils"; 28 | -------------------------------------------------------------------------------- /packages/syside-vscode/language-configuration.json: -------------------------------------------------------------------------------- 1 | { 2 | "comments": { 3 | // symbol used for single line comment. Remove this entry if your language does not support line comments 4 | "lineComment": "//", 5 | // symbols used for start and end a block comment. Remove this entry if your language does not support block comments 6 | "blockComment": [ 7 | "//*", "*/" 8 | ] 9 | }, 10 | // symbols used as brackets 11 | "brackets": [ 12 | ["{", "}"], 13 | ["[", "]"], 14 | ["(", ")"] 15 | ], 16 | // symbols that are auto closed when typing 17 | "autoClosingPairs": [ 18 | { "open": "{", "close": "}" }, 19 | { "open": "[", "close": "]" }, 20 | { "open": "(", "close": ")" }, 21 | { "open": "'", "close": "'", "notIn": ["string", "comment"] }, 22 | { "open": "\"", "close": "\"", "notIn": ["string"] }, 23 | { "open": "/*", "close": "*/", "notIn": ["string"] }, 24 | { "open": "//*", "close": "*/", "notIn": ["string"] } 25 | ], 26 | // symbols that can be used to surround a selection 27 | "surroundingPairs": [ 28 | ["{", "}"], 29 | ["[", "]"], 30 | ["(", ")"], 31 | ["\"", "\""], 32 | ["'", "'"], 33 | ["`", "`"], 34 | ] 35 | } -------------------------------------------------------------------------------- /packages/syside-base/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "syside-base", 3 | "displayName": "SysIDE-base", 4 | "description": "Base SysIDE utilities.", 5 | "publisher": "Sensmetry", 6 | "author": { 7 | "name": "Sensmetry", 8 | "url": "https://sensmetry.com/", 9 | "email": "opensource@sensmetry.com" 10 | }, 11 | "version": "0.9.1", 12 | "preview": true, 13 | "repository": { 14 | "url": "https://gitlab.com/sensmetry/public/sysml-2ls", 15 | "type": "git", 16 | "directory": "packages/syside-base" 17 | }, 18 | "bugs": { 19 | "url": "https://gitlab.com/sensmetry/public/sysml-2ls/-/issues" 20 | }, 21 | "files": [ 22 | "lib", 23 | "src" 24 | ], 25 | "main": "./lib/index.js", 26 | "scripts": { 27 | "lint": "eslint src --ext ts --max-warnings 0", 28 | "clean": "shx rm -rf out lib coverage *.tsbuildinfo", 29 | "build": "tsc", 30 | "watch": "tsc --watch", 31 | "test": "jest --passWithNoTests", 32 | "prepack": "pnpm clean && pnpm build", 33 | "typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.test.json --noEmit", 34 | "index": "node ../../scripts/generate-index.mjs src" 35 | }, 36 | "dependencies": { 37 | "vscode-uri": "3.0.7" 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /packages/syside-languageserver/syntaxes/kerml.md.tmLanguage.json: -------------------------------------------------------------------------------- 1 | { 2 | "fileTypes": [], 3 | "injectionSelector": "L:text.html.markdown", 4 | "patterns": [ 5 | { 6 | "include": "#kerml-code-block" 7 | } 8 | ], 9 | "repository": { 10 | "kerml-code-block": { 11 | "begin": "(^|\\G)(\\s*)(\\`{3,}|~{3,})\\s*(?i:(kerml)(\\s+[^`~]*)?$)", 12 | "name": "markup.fenced_code.block.markdown", 13 | "end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", 14 | "beginCaptures": { 15 | "3": { 16 | "name": "punctuation.definition.markdown" 17 | }, 18 | "4": { 19 | "name": "fenced_code.block.language.markdown" 20 | }, 21 | "5": { 22 | "name": "fenced_code.block.language.attributes.markdown" 23 | } 24 | }, 25 | "endCaptures": { 26 | "3": { 27 | "name": "punctuation.definition.markdown" 28 | } 29 | }, 30 | "patterns": [ 31 | { 32 | "begin": "(^|\\G)(\\s*)(.*)", 33 | "while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", 34 | "contentName": "meta.embedded.block.kerml", 35 | "patterns": [ 36 | { 37 | "include": "source.kerml" 38 | } 39 | ] 40 | } 41 | ] 42 | } 43 | }, 44 | "scopeName": "markdown.kerml.codeblock" 45 | } 46 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/index.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | export * from "./KerML"; 18 | export * from "./SysML"; 19 | export * from "./containers"; 20 | export * from "./enums"; 21 | export * from "./expressions"; 22 | export * from "./implicits"; 23 | export * from "./metamodel"; 24 | export * from "./mixins"; 25 | export * from "./naming"; 26 | export * from "./notes"; 27 | export * from "./printer"; 28 | export * from "./semantic-tokens"; 29 | export * from "./types"; 30 | export * from "./util"; 31 | -------------------------------------------------------------------------------- /packages/syside-languageclient/src/__tests__/download.test.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { formatBytes } from "../download"; 18 | 19 | test.concurrent.each([ 20 | [123, 2, "123 B"], 21 | [1_024, 2, "1.00 kB"], 22 | [1_024_100, 2, "1000.10 kB"], 23 | [1_024_100, 4, "1000.0977 kB"], 24 | [2_024_100, 3, "1.930 MB"], 25 | [2_542_024_100, 2, "2.37 GB"], 26 | ])("bytes are formatted correctly: %i", (bytes, digits, expected) => { 27 | expect(formatBytes(bytes, digits)).toEqual(expected); 28 | }); 29 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/index.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | export * as ast from "./generated/ast"; 18 | export * from "./generated/grammar"; 19 | export * from "./generated/module"; 20 | export * from "./model"; 21 | export * from "./sysml-module"; 22 | export * from "./services"; 23 | export * from "./utils"; 24 | export * from "./launch"; 25 | export * from "./version"; 26 | 27 | // exporting this for utility so that downstream packages don't have to add 28 | // langium as dependency 29 | export type { DeepPartial } from "langium"; 30 | -------------------------------------------------------------------------------- /packages/syside-protocol/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "syside-protocol", 3 | "displayName": "SysIDE-protocol", 4 | "description": "Language server protocol extensions for SysIDE.", 5 | "publisher": "Sensmetry", 6 | "author": { 7 | "name": "Sensmetry", 8 | "url": "https://sensmetry.com/", 9 | "email": "opensource@sensmetry.com" 10 | }, 11 | "version": "0.9.1", 12 | "preview": true, 13 | "repository": { 14 | "url": "https://gitlab.com/sensmetry/public/sysml-2ls", 15 | "type": "git", 16 | "directory": "packages/syside-protocol" 17 | }, 18 | "bugs": { 19 | "url": "https://gitlab.com/sensmetry/public/sysml-2ls/-/issues" 20 | }, 21 | "files": [ 22 | "lib", 23 | "src" 24 | ], 25 | "main": "./lib/index.js", 26 | "scripts": { 27 | "lint": "eslint src --ext ts --max-warnings 0", 28 | "clean": "shx rm -rf out lib coverage *.tsbuildinfo", 29 | "build": "tsc", 30 | "watch": "tsc --watch", 31 | "test": "jest --passWithNoTests", 32 | "prepack": "pnpm clean && pnpm build", 33 | "typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.test.json --noEmit", 34 | "index": "node ../../scripts/generate-index.mjs src" 35 | }, 36 | "dependencies": { 37 | "vscode-languageserver": "~8.0.2" 38 | }, 39 | "devDependencies": {} 40 | } 41 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/services/validation/kerml-validation-registry.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { KerMLServices } from "../services"; 18 | import { BaseValidationRegistry, ValidationRules } from "./validation-registry"; 19 | 20 | /** 21 | * Registry for validation checks. 22 | */ 23 | export class KerMLValidationRegistry extends BaseValidationRegistry { 24 | constructor(services: KerMLServices) { 25 | super(services); 26 | const validator = services.validation.KerMLValidator; 27 | this.registerBoundRules(ValidationRules.kerml, validator); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/services/validation/sysml-validation-registry.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { SysMLServices } from "../services"; 18 | import { BaseValidationRegistry, ValidationRules } from "./validation-registry"; 19 | 20 | /** 21 | * Registry for validation checks. 22 | */ 23 | export class SysMLValidationRegistry extends BaseValidationRegistry { 24 | constructor(services: SysMLServices) { 25 | super(services); 26 | const validator = services.validation.SysMLValidator; 27 | this.registerBoundRules(ValidationRules.sysml, validator); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/KerML/relationships/redefinition.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { Redefinition } from "../../../generated/ast"; 18 | import { metamodelOf } from "../../metamodel"; 19 | import { FeatureMeta, SubsettingMeta } from "../_internal"; 20 | 21 | @metamodelOf(Redefinition) 22 | export class RedefinitionMeta extends SubsettingMeta { 23 | override ast(): Redefinition | undefined { 24 | return this._ast as Redefinition; 25 | } 26 | } 27 | 28 | declare module "../../../generated/ast" { 29 | interface Redefinition { 30 | $meta: RedefinitionMeta; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/KerML/documentation.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { Documentation } from "../../generated/ast"; 18 | import { metamodelOf } from "../metamodel"; 19 | import { CommentMeta, CommentOptions } from "./_internal"; 20 | 21 | export type DocumentationOptions = CommentOptions; 22 | 23 | @metamodelOf(Documentation) 24 | export class DocumentationMeta extends CommentMeta { 25 | override ast(): Documentation | undefined { 26 | return this._ast as Documentation; 27 | } 28 | } 29 | 30 | declare module "../../generated/ast" { 31 | interface Documentation { 32 | $meta: DocumentationMeta; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/SysML/control-node.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { ControlNode } from "../../generated/ast"; 18 | import { metamodelOf } from "../metamodel"; 19 | import { ActionUsageMeta, ActionUsageOptions } from "./action-usage"; 20 | 21 | export type ControlNodeOptions = ActionUsageOptions; 22 | 23 | @metamodelOf(ControlNode) 24 | export class ControlNodeMeta extends ActionUsageMeta { 25 | override ast(): ControlNode | undefined { 26 | return this._ast as ControlNode; 27 | } 28 | } 29 | 30 | declare module "../../generated/ast" { 31 | interface ControlNode { 32 | $meta: ControlNodeMeta; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /packages/syside-languageclient/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "syside-languageclient", 3 | "displayName": "SysIDE Language Client Extensions Legacy", 4 | "description": "Language client extensions for SysIDE.", 5 | "publisher": "Sensmetry", 6 | "author": { 7 | "name": "Sensmetry", 8 | "url": "https://sensmetry.com/", 9 | "email": "opensource@sensmetry.com" 10 | }, 11 | "version": "0.9.1", 12 | "preview": true, 13 | "repository": { 14 | "url": "https://gitlab.com/sensmetry/public/sysml-2ls", 15 | "type": "git", 16 | "directory": "packages/syside-languageclient" 17 | }, 18 | "bugs": { 19 | "url": "https://gitlab.com/sensmetry/public/sysml-2ls/-/issues" 20 | }, 21 | "files": [ 22 | "lib", 23 | "src" 24 | ], 25 | "main": "./lib/index.js", 26 | "scripts": { 27 | "lint": "eslint src --ext ts --max-warnings 0", 28 | "clean": "shx rm -rf out lib coverage *.tsbuildinfo", 29 | "build": "tsc", 30 | "watch": "tsc --watch", 31 | "test": "jest --passWithNoTests", 32 | "prepack": "pnpm clean && pnpm build", 33 | "typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.test.json --noEmit", 34 | "index": "node ../../scripts/generate-index.mjs src" 35 | }, 36 | "dependencies": { 37 | "syside-base": "workspace:*", 38 | "syside-protocol": "workspace:*", 39 | "vscode-languageserver": "~8.0.2" 40 | }, 41 | "devDependencies": {} 42 | } 43 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/KerML/expressions/index.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | export * from "./collect-expression"; 18 | export * from "./feature-chain-expression"; 19 | export * from "./feature-reference-expression"; 20 | export * from "./index-expression"; 21 | export * from "./invocation-expression"; 22 | export * from "./literal-boolean"; 23 | export * from "./literal-expression"; 24 | export * from "./literal-infinity"; 25 | export * from "./literal-number"; 26 | export * from "./literal-string"; 27 | export * from "./metadata-access-expression"; 28 | export * from "./null-expression"; 29 | export * from "./operator-expression"; 30 | export * from "./select-expression"; 31 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/KerML/relationships/cross-subsetting.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { CrossSubsetting } from "../../../generated/ast"; 18 | import { metamodelOf } from "../../metamodel"; 19 | import { FeatureMeta, SubsettingMeta } from "../_internal"; 20 | 21 | @metamodelOf(CrossSubsetting) 22 | export class CrossSubsettingMeta extends SubsettingMeta { 23 | override ast(): CrossSubsetting | undefined { 24 | return this._ast as CrossSubsetting; 25 | } 26 | } 27 | 28 | declare module "../../../generated/ast" { 29 | interface CrossSubsetting { 30 | $meta: CrossSubsettingMeta; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/SysML/for-node.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { ForkNode } from "../../generated/ast"; 18 | import { metamodelOf } from "../metamodel"; 19 | import { ControlNodeMeta, ControlNodeOptions } from "./control-node"; 20 | 21 | export type ForNodeOptions = ControlNodeOptions; 22 | 23 | @metamodelOf(ForkNode, { 24 | subaction: "Actions::Action::forks", 25 | }) 26 | export class ForkNodeMeta extends ControlNodeMeta { 27 | override ast(): ForkNode | undefined { 28 | return this._ast as ForkNode; 29 | } 30 | } 31 | 32 | declare module "../../generated/ast" { 33 | interface ForkNode { 34 | $meta: ForkNodeMeta; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/SysML/join-node.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { JoinNode } from "../../generated/ast"; 18 | import { metamodelOf } from "../metamodel"; 19 | import { ControlNodeMeta, ControlNodeOptions } from "./control-node"; 20 | 21 | export type JoinNodeOptions = ControlNodeOptions; 22 | 23 | @metamodelOf(JoinNode, { 24 | subaction: "Actions::Action::joins", 25 | }) 26 | export class JoinNodeMeta extends ControlNodeMeta { 27 | override ast(): JoinNode | undefined { 28 | return this._ast as JoinNode; 29 | } 30 | } 31 | 32 | declare module "../../generated/ast" { 33 | interface JoinNode { 34 | $meta: JoinNodeMeta; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /DCO: -------------------------------------------------------------------------------- 1 | Developer Certificate of Origin 2 | Version 1.1 3 | 4 | Copyright (C) 2004, 2006 The Linux Foundation and its contributors. 5 | 1 Letterman Drive 6 | Suite D4700 7 | San Francisco, CA, 94129 8 | 9 | Everyone is permitted to copy and distribute verbatim copies of this 10 | license document, but changing it is not allowed. 11 | 12 | 13 | Developer's Certificate of Origin 1.1 14 | 15 | By making a contribution to this project, I certify that: 16 | 17 | (a) The contribution was created in whole or in part by me and I 18 | have the right to submit it under the open source license 19 | indicated in the file; or 20 | 21 | (b) The contribution is based upon previous work that, to the best 22 | of my knowledge, is covered under an appropriate open source 23 | license and I have the right under that license to submit that 24 | work with modifications, whether created in whole or in part 25 | by me, under the same open source license (unless I am 26 | permitted to submit under a different license), as indicated 27 | in the file; or 28 | 29 | (c) The contribution was provided directly to me by some other 30 | person who certified (a), (b) or (c) and I have not modified 31 | it. 32 | 33 | (d) I understand and agree that this project and the contribution 34 | are public and that a record of the contribution (including all 35 | personal information I submit with it, including my sign-off) is 36 | maintained indefinitely and may be redistributed consistent with 37 | this project or the open source license(s) involved. -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/SysML/merge-node.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { MergeNode } from "../../generated/ast"; 18 | import { metamodelOf } from "../metamodel"; 19 | import { ControlNodeMeta, ControlNodeOptions } from "./control-node"; 20 | 21 | export type MergeNodeOptions = ControlNodeOptions; 22 | 23 | @metamodelOf(MergeNode, { 24 | subaction: "Actions::Action::merges", 25 | }) 26 | export class MergeNodeMeta extends ControlNodeMeta { 27 | override ast(): MergeNode | undefined { 28 | return this._ast as MergeNode; 29 | } 30 | } 31 | 32 | declare module "../../generated/ast" { 33 | interface MergeNode { 34 | $meta: MergeNodeMeta; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/SysML/loop-action-usage.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { LoopActionUsage } from "../../generated/ast"; 18 | import { metamodelOf } from "../metamodel"; 19 | import { ActionUsageMeta, ActionUsageOptions } from "./action-usage"; 20 | 21 | export type LoopActionUsageOptions = ActionUsageOptions; 22 | 23 | @metamodelOf(LoopActionUsage, "abstract") 24 | export class LoopActionUsageMeta extends ActionUsageMeta { 25 | override ast(): LoopActionUsage | undefined { 26 | return this._ast as LoopActionUsage; 27 | } 28 | } 29 | 30 | declare module "../../generated/ast" { 31 | interface LoopActionUsage { 32 | $meta: LoopActionUsageMeta; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/KerML/behavior.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { Behavior } from "../../generated/ast"; 18 | import { metamodelOf } from "../metamodel"; 19 | import { ClassMeta, ClassOptions } from "./_internal"; 20 | 21 | export const ImplicitBehaviors = { 22 | base: "Performances::Performance", 23 | }; 24 | 25 | export type BehaviorOptions = ClassOptions; 26 | 27 | @metamodelOf(Behavior, ImplicitBehaviors) 28 | export class BehaviorMeta extends ClassMeta { 29 | override ast(): Behavior | undefined { 30 | return this._ast as Behavior; 31 | } 32 | } 33 | 34 | declare module "../../generated/ast" { 35 | interface Behavior { 36 | $meta: BehaviorMeta; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /docs/known_limitations.md: -------------------------------------------------------------------------------- 1 | # Known Limitations 2 | 3 | - Currently, there is a [Heisenbug](https://en.wikipedia.org/wiki/Heisenbug) 4 | that appears for some users by triggering a lot of false-positive 5 | `A Feature must be typed by at least one type` errors. 6 | - We are not able to consistently reproduce this bug. 7 | - As far as we know, this might happen due to a seemingly random order of how 8 | the documents are being parsed, which leads to some SysML standard library 9 | documents to be parsed earlier or later than they should be, which breaks 10 | semantic resolution. 11 | - If any users or developers from the community are experiencing this bug on 12 | their machines, it would be easiest for them to try to fix it. 13 | - GitLab issues reporting this bug: 14 | - [#19](https://gitlab.com/sensmetry/public/sysml-2ls/-/issues/19) 15 | - [#15](https://gitlab.com/sensmetry/public/sysml-2ls/-/issues/15) 16 | - While the parser is LL(*), it may fail to parse some more complex language 17 | constructs that require lookahead outside the context of a parser rule: 18 | - Some expressions may fail to parse, i.e. feature reference expressions 19 | - Namespace (`::` and `*`) and recursive (`::` and `**`) import tokens cannot 20 | be parsed separated by whitespace 21 | - `assign` cannot have feature chains or expressions on the left side in SysML 22 | - SysML grammar is slightly relaxed for succession and transition usage elements 23 | so that they can appear anywhere in the body and are not constrained by the 24 | preceding and following elements 25 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/services/shared/service-registry.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { DefaultServiceRegistry } from "langium"; 18 | import { URI } from "vscode-uri"; 19 | import { SysMLDefaultServices } from "../services"; 20 | 21 | export class SysMLServiceRegistry extends DefaultServiceRegistry { 22 | override getServices(uri: URI): SysMLDefaultServices { 23 | try { 24 | return super.getServices(uri) as SysMLDefaultServices; 25 | } catch (_) { 26 | const services = this.singleton ?? this.map?.[".sysml"]; 27 | if (!services) throw new Error("No services registered!"); 28 | return services as SysMLDefaultServices; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/KerML/relationships/reference-subsetting.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { ReferenceSubsetting } from "../../../generated/ast"; 18 | import { metamodelOf } from "../../metamodel"; 19 | import { FeatureMeta, SubsettingMeta } from "../_internal"; 20 | 21 | @metamodelOf(ReferenceSubsetting) 22 | export class ReferenceSubsettingMeta< 23 | T extends FeatureMeta = FeatureMeta, 24 | > extends SubsettingMeta { 25 | override ast(): ReferenceSubsetting | undefined { 26 | return this._ast as ReferenceSubsetting; 27 | } 28 | } 29 | 30 | declare module "../../../generated/ast" { 31 | interface ReferenceSubsetting { 32 | $meta: ReferenceSubsettingMeta; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/SysML/decision-node.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { DecisionNode } from "../../generated/ast"; 18 | import { metamodelOf } from "../metamodel"; 19 | import { ControlNodeMeta, ControlNodeOptions } from "./control-node"; 20 | 21 | export type DecisionNodeOptions = ControlNodeOptions; 22 | 23 | @metamodelOf(DecisionNode, { 24 | subaction: "Actions::Action::decisions", 25 | }) 26 | export class DecisionNodeMeta extends ControlNodeMeta { 27 | override ast(): DecisionNode | undefined { 28 | return this._ast as DecisionNode; 29 | } 30 | } 31 | 32 | declare module "../../generated/ast" { 33 | interface DecisionNode { 34 | $meta: DecisionNodeMeta; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /packages/syside-base/src/uri.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import path from "path"; 18 | import { URI } from "vscode-uri"; 19 | 20 | export function isUriLike(path: string): boolean { 21 | // Using a + on the second group since one letter is most likely a windows 22 | // path, drives are A-Z but may be passed as lowercase since Windows FS is 23 | // case insensitive. 24 | return /^[a-zA-Z][a-zA-Z\d+.-]+:/.test(path); 25 | } 26 | 27 | export function pathToURI(path: string): URI { 28 | if (isUriLike(path)) return URI.parse(path); 29 | return URI.file(path); 30 | } 31 | 32 | export function resolvePathURI(p: string): URI { 33 | if (isUriLike(p)) return URI.parse(p); 34 | return URI.file(path.resolve(p)); 35 | } 36 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/SysML/part-definition.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { PartDefinition } from "../../generated/ast"; 18 | import { metamodelOf } from "../metamodel"; 19 | import { ItemDefinitionMeta, ItemDefinitionOptions } from "./item-definition"; 20 | 21 | export type PartDefinitionOptions = ItemDefinitionOptions; 22 | 23 | @metamodelOf(PartDefinition, { 24 | base: "Parts::Part", 25 | }) 26 | export class PartDefinitionMeta extends ItemDefinitionMeta { 27 | override ast(): PartDefinition | undefined { 28 | return this._ast as PartDefinition; 29 | } 30 | } 31 | 32 | declare module "../../generated/ast" { 33 | interface PartDefinition { 34 | $meta: PartDefinitionMeta; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/SysML/view-definition.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { ViewDefinition } from "../../generated/ast"; 18 | import { metamodelOf } from "../metamodel"; 19 | import { PartDefinitionMeta, PartDefinitionOptions } from "./part-definition"; 20 | 21 | export type ViewDefinitionOptions = PartDefinitionOptions; 22 | 23 | @metamodelOf(ViewDefinition, { 24 | base: "Views::View", 25 | }) 26 | export class ViewDefinitionMeta extends PartDefinitionMeta { 27 | override ast(): ViewDefinition | undefined { 28 | return this._ast as ViewDefinition; 29 | } 30 | } 31 | 32 | declare module "../../generated/ast" { 33 | interface ViewDefinition { 34 | $meta: ViewDefinitionMeta; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/KerML/metaclass.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { Metaclass } from "../../generated/ast"; 18 | import { metamodelOf } from "../metamodel"; 19 | import { StructureMeta, StructureOptions } from "./_internal"; 20 | 21 | export const ImplicitMetaclasses = { 22 | base: "Metaobjects::Metaobject", 23 | }; 24 | 25 | export type MetaclassOptions = StructureOptions; 26 | 27 | @metamodelOf(Metaclass, ImplicitMetaclasses) 28 | export class MetaclassMeta extends StructureMeta { 29 | override ast(): Metaclass | undefined { 30 | return this._ast as Metaclass; 31 | } 32 | } 33 | 34 | declare module "../../generated/ast" { 35 | interface Metaclass { 36 | $meta: MetaclassMeta; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/KerML/predicate.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { Predicate } from "../../generated/ast"; 18 | import { metamodelOf } from "../metamodel"; 19 | import { FunctionMeta, FunctionOptions } from "./_internal"; 20 | 21 | export const ImplicitPredicates = { 22 | base: "Performances::BooleanEvaluation", 23 | }; 24 | 25 | export type PredicateOptions = FunctionOptions; 26 | 27 | @metamodelOf(Predicate, ImplicitPredicates) 28 | export class PredicateMeta extends FunctionMeta { 29 | override ast(): Predicate | undefined { 30 | return this._ast as Predicate; 31 | } 32 | } 33 | 34 | declare module "../../generated/ast" { 35 | interface Predicate { 36 | $meta: PredicateMeta; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/KerML/references/type-reference.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { TypeReference } from "../../../generated/ast"; 18 | import { Target } from "../../../utils/containers"; 19 | import { metamodelOf } from "../../metamodel"; 20 | import { NamespaceReferenceMeta, TypeMeta } from "../_internal"; 21 | 22 | @metamodelOf(TypeReference) 23 | export class TypeReferenceMeta extends NamespaceReferenceMeta { 24 | override readonly to = new Target(); 25 | 26 | override ast(): TypeReference | undefined { 27 | return this._ast as TypeReference; 28 | } 29 | } 30 | 31 | declare module "../../../generated/ast" { 32 | interface TypeReference { 33 | $meta: TypeReferenceMeta; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/KerML/succession.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { Succession } from "../../generated/ast"; 18 | import { metamodelOf } from "../metamodel"; 19 | import { ConnectorMeta, ConnectorOptions } from "./_internal"; 20 | 21 | export const ImplicitSuccessions = { 22 | binary: "Occurrences::happensBeforeLinks", 23 | }; 24 | 25 | export type SuccessionOptions = ConnectorOptions; 26 | 27 | @metamodelOf(Succession, ImplicitSuccessions) 28 | export class SuccessionMeta extends ConnectorMeta { 29 | override ast(): Succession | undefined { 30 | return this._ast as Succession; 31 | } 32 | } 33 | 34 | declare module "../../generated/ast" { 35 | interface Succession { 36 | $meta: SuccessionMeta; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/KerML/interaction.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { Mixin } from "ts-mixer"; 18 | import { Interaction } from "../../generated/ast"; 19 | import { metamodelOf } from "../metamodel"; 20 | import { AssociationMeta, AssociationOptions, BehaviorMeta, BehaviorOptions } from "./_internal"; 21 | 22 | export interface InteractionOptions extends AssociationOptions, BehaviorOptions {} 23 | 24 | @metamodelOf(Interaction) 25 | export class InteractionMeta extends Mixin(AssociationMeta, BehaviorMeta) { 26 | override ast(): Interaction | undefined { 27 | return this._ast as Interaction; 28 | } 29 | } 30 | 31 | declare module "../../generated/ast" { 32 | interface Interaction { 33 | $meta: InteractionMeta; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/KerML/package.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { Package } from "../../generated/ast"; 18 | import { metamodelOf } from "../metamodel"; 19 | import { ElementMeta, NamespaceMeta, NamespaceOptions } from "./_internal"; 20 | 21 | export type PackageOptions = NamespaceOptions; 22 | 23 | @metamodelOf(Package) 24 | export class PackageMeta extends NamespaceMeta { 25 | override ast(): Package | undefined { 26 | return this._ast as Package; 27 | } 28 | override owner(): ElementMeta { 29 | // only namespaces are entry types 30 | return this._owner as ElementMeta; 31 | } 32 | } 33 | 34 | declare module "../../generated/ast" { 35 | interface Package { 36 | $meta: PackageMeta; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/KerML/references/feature-reference.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { FeatureReference } from "../../../generated/ast"; 18 | import { Target } from "../../../utils/containers"; 19 | import { metamodelOf } from "../../metamodel"; 20 | import { FeatureMeta, TypeReferenceMeta } from "./../_internal"; 21 | 22 | @metamodelOf(FeatureReference) 23 | export class FeatureReferenceMeta extends TypeReferenceMeta { 24 | override readonly to = new Target(); 25 | 26 | override ast(): FeatureReference | undefined { 27 | return this._ast as FeatureReference; 28 | } 29 | } 30 | 31 | declare module "../../../generated/ast" { 32 | interface FeatureReference { 33 | $meta: FeatureReferenceMeta; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/SysML/case-definition.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { CaseDefinition } from "../../generated/ast"; 18 | import { metamodelOf } from "../metamodel"; 19 | import { CalculationDefinitionMeta, CalculationDefinitionOptions } from "./calculation-definition"; 20 | 21 | export type CaseDefinitionOptions = CalculationDefinitionOptions; 22 | 23 | @metamodelOf(CaseDefinition, { 24 | base: "Cases::Case", 25 | }) 26 | export class CaseDefinitionMeta extends CalculationDefinitionMeta { 27 | override ast(): CaseDefinition | undefined { 28 | return this._ast as CaseDefinition; 29 | } 30 | } 31 | 32 | declare module "../../generated/ast" { 33 | interface CaseDefinition { 34 | $meta: CaseDefinitionMeta; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/SysML/use-case-definition.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { UseCaseDefinition } from "../../generated/ast"; 18 | import { metamodelOf } from "../metamodel"; 19 | import { CaseDefinitionMeta, CaseDefinitionOptions } from "./case-definition"; 20 | 21 | export type UseCaseDefinitionOptions = CaseDefinitionOptions; 22 | 23 | @metamodelOf(UseCaseDefinition, { 24 | base: "UseCases::UseCase", 25 | }) 26 | export class UseCaseDefinitionMeta extends CaseDefinitionMeta { 27 | override ast(): UseCaseDefinition | undefined { 28 | return this._ast as UseCaseDefinition; 29 | } 30 | } 31 | 32 | declare module "../../generated/ast" { 33 | interface UseCaseDefinition { 34 | $meta: UseCaseDefinitionMeta; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/KerML/library-package.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { LibraryPackage } from "../../generated/ast"; 18 | import { metamodelOf } from "../metamodel"; 19 | import { PackageMeta, PackageOptions } from "./_internal"; 20 | 21 | export type LibraryPackageOptions = PackageOptions; 22 | 23 | @metamodelOf(LibraryPackage) 24 | export class LibraryPackageMeta extends PackageMeta { 25 | /** 26 | * Whether this library package is standard 27 | */ 28 | isStandard = false; 29 | 30 | override ast(): LibraryPackage | undefined { 31 | return this._ast as LibraryPackage; 32 | } 33 | } 34 | 35 | declare module "../../generated/ast" { 36 | interface LibraryPackage { 37 | $meta: LibraryPackageMeta; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/SysML/life-class.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { LifeClass } from "../../generated/ast"; 18 | import { ClassMeta, ClassOptions } from "../KerML"; 19 | import { metamodelOf } from "../metamodel"; 20 | 21 | export type LifeClassOptions = ClassOptions; 22 | 23 | @metamodelOf(LifeClass) 24 | export class LifeClassMeta extends ClassMeta { 25 | override ast(): LifeClass | undefined { 26 | return this._ast as LifeClass; 27 | } 28 | 29 | override get isSufficient(): boolean { 30 | return true; 31 | } 32 | override set isSufficient(value) { 33 | // empty 34 | } 35 | } 36 | 37 | declare module "../../generated/ast" { 38 | interface LifeClass { 39 | $meta: LifeClassMeta; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/SysML/rendering-definition.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { RenderingDefinition } from "../../generated/ast"; 18 | import { metamodelOf } from "../metamodel"; 19 | import { PartDefinitionMeta, PartDefinitionOptions } from "./part-definition"; 20 | 21 | export type RenderingDefinitionOptions = PartDefinitionOptions; 22 | 23 | @metamodelOf(RenderingDefinition, { 24 | base: "Views::Rendering", 25 | }) 26 | export class RenderingDefinitionMeta extends PartDefinitionMeta { 27 | override ast(): RenderingDefinition | undefined { 28 | return this._ast as RenderingDefinition; 29 | } 30 | } 31 | 32 | declare module "../../generated/ast" { 33 | interface RenderingDefinition { 34 | $meta: RenderingDefinitionMeta; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/KerML/references/metaclass-reference.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { MetaclassReference } from "../../../generated/ast"; 18 | import { Target } from "../../../utils/containers"; 19 | import { metamodelOf } from "../../metamodel"; 20 | import { MetaclassMeta, TypeReferenceMeta } from "../_internal"; 21 | 22 | @metamodelOf(MetaclassReference) 23 | export class MetaclassReferenceMeta extends TypeReferenceMeta { 24 | override readonly to = new Target(); 25 | 26 | override ast(): MetaclassReference | undefined { 27 | return this._ast as MetaclassReference; 28 | } 29 | } 30 | 31 | declare module "../../../generated/ast" { 32 | interface MetaclassReference { 33 | $meta: MetaclassReferenceMeta; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/KerML/references/namespace-reference.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { NamespaceReference } from "../../../generated/ast"; 18 | import { Target } from "../../../utils/containers"; 19 | import { metamodelOf } from "../../metamodel"; 20 | import { ElementReferenceMeta, NamespaceMeta } from "../_internal"; 21 | 22 | @metamodelOf(NamespaceReference) 23 | export class NamespaceReferenceMeta extends ElementReferenceMeta { 24 | override readonly to = new Target(); 25 | 26 | override ast(): NamespaceReference | undefined { 27 | return this._ast as NamespaceReference; 28 | } 29 | } 30 | 31 | declare module "../../../generated/ast" { 32 | interface NamespaceReference { 33 | $meta: NamespaceReferenceMeta; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/KerML/references/classifier-reference.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { ClassifierReference } from "../../../generated/ast"; 18 | import { Target } from "../../../utils/containers"; 19 | import { metamodelOf } from "../../metamodel"; 20 | import { ClassifierMeta, TypeReferenceMeta } from "../_internal"; 21 | 22 | @metamodelOf(ClassifierReference) 23 | export class ClassifierReferenceMeta extends TypeReferenceMeta { 24 | override readonly to = new Target(); 25 | 26 | override ast(): ClassifierReference | undefined { 27 | return this._ast as ClassifierReference; 28 | } 29 | } 30 | 31 | declare module "../../../generated/ast" { 32 | interface ClassifierReference { 33 | $meta: ClassifierReferenceMeta; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/SysML/interface-usage.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { InterfaceUsage } from "../../generated/ast"; 18 | import { metamodelOf } from "../metamodel"; 19 | import { ConnectionUsageMeta, ConnectionUsageOptions } from "./connection-usage"; 20 | 21 | export type InterfaceUsageOptions = ConnectionUsageOptions; 22 | 23 | @metamodelOf(InterfaceUsage, { 24 | base: "Interfaces::interfaces", 25 | binary: "Interfaces::binaryInterfaces", 26 | }) 27 | export class InterfaceUsageMeta extends ConnectionUsageMeta { 28 | override ast(): InterfaceUsage | undefined { 29 | return this._ast as InterfaceUsage; 30 | } 31 | } 32 | 33 | declare module "../../generated/ast" { 34 | interface InterfaceUsage { 35 | $meta: InterfaceUsageMeta; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/KerML/references/membership-reference.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { MembershipReference } from "../../../generated/ast"; 18 | import { Target } from "../../../utils/containers"; 19 | import { metamodelOf } from "../../metamodel"; 20 | import { ElementReferenceMeta, MembershipMeta } from "../_internal"; 21 | 22 | @metamodelOf(MembershipReference) 23 | export class MembershipReferenceMeta extends ElementReferenceMeta { 24 | override readonly to = new Target(); 25 | 26 | override ast(): MembershipReference | undefined { 27 | return this._ast as MembershipReference; 28 | } 29 | } 30 | 31 | declare module "../../../generated/ast" { 32 | interface MembershipReference { 33 | $meta: MembershipReferenceMeta; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /packages/syside-languageclient/src/__tests__/api.test.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { LanguageClientExtension } from "../api"; 18 | 19 | describe("Language client extension", () => { 20 | const keys = ["onBeforeStart", "onStarted", "onDeactivate"]; 21 | 22 | it("should assert true for objects with all keys implemented", () => { 23 | expect( 24 | LanguageClientExtension.is(Object.fromEntries(keys.map((k) => [k, jest.fn()]))) 25 | ).toBeTruthy(); 26 | }); 27 | 28 | it.each(keys)("should assert false for objects with '%s' missing", (key) => { 29 | expect( 30 | LanguageClientExtension.is( 31 | Object.fromEntries(keys.filter((k) => k !== key).map((k) => [k, jest.fn()])) 32 | ) 33 | ).toBeFalsy(); 34 | }); 35 | }); 36 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/SysML/allocation-usage.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { AllocationUsage } from "../../generated/ast"; 18 | import { metamodelOf } from "../metamodel"; 19 | import { ConnectionUsageMeta, ConnectionUsageOptions } from "./connection-usage"; 20 | 21 | export type AllocationUsageOptions = ConnectionUsageOptions; 22 | 23 | @metamodelOf(AllocationUsage, { 24 | base: "Allocations::allocations", 25 | binary: "Allocations::allocations", 26 | }) 27 | export class AllocationUsageMeta extends ConnectionUsageMeta { 28 | override ast(): AllocationUsage | undefined { 29 | return this._ast as AllocationUsage; 30 | } 31 | } 32 | 33 | declare module "../../generated/ast" { 34 | interface AllocationUsage { 35 | $meta: AllocationUsageMeta; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/SysML/relationships/index.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | export * from "./actor-membership"; 18 | export * from "./conjugated-port-typing"; 19 | export * from "./expose"; 20 | export * from "./framed-concern-membership"; 21 | export * from "./membership-expose"; 22 | export * from "./namespace-expose"; 23 | export * from "./objective-membership"; 24 | export * from "./port-conjugation"; 25 | export * from "./requirement-constraint-membership"; 26 | export * from "./requirement-verification-membership"; 27 | export * from "./stakeholder-membership"; 28 | export * from "./state-subaction-membership"; 29 | export * from "./subject-membership"; 30 | export * from "./transition-feature-membership"; 31 | export * from "./variant-membership"; 32 | export * from "./view-rendering-membership"; 33 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/KerML/binding-connector.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { BindingConnector } from "../../generated/ast"; 18 | import { metamodelOf } from "../metamodel"; 19 | import { ConnectorMeta, ConnectorOptions } from "./_internal"; 20 | 21 | export const ImplicitBindingConnectors = { 22 | binary: "Links::selfLinks", 23 | }; 24 | 25 | export type BindingConnectorOptions = ConnectorOptions; 26 | 27 | @metamodelOf(BindingConnector, ImplicitBindingConnectors) 28 | export class BindingConnectorMeta extends ConnectorMeta { 29 | override ast(): BindingConnector | undefined { 30 | return this._ast as BindingConnector; 31 | } 32 | } 33 | 34 | declare module "../../generated/ast" { 35 | interface BindingConnector { 36 | $meta: BindingConnectorMeta; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/SysML/concern-definition.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { ConcernDefinition } from "../../generated/ast"; 18 | import { metamodelOf } from "../metamodel"; 19 | import { RequirementDefinitionMeta, RequirementDefinitionOptions } from "./requirement-definition"; 20 | 21 | export type ConcernDefinitionOptions = RequirementDefinitionOptions; 22 | 23 | @metamodelOf(ConcernDefinition, { 24 | base: "Requirements::ConcernCheck", 25 | }) 26 | export class ConcernDefinitionMeta extends RequirementDefinitionMeta { 27 | override ast(): ConcernDefinition | undefined { 28 | return this._ast as ConcernDefinition; 29 | } 30 | } 31 | 32 | declare module "../../generated/ast" { 33 | interface ConcernDefinition { 34 | $meta: ConcernDefinitionMeta; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/KerML/class.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { Class } from "../../generated/ast"; 18 | import { TypeClassifier } from "../enums"; 19 | import { metamodelOf } from "../metamodel"; 20 | import { ClassifierMeta, ClassifierOptions } from "./_internal"; 21 | 22 | export const ImplicitClasses = { 23 | base: "Occurrences::Occurrence", 24 | }; 25 | 26 | export type ClassOptions = ClassifierOptions; 27 | 28 | @metamodelOf(Class, ImplicitClasses) 29 | export class ClassMeta extends ClassifierMeta { 30 | protected override _classifier = TypeClassifier.Class; 31 | 32 | override ast(): Class | undefined { 33 | return this._ast as Class; 34 | } 35 | } 36 | 37 | declare module "../../generated/ast" { 38 | interface Class { 39 | $meta: ClassMeta; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/SysML/analysis-case-definition.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { AnalysisCaseDefinition } from "../../generated/ast"; 18 | import { metamodelOf } from "../metamodel"; 19 | import { CaseDefinitionMeta, CaseDefinitionOptions } from "./case-definition"; 20 | 21 | export type AnalysisCaseDefinitionOptions = CaseDefinitionOptions; 22 | 23 | @metamodelOf(AnalysisCaseDefinition, { 24 | base: "AnalysisCases::AnalysisCase", 25 | }) 26 | export class AnalysisCaseDefinitionMeta extends CaseDefinitionMeta { 27 | override ast(): AnalysisCaseDefinition | undefined { 28 | return this._ast as AnalysisCaseDefinition; 29 | } 30 | } 31 | 32 | declare module "../../generated/ast" { 33 | interface AnalysisCaseDefinition { 34 | $meta: AnalysisCaseDefinitionMeta; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/KerML/structure.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { Structure } from "../../generated/ast"; 18 | import { TypeClassifier } from "../enums"; 19 | import { metamodelOf } from "../metamodel"; 20 | import { ClassMeta, ClassOptions } from "./_internal"; 21 | 22 | export const ImplicitStructures = { 23 | base: "Objects::Object", 24 | }; 25 | 26 | export type StructureOptions = ClassOptions; 27 | 28 | @metamodelOf(Structure, ImplicitStructures) 29 | export class StructureMeta extends ClassMeta { 30 | protected override _classifier = TypeClassifier.Structure; 31 | 32 | override ast(): Structure | undefined { 33 | return this._ast as Structure; 34 | } 35 | } 36 | 37 | declare module "../../generated/ast" { 38 | interface Structure { 39 | $meta: StructureMeta; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/KerML/boolean-expression.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { BooleanExpression } from "../../generated/ast"; 18 | import { metamodelOf } from "../metamodel"; 19 | import { ExpressionMeta, ExpressionOptions } from "./_internal"; 20 | 21 | export const ImplicitBooleanExpressions = { 22 | base: "Performances::booleanEvaluations", 23 | }; 24 | 25 | export type BooleanExpressionOptions = ExpressionOptions; 26 | 27 | @metamodelOf(BooleanExpression, ImplicitBooleanExpressions) 28 | export class BooleanExpressionMeta extends ExpressionMeta { 29 | override ast(): BooleanExpression | undefined { 30 | return this._ast as BooleanExpression; 31 | } 32 | } 33 | 34 | declare module "../../generated/ast" { 35 | interface BooleanExpression { 36 | $meta: BooleanExpressionMeta; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/KerML/data-type.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { DataType } from "../../generated/ast"; 18 | import { TypeClassifier } from "../enums"; 19 | import { metamodelOf } from "../metamodel"; 20 | import { ClassifierMeta, ClassifierOptions } from "./_internal"; 21 | 22 | export const ImplicitDataTypes = { 23 | base: "Base::DataValue", 24 | }; 25 | 26 | export type DataTypeOptions = ClassifierOptions; 27 | 28 | @metamodelOf(DataType, ImplicitDataTypes) 29 | export class DataTypeMeta extends ClassifierMeta { 30 | protected override _classifier = TypeClassifier.DataType; 31 | 32 | override ast(): DataType | undefined { 33 | return this._ast as DataType; 34 | } 35 | } 36 | 37 | declare module "../../generated/ast" { 38 | interface DataType { 39 | $meta: DataTypeMeta; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/SysML/requirement-definition.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { RequirementDefinition } from "../../generated/ast"; 18 | import { metamodelOf } from "../metamodel"; 19 | import { ConstraintDefinitionMeta, ConstraintDefinitionOptions } from "./constraint-definition"; 20 | 21 | export type RequirementDefinitionOptions = ConstraintDefinitionOptions; 22 | 23 | @metamodelOf(RequirementDefinition, { 24 | base: "Requirements::RequirementCheck", 25 | }) 26 | export class RequirementDefinitionMeta extends ConstraintDefinitionMeta { 27 | override ast(): RequirementDefinition | undefined { 28 | return this._ast as RequirementDefinition; 29 | } 30 | } 31 | 32 | declare module "../../generated/ast" { 33 | interface RequirementDefinition { 34 | $meta: RequirementDefinitionMeta; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/SysML/viewpoint-definition.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { ViewpointDefinition } from "../../generated/ast"; 18 | import { metamodelOf } from "../metamodel"; 19 | import { RequirementDefinitionMeta } from "./requirement-definition"; 20 | import { RequirementUsageOptions } from "./requirement-usage"; 21 | 22 | export type ViewpointDefinitionOptions = RequirementUsageOptions; 23 | 24 | @metamodelOf(ViewpointDefinition, { 25 | base: "Views::ViewpointCheck", 26 | }) 27 | export class ViewpointDefinitionMeta extends RequirementDefinitionMeta { 28 | override ast(): ViewpointDefinition | undefined { 29 | return this._ast as ViewpointDefinition; 30 | } 31 | } 32 | 33 | declare module "../../generated/ast" { 34 | interface ViewpointDefinition { 35 | $meta: ViewpointDefinitionMeta; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/SysML/interface-definition.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { InterfaceDefinition } from "../../generated/ast"; 18 | import { metamodelOf } from "../metamodel"; 19 | import { ConnectionDefinitionMeta, ConnectionDefinitionOptions } from "./connection-definition"; 20 | 21 | export type InterfaceDefinitionOptions = ConnectionDefinitionOptions; 22 | 23 | @metamodelOf(InterfaceDefinition, { 24 | base: "Interfaces::Interface", 25 | binary: "Interfaces::BinaryInterface", 26 | }) 27 | export class InterfaceDefinitionMeta extends ConnectionDefinitionMeta { 28 | override ast(): InterfaceDefinition | undefined { 29 | return this._ast as InterfaceDefinition; 30 | } 31 | } 32 | 33 | declare module "../../generated/ast" { 34 | interface InterfaceDefinition { 35 | $meta: InterfaceDefinitionMeta; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/SysML/verification-case-definition.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { VerificationCaseDefinition } from "../../generated/ast"; 18 | import { metamodelOf } from "../metamodel"; 19 | import { CaseDefinitionMeta, CaseDefinitionOptions } from "./case-definition"; 20 | 21 | export type VerificationCaseDefinitionOptions = CaseDefinitionOptions; 22 | 23 | @metamodelOf(VerificationCaseDefinition, { 24 | base: "VerificationCases::VerificationCase", 25 | }) 26 | export class VerificationCaseDefinitionMeta extends CaseDefinitionMeta { 27 | override ast(): VerificationCaseDefinition | undefined { 28 | return this._ast as VerificationCaseDefinition; 29 | } 30 | } 31 | 32 | declare module "../../generated/ast" { 33 | interface VerificationCaseDefinition { 34 | $meta: VerificationCaseDefinitionMeta; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/SysML/allocation-definition.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { AllocationDefinition } from "../../generated/ast"; 18 | import { metamodelOf } from "../metamodel"; 19 | import { ConnectionDefinitionMeta, ConnectionDefinitionOptions } from "./connection-definition"; 20 | 21 | export type AllocationDefinitionOptions = ConnectionDefinitionOptions; 22 | 23 | @metamodelOf(AllocationDefinition, { 24 | base: "Allocations::Allocation", 25 | binary: "Allocations::Allocation", 26 | }) 27 | export class AllocationDefinitionMeta extends ConnectionDefinitionMeta { 28 | override ast(): AllocationDefinition | undefined { 29 | return this._ast as AllocationDefinition; 30 | } 31 | } 32 | 33 | declare module "../../generated/ast" { 34 | interface AllocationDefinition { 35 | $meta: AllocationDefinitionMeta; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/SysML/enumeration-usage.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { EnumerationUsage, EnumerationDefinition } from "../../generated/ast"; 18 | import { metamodelOf } from "../metamodel"; 19 | import { AttributeUsageMeta, AttributeUsageOptions } from "./attribute-usage"; 20 | 21 | export type EnumerationUsageOptions = AttributeUsageOptions; 22 | 23 | @metamodelOf(EnumerationUsage) 24 | export class EnumerationUsageMeta extends AttributeUsageMeta { 25 | override ast(): EnumerationUsage | undefined { 26 | return this._ast as EnumerationUsage; 27 | } 28 | protected override isVariantNode(): boolean { 29 | return Boolean(this.owner()?.is(EnumerationDefinition)); 30 | } 31 | } 32 | 33 | declare module "../../generated/ast" { 34 | interface EnumerationUsage { 35 | $meta: EnumerationUsageMeta; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/__tests__/kerml/core/classifiers.test.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { Classifier } from "../../../generated/ast"; 18 | import { anything, parsedNode } from "../../../testing"; 19 | 20 | test("specializations can be parsed", async () => { 21 | return expect(` 22 | classifier A; 23 | classifier B; 24 | specialization Super subclassifier A specializes B; 25 | specialization subclassifier B :> A { 26 | doc /* unnamed */ 27 | }`).toParseKerML(); 28 | }); 29 | 30 | test("classifiers can specialize multiple other classifiers", async () => { 31 | return expect( 32 | parsedNode( 33 | ` 34 | classifier A; 35 | classifier B; 36 | classifier C specializes A, B;`, 37 | { node: Classifier, index: 2 } 38 | ) 39 | ).resolves.toMatchObject({ heritage: anything(2) }); 40 | }); 41 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/node/server.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { createConnection, ProposedFeatures } from "vscode-languageserver/node"; 18 | import { createSysMLServices } from "../sysml-module"; 19 | import { createTransport, NodeLauncherOptions } from "./cli"; 20 | import { SysMLNodeFileSystem } from "./node-file-system-provider"; 21 | import { startServer as _startServer } from "../launch"; 22 | 23 | export function startServer(options: NodeLauncherOptions): ReturnType { 24 | const [input, output] = createTransport(options); 25 | 26 | // type inference breaks down for related tuple elements 27 | // eslint-disable-next-line @typescript-eslint/no-explicit-any 28 | const connection = createConnection(ProposedFeatures.all, input as any, output as any); 29 | 30 | return _startServer(connection, SysMLNodeFileSystem, options); 31 | } 32 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/expressions/__tests__/numerical.test.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { expectEvaluationResult } from "./util"; 18 | 19 | const PACKAGE = ` 20 | package NumericalFunctions { 21 | abstract function product; 22 | abstract function sum; 23 | } 24 | `; 25 | 26 | test.concurrent.each([ 27 | ["Product", "NumericalFunctions::product((1,2,3,4))", [24]], 28 | ["Product", "NumericalFunctions::product(4)", [4]], 29 | ["Sum", "NumericalFunctions::sum((1,2,3,4))", [10]], 30 | ["Sum", "NumericalFunctions::sum(4)", [4]], 31 | ])("%s (%s) can be evaluated", async (_: string, body: string, expected: unknown[]) => { 32 | await expectEvaluationResult({ 33 | text: 34 | PACKAGE + 35 | ` 36 | in feature a = ${body}; 37 | `, 38 | langId: "kerml", 39 | result: expected, 40 | }); 41 | }); 42 | -------------------------------------------------------------------------------- /packages/syside-vscode/src/browser/vscode.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { ClientConfig, MaybePromise } from "syside-languageclient"; 18 | import { BaseSysMLVSCodeClientExtender } from "../common/vscode"; 19 | 20 | /** 21 | * SysML language client for browser VS Code. 22 | */ 23 | export class SysMLVSCodeClientExtender extends BaseSysMLVSCodeClientExtender { 24 | protected override selectStdlibPath(): MaybePromise { 25 | // language server uses virtual FS so there is nothing to select here 26 | return this.stdlibURL; 27 | } 28 | protected override loadConfig(): MaybePromise { 29 | return this.config; 30 | } 31 | protected override saveConfig(): MaybePromise { 32 | return; 33 | } 34 | protected override maybeUpdateDownloadedStdlib(): MaybePromise { 35 | return; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/utils/containers.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { ElementMeta } from "../model"; 18 | import { JSONConvertible } from "./common"; 19 | 20 | export class Target implements JSONConvertible { 21 | protected ref: T | null | undefined; 22 | 23 | constructor(value?: T) { 24 | this.ref = value; 25 | } 26 | 27 | get target(): T | undefined { 28 | return this.ref ?? undefined; 29 | } 30 | 31 | get cached(): boolean { 32 | return this.ref !== undefined; 33 | } 34 | 35 | set(value?: T): void { 36 | this.ref = value ?? null; 37 | } 38 | 39 | toJSON(): object | undefined { 40 | if (this.target) return { reference_: this.target.qualifiedName }; 41 | return this.target; 42 | } 43 | 44 | reset(): void { 45 | this.ref = undefined; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "jest.autoRun": { 3 | "watch": false, 4 | "onSave": "test-file" 5 | }, 6 | "cSpell.words": [ 7 | "assoc", 8 | "Classpath", 9 | "Langium", 10 | "nonunique", 11 | "Sensmetry" 12 | ], 13 | "VSCodeCounter.exclude": [ 14 | "**/.gitignore", 15 | "**/.vscode/**", 16 | "**/node_modules/**", 17 | "**/out/**", 18 | "**/generated/**", 19 | "SysML-v2-Release/**", 20 | "package-lock.json" 21 | ], 22 | "editor.codeActionsOnSave": { 23 | "source.fixAll.eslint": "explicit" 24 | }, 25 | "eslint.validate": [ 26 | "typescript" 27 | ], 28 | "[typescript]": { 29 | "editor.formatOnSave": true, 30 | "editor.defaultFormatter": "esbenp.prettier-vscode" 31 | }, 32 | "[langium]": { 33 | "editor.formatOnSave": true 34 | }, 35 | "[yaml]": { 36 | "editor.insertSpaces": true, 37 | "editor.tabSize": 2, 38 | "editor.autoIndent": "advanced", 39 | "gitlens.codeLens.scopes": [ 40 | "document" 41 | ], 42 | "editor.defaultFormatter": "esbenp.prettier-vscode" 43 | }, 44 | "[json]": { 45 | "editor.quickSuggestions": { 46 | "strings": true 47 | }, 48 | "editor.suggest.insertMode": "replace", 49 | "gitlens.codeLens.scopes": [ 50 | "document" 51 | ], 52 | "files.insertFinalNewline": true 53 | }, 54 | "[markdown]": { 55 | "editor.defaultFormatter": "yzhang.markdown-all-in-one" 56 | }, 57 | "debug.onTaskErrors": "debugAnyway", 58 | "jest.monitorLongRun": 30000, 59 | "jest.jestCommandLine": "pnpm run test --verbose=false", 60 | } -------------------------------------------------------------------------------- /packages/syside-languageserver/src/generated/module.ts: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * This file was generated by langium-cli 1.2.1. 3 | * DO NOT EDIT MANUALLY! 4 | ******************************************************************************/ 5 | 6 | import type { LangiumGeneratedServices, LangiumGeneratedSharedServices, LangiumSharedServices, LangiumServices, LanguageMetaData, Module, IParserConfig } from 'langium'; 7 | import { SysMlAstReflection } from './ast'; 8 | import { KerMLGrammar, SysMLGrammar } from './grammar'; 9 | 10 | export const KerMLLanguageMetaData: LanguageMetaData = { 11 | languageId: 'kerml', 12 | fileExtensions: ['.kerml'], 13 | caseInsensitive: false 14 | }; 15 | 16 | export const SysMLLanguageMetaData: LanguageMetaData = { 17 | languageId: 'sysml', 18 | fileExtensions: ['.sysml'], 19 | caseInsensitive: false 20 | }; 21 | 22 | export const parserConfig: IParserConfig = { 23 | recoveryEnabled: true, 24 | nodeLocationTracking: 'none', 25 | }; 26 | 27 | export const SysMlGeneratedSharedModule: Module = { 28 | AstReflection: () => new SysMlAstReflection() 29 | }; 30 | 31 | export const KerMLGeneratedModule: Module = { 32 | Grammar: () => KerMLGrammar(), 33 | LanguageMetaData: () => KerMLLanguageMetaData, 34 | parser: { 35 | ParserConfig: () => parserConfig 36 | } 37 | }; 38 | 39 | export const SysMLGeneratedModule: Module = { 40 | Grammar: () => SysMLGrammar(), 41 | LanguageMetaData: () => SysMLLanguageMetaData, 42 | parser: { 43 | ParserConfig: () => parserConfig 44 | } 45 | }; 46 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/KerML/expressions/select-expression.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { SelectExpression } from "../../../generated/ast"; 18 | import { metamodelOf } from "../../metamodel"; 19 | import { OperatorExpressionMeta, OperatorExpressionOptions } from "../_internal"; 20 | 21 | export interface SelectExpressionOptions extends OperatorExpressionOptions { 22 | operator?: never; 23 | } 24 | 25 | @metamodelOf(SelectExpression) 26 | export class SelectExpressionMeta extends OperatorExpressionMeta { 27 | override ast(): SelectExpression | undefined { 28 | return this._ast as SelectExpression; 29 | } 30 | 31 | override getFunction(): string | undefined { 32 | return "ControlFunctions::select"; 33 | } 34 | } 35 | 36 | declare module "../../../generated/ast" { 37 | interface SelectExpression { 38 | $meta: SelectExpressionMeta; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /packages/syside-vscode/scripts/publish.mjs: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | /* eslint-disable @typescript-eslint/no-var-requires */ 18 | // Using a separate script so that we can pass command line arguments to `vsce` 19 | // and still be able to run other commands after it 20 | 21 | import util from "util"; 22 | import child_process from "child_process"; 23 | import process from "process"; 24 | import manifest from "../package.json" assert { type: "json"}; 25 | 26 | const exec = util.promisify(child_process.exec); 27 | 28 | const args = process.argv.slice(2); 29 | const packageIndex = args.findIndex((arg) => /-i|--packagePath/.test(arg)); 30 | 31 | if (packageIndex === -1) { 32 | const out = `${manifest.name}-${manifest.version}.vsix`; 33 | await exec(`pnpm run vscode:package -o ${out}`); 34 | args.push("--packagePath", out); 35 | } 36 | 37 | exec("pnpm vsce publish " + args.join(" "), { stdio: "inherit" }); 38 | -------------------------------------------------------------------------------- /packages/syside-cli/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "syside-cli", 3 | "displayName": "SysIDE-CLI Legacy", 4 | "description": "CLI for SysIDE.", 5 | "publisher": "Sensmetry", 6 | "author": { 7 | "name": "Sensmetry", 8 | "url": "https://sensmetry.com/", 9 | "email": "opensource@sensmetry.com" 10 | }, 11 | "version": "0.9.1", 12 | "preview": true, 13 | "repository": { 14 | "url": "https://gitlab.com/sensmetry/public/sysml-2ls", 15 | "type": "git", 16 | "directory": "packages/syside-cli" 17 | }, 18 | "bugs": { 19 | "url": "https://gitlab.com/sensmetry/public/sysml-2ls/-/issues" 20 | }, 21 | "files": [ 22 | "bin", 23 | "out", 24 | "lib", 25 | "src" 26 | ], 27 | "main": "./out/index.js", 28 | "scripts": { 29 | "lint": "eslint src --ext ts --max-warnings 0", 30 | "clean": "shx rm -rf out lib coverage *.tsbuildinfo", 31 | "build": "tsc", 32 | "watch": "tsc --watch", 33 | "test": "jest --passWithNoTests", 34 | "prepack": "pnpm clean && pnpm build && pnpm esbuild --minify", 35 | "typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.test.json --noEmit", 36 | "esbuild-base": "node ../../scripts/build.mjs node src/index.ts", 37 | "esbuild": "pnpm run esbuild-base --sourcemap", 38 | "esbuild:watch": "pnpm run esbuild-base --sourcemap --watch" 39 | }, 40 | "dependencies": { 41 | "chalk": "^5.2.0", 42 | "commander": "^10.0.1", 43 | "syside-languageserver": "workspace:*", 44 | "vscode-uri": "3.0.7" 45 | }, 46 | "devDependencies": { 47 | "langium": "~1.2.0", 48 | "vscode-languageserver": "~8.0.2" 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/SysML/references/conjugated-port-reference.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { ConjugatedPortReference } from "../../../generated/ast"; 18 | import { Target } from "../../../utils/containers"; 19 | import { ClassifierReferenceMeta } from "../../KerML/references/classifier-reference"; 20 | import { metamodelOf } from "../../metamodel"; 21 | import { PortDefinitionMeta } from "../port-definition"; 22 | 23 | @metamodelOf(ConjugatedPortReference) 24 | export class ConjugatedPortReferenceMeta extends ClassifierReferenceMeta { 25 | override readonly to = new Target(); 26 | 27 | override ast(): ConjugatedPortReference | undefined { 28 | return this._ast as ConjugatedPortReference; 29 | } 30 | } 31 | 32 | declare module "../../../generated/ast" { 33 | interface ConjugatedPortReference { 34 | $meta: ConjugatedPortReferenceMeta; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/services/references/name-provider.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { AstNode, CstNode, DefaultNameProvider, findNodeForProperty } from "langium"; 18 | import { isElement } from "../../generated/ast"; 19 | import { getName } from "../../model/naming"; 20 | 21 | export class SysMLNameProvider extends DefaultNameProvider { 22 | // overriding name provider methods since names can also be provided by the 23 | // short name 24 | 25 | override getName(node: AstNode): string | undefined { 26 | if (isElement(node)) { 27 | return getName(node.$meta); 28 | } 29 | return undefined; 30 | } 31 | 32 | override getNameNode(node: AstNode): CstNode | undefined { 33 | return ( 34 | findNodeForProperty(node.$cstNode, "declaredName") ?? 35 | findNodeForProperty(node.$cstNode, "declaredShortName") 36 | ); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/SysML/attribute-definition.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { Mixin } from "ts-mixer"; 18 | import { AttributeDefinition } from "../../generated/ast"; 19 | import { DataTypeMeta, DataTypeOptions } from "../KerML/data-type"; 20 | import { metamodelOf } from "../metamodel"; 21 | import { DefinitionMeta, DefinitionOptions } from "./definition"; 22 | 23 | export interface AttributeDefinitionOptions extends DataTypeOptions, DefinitionOptions {} 24 | 25 | @metamodelOf(AttributeDefinition, { 26 | base: "Base::DataValue", 27 | }) 28 | export class AttributeDefinitionMeta extends Mixin(DataTypeMeta, DefinitionMeta) { 29 | override ast(): AttributeDefinition | undefined { 30 | return this._ast as AttributeDefinition; 31 | } 32 | } 33 | 34 | declare module "../../generated/ast" { 35 | interface AttributeDefinition { 36 | $meta: AttributeDefinitionMeta; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/SysML/attribute-usage.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { AttributeUsage } from "../../generated/ast"; 18 | import { enumerable } from "../../utils"; 19 | import { metamodelOf } from "../metamodel"; 20 | import { UsageMeta, UsageOptions } from "./usage"; 21 | 22 | export type AttributeUsageOptions = UsageOptions; 23 | 24 | @metamodelOf(AttributeUsage, { 25 | base: "Base::dataValues", 26 | }) 27 | export class AttributeUsageMeta extends UsageMeta { 28 | @enumerable 29 | override get isComposite(): boolean { 30 | return false; 31 | } 32 | override set isComposite(value) { 33 | // empty 34 | } 35 | 36 | override ast(): AttributeUsage | undefined { 37 | return this._ast as AttributeUsage; 38 | } 39 | } 40 | 41 | declare module "../../generated/ast" { 42 | interface AttributeUsage { 43 | $meta: AttributeUsageMeta; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/SysML/item-definition.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { Mixin } from "ts-mixer"; 18 | import { ItemDefinition } from "../../generated/ast"; 19 | import { StructureMeta, StructureOptions } from "../KerML/structure"; 20 | import { metamodelOf } from "../metamodel"; 21 | import { OccurrenceDefinitionMeta, OccurrenceDefinitionOptions } from "./occurrence-definition"; 22 | 23 | export interface ItemDefinitionOptions extends StructureOptions, OccurrenceDefinitionOptions {} 24 | 25 | @metamodelOf(ItemDefinition, { 26 | base: "Items::Item", 27 | }) 28 | export class ItemDefinitionMeta extends Mixin(StructureMeta, OccurrenceDefinitionMeta) { 29 | override ast(): ItemDefinition | undefined { 30 | return this._ast as ItemDefinition; 31 | } 32 | } 33 | 34 | declare module "../../generated/ast" { 35 | interface ItemDefinition { 36 | $meta: ItemDefinitionMeta; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/launch/server.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { startLanguageServer } from "langium"; 18 | import type { Connection } from "vscode-languageserver"; 19 | import { createSysMLServices, SharedModuleContext } from "../sysml-module"; 20 | 21 | // eslint-disable-next-line @typescript-eslint/no-empty-interface 22 | export interface LauncherOptions { 23 | // TODO: options for some fields in SysMLConfig 24 | } 25 | 26 | export function startServer( 27 | connection: Connection, 28 | context: Omit, 29 | options: LauncherOptions 30 | ): ReturnType { 31 | // Inject the shared services and language-specific services 32 | const services = createSysMLServices({ connection, ...context }, options); 33 | 34 | // Start the language server with the shared services 35 | startLanguageServer(services.shared); 36 | 37 | return services; 38 | } 39 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/SysML/action-definition.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { Mixin } from "ts-mixer"; 18 | import { ActionDefinition } from "../../generated/ast"; 19 | import { BehaviorMeta, BehaviorOptions } from "../KerML/behavior"; 20 | import { metamodelOf } from "../metamodel"; 21 | import { OccurrenceDefinitionMeta, OccurrenceDefinitionOptions } from "./occurrence-definition"; 22 | 23 | export interface ActionDefinitionOptions extends BehaviorOptions, OccurrenceDefinitionOptions {} 24 | 25 | @metamodelOf(ActionDefinition, { 26 | base: "Actions::Action", 27 | }) 28 | export class ActionDefinitionMeta extends Mixin(BehaviorMeta, OccurrenceDefinitionMeta) { 29 | override ast(): ActionDefinition | undefined { 30 | return this._ast as ActionDefinition; 31 | } 32 | } 33 | 34 | declare module "../../generated/ast" { 35 | interface ActionDefinition { 36 | $meta: ActionDefinitionMeta; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/SysML/metadata-definition.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { Mixin } from "ts-mixer"; 18 | import { MetadataDefinition } from "../../generated/ast"; 19 | import { MetaclassMeta, MetaclassOptions } from "../KerML/metaclass"; 20 | import { metamodelOf } from "../metamodel"; 21 | import { ItemDefinitionMeta, ItemDefinitionOptions } from "./item-definition"; 22 | 23 | export interface MetadataDefinitionOptions extends MetaclassOptions, ItemDefinitionOptions {} 24 | 25 | @metamodelOf(MetadataDefinition, { 26 | base: "Metadata::MetadataItem", 27 | }) 28 | export class MetadataDefinitionMeta extends Mixin(MetaclassMeta, ItemDefinitionMeta) { 29 | override ast(): MetadataDefinition | undefined { 30 | return this._ast as MetadataDefinition; 31 | } 32 | } 33 | 34 | declare module "../../generated/ast" { 35 | interface MetadataDefinition { 36 | $meta: MetadataDefinitionMeta; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/KerML/expressions/index-expression.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { IndexExpression } from "../../../generated/ast"; 18 | import { metamodelOf } from "../../metamodel"; 19 | import { 20 | AnyOperator, 21 | IMPLICIT_OPERATORS, 22 | OperatorExpressionMeta, 23 | OperatorExpressionOptions, 24 | } from "../_internal"; 25 | 26 | export interface IndexExpressionOptions extends OperatorExpressionOptions { 27 | operator?: never; 28 | } 29 | 30 | @metamodelOf(IndexExpression) 31 | export class IndexExpressionMeta extends OperatorExpressionMeta { 32 | override get operator(): AnyOperator { 33 | return IMPLICIT_OPERATORS.INDEX; 34 | } 35 | 36 | override ast(): IndexExpression | undefined { 37 | return this._ast as IndexExpression; 38 | } 39 | } 40 | 41 | declare module "../../../generated/ast" { 42 | interface IndexExpression { 43 | $meta: IndexExpressionMeta; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /packages/syside-cli/src/index.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { Command, Option } from "commander"; 18 | import { Extensions, evalAction } from "./sysml-util"; 19 | 20 | export default function (): void { 21 | const program = new Command(); 22 | 23 | program 24 | // eslint-disable-next-line @typescript-eslint/no-var-requires 25 | .version(require("../package.json").version); 26 | 27 | program 28 | .command("dump") 29 | .argument("", `possible file extensions: ${Extensions.join(", ")}`) 30 | .option("-v, --validate", "Enable validation checks", false) 31 | .addOption( 32 | new Option("-l, --stdlib ", "Set standard library type") 33 | .choices(["none", "standard", "local"]) 34 | .default("standard") 35 | ) 36 | .description("Dump AST as JSON to console") 37 | .action(evalAction); 38 | 39 | program.parse(process.argv); 40 | } 41 | -------------------------------------------------------------------------------- /docs/releasing.md: -------------------------------------------------------------------------------- 1 | # Releasing 2 | 3 | ## Prerequisites 4 | 5 | Release jobs expect CI variables for `release` environment: 6 | 7 | - `ACCESS_TOKEN` - project access token with `write_repository` scope and 8 | maintainer role (to allow commits straight to `main` branch). They can be 9 | created from `Settings > Access Tokens` in the [project repo 10 | page](https://gitlab.com/sensmetry/public/sysml-2ls/-/settings/access_tokens). 11 | - `VSCE_PAT` - VS Code Marketplace [personal access 12 | token](https://learn.microsoft.com/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate). 13 | - `OVSX_PAT` - Open VSX [personal access 14 | token](https://open-vsx.org/user-settings/tokens). 15 | - `GH_ACCESS_TOKEN` - personal access token for our [GitHub 16 | mirror](https://github.com/sensmetry/sysml-2ls) with read and write access to 17 | contents for pushing and creating releases through API. 18 | 19 | Personal access tokens expire so they will need to be recreated from time to 20 | time. 21 | 22 | ## Triggering a Release 23 | 24 | Release workflow is triggered by running a pipeline manually on the `main` 25 | branch with `VERSION` variable from `CI/CD > Pipelines > Run pipeline`. The 26 | workflow: 27 | 28 | - Updates version fields 29 | - Extracts latest changelog 30 | - Commits the changes to the `main` branch 31 | - Creates a tag `VERSION` 32 | - Packages the plugin 33 | - Pushes the changes 34 | - Publishes the plugin: 35 | - Creates a release for `VERSION` tag 36 | - Publishes to VS Code Marketplace 37 | - Publishes to Open VSX Registry 38 | 39 | The workflow is cancelled if any of these are true: 40 | 41 | - `VERSION` is not a semantic version 42 | - `VERSION` tag already exists 43 | - `VERSION` is lower than `version` in `package.json` 44 | - latest changelog section is for a different semantic version 45 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/__tests__/kerml/root/relationships.test.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { anything, qualifiedTypeReference } from "../../../testing"; 18 | import { Dependency } from "../../../generated/ast"; 19 | 20 | test("relationships are parseable", async () => { 21 | return expect(` 22 | class <'1'> A; 23 | class <'2'> B; 24 | class <'3'> C; 25 | class <'4'> D; 26 | dependency <'5'> R from '1', D to B, C; 27 | `).toParseKerML({ 28 | children: [ 29 | ...anything(4), 30 | { 31 | target: { 32 | $type: Dependency, 33 | declaredName: "R", 34 | declaredShortName: "'5'", 35 | client: [qualifiedTypeReference("A"), qualifiedTypeReference("D")], 36 | supplier: [qualifiedTypeReference("B"), qualifiedTypeReference("C")], 37 | }, 38 | }, 39 | ], 40 | }); 41 | }); 42 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/KerML/expressions/literal-infinity.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { LiteralInfinity } from "../../../generated/ast"; 18 | import { metamodelOf } from "../../metamodel"; 19 | import { LiteralExpressionMeta, LiteralExpressionOptions } from "../_internal"; 20 | 21 | export const ImplicitLiteralInfinities = { 22 | base: "Performances::literalIntegerEvaluations", 23 | }; 24 | 25 | export type LiteralInfinityOptions = LiteralExpressionOptions; 26 | 27 | @metamodelOf(LiteralInfinity, ImplicitLiteralInfinities) 28 | export class LiteralInfinityMeta extends LiteralExpressionMeta { 29 | override ast(): LiteralInfinity | undefined { 30 | return this._ast as LiteralInfinity; 31 | } 32 | 33 | override returnType(): string { 34 | return "ScalarValues::Positive"; 35 | } 36 | } 37 | 38 | declare module "../../../generated/ast" { 39 | interface LiteralInfinity { 40 | $meta: LiteralInfinityMeta; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/SysML/view-usage.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { ViewUsage, ViewDefinition } from "../../generated/ast"; 18 | import { metamodelOf } from "../metamodel"; 19 | import { PartUsageMeta, PartUsageOptions } from "./part-usage"; 20 | 21 | export type ViewUsageOptions = PartUsageOptions; 22 | 23 | @metamodelOf(ViewUsage, { 24 | base: "Views::views", 25 | subview: "Views::View::subviews", 26 | }) 27 | export class ViewUsageMeta extends PartUsageMeta { 28 | override defaultSupertype(): string { 29 | return this.isSubview() ? "subview" : "base"; 30 | } 31 | 32 | isSubview(): boolean { 33 | const parent = this.owner(); 34 | return Boolean(parent?.isAny(ViewDefinition, ViewUsage)); 35 | } 36 | 37 | override ast(): ViewUsage | undefined { 38 | return this._ast as ViewUsage; 39 | } 40 | } 41 | 42 | declare module "../../generated/ast" { 43 | interface ViewUsage { 44 | $meta: ViewUsageMeta; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/browser/server.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { 18 | BrowserMessageReader, 19 | BrowserMessageWriter, 20 | createConnection, 21 | } from "vscode-languageserver/browser"; 22 | import { createSysMLServices } from "../sysml-module"; 23 | import { VirtualFileSystem } from "./virtual-file-system-provider"; 24 | import { startServer as _startServer } from "../launch"; 25 | 26 | declare const self: DedicatedWorkerGlobalScope; 27 | 28 | // eslint-disable-next-line @typescript-eslint/no-empty-interface 29 | export interface BrowserLaunchOptions { 30 | // empty 31 | } 32 | 33 | export function startServer(options: BrowserLaunchOptions): ReturnType { 34 | /* browser specific setup code */ 35 | const input = new BrowserMessageReader(self); 36 | const output = new BrowserMessageWriter(self); 37 | 38 | const connection = createConnection(input, output); 39 | 40 | return _startServer(connection, VirtualFileSystem, options); 41 | } 42 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/SysML/enumeration-definition.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { EnumerationDefinition } from "../../generated/ast"; 18 | import { enumerable } from "../../utils"; 19 | import { metamodelOf } from "../metamodel"; 20 | import { AttributeDefinitionMeta, AttributeDefinitionOptions } from "./attribute-definition"; 21 | 22 | export type EnumerationDefinitionOptions = AttributeDefinitionOptions; 23 | 24 | @metamodelOf(EnumerationDefinition) 25 | export class EnumerationDefinitionMeta extends AttributeDefinitionMeta { 26 | @enumerable 27 | override get isVariation(): boolean { 28 | return true; 29 | } 30 | override set isVariation(value) { 31 | // empty 32 | } 33 | 34 | override ast(): EnumerationDefinition | undefined { 35 | return this._ast as EnumerationDefinition; 36 | } 37 | } 38 | 39 | declare module "../../generated/ast" { 40 | interface EnumerationDefinition { 41 | $meta: EnumerationDefinitionMeta; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/expressions/__tests__/boolean.test.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { expectEvaluationResult } from "./util"; 18 | 19 | test.concurrent.each([ 20 | ["And", "true & false", [false]], 21 | ["And", "true & true", [true]], 22 | ["And", "false & true", [false]], 23 | ["And", "false & false", [false]], 24 | ["Or", "true | false", [true]], 25 | ["Or", "true | true", [true]], 26 | ["Or", "false | true", [true]], 27 | ["Or", "false | false", [false]], 28 | ["Xor", "true xor false", [true]], 29 | ["Xor", "true xor true", [false]], 30 | ["Xor", "false xor true", [true]], 31 | ["Xor", "false xor false", [false]], 32 | ["Not", "not true", [false]], 33 | ["Not", "not false", [true]], 34 | ])("%s (%s) can be evaluated", async (_: string, body: string, expected: unknown[]) => { 35 | await expectEvaluationResult({ 36 | text: `in feature a = ${body};`, 37 | langId: "kerml", 38 | result: expected, 39 | }); 40 | }); 41 | -------------------------------------------------------------------------------- /packages/syside-languageserver/src/model/__tests__/naming.test.ts: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (c) 2022-2025 Sensmetry UAB and others 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License 2.0 which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the Eclipse 10 | * Public License, v. 2.0 are satisfied: GNU General Public License, version 2 11 | * with the GNU Classpath Exception which is 12 | * available at https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | ********************************************************************************/ 16 | 17 | import { sanitizeName, unsanitizeName } from "../naming"; 18 | 19 | const EscapeChars = [ 20 | ["\\b", "\b"], 21 | ["\\t", "\t"], 22 | ["\\n", "\n"], 23 | ["\\f", "\f"], 24 | ["\\r", "\r"], 25 | ["\\'", "'"], 26 | ["\\\\", "\\"], 27 | // eslint-disable-next-line quotes 28 | ['\\"', '"'], 29 | ] as const; 30 | 31 | describe("names", () => { 32 | it.each(EscapeChars)("should unescape %s", (literal, unescaped) => { 33 | expect(sanitizeName(`'unrestricted ${literal} name'`)).toEqual( 34 | `unrestricted ${unescaped} name` 35 | ); 36 | }); 37 | 38 | // ignore double quotes since they can are valid even without escaping 39 | it.each(EscapeChars.slice(0, -1))("should escape %s", (literal, unescaped) => { 40 | expect(unsanitizeName(`unrestricted${unescaped} name`)).toEqual( 41 | `'unrestricted${literal} name'` 42 | ); 43 | }); 44 | }); 45 | --------------------------------------------------------------------------------