From 4c61b8c18a50fc89f193ebbbaa66ef1743db9ee0 Mon Sep 17 00:00:00 2001 From: Lars Reimann Date: Mon, 2 Oct 2023 19:50:30 +0200 Subject: [PATCH] feat: Python-like import syntax (#598) ### Summary of Changes Replace the old Java-like import syntax with a Python-like import syntax: Old: ```java import myPackage.MyDeclaration import myPackage.MyDeclaration2 as AnotherDeclaration import myPackage2.* ``` New: ```py from myPackage import MyDeclaration, MyDeclaration2 as AnotherDeclaration from myPackage2 import * ``` The new syntax has several advantages: 1. It clearly separates the package name and the declaration name. 2. When importing multiple declarations from the same package, the package name need not be repeated. 3. In a qualified import, the imported declarations are now cross-references instead of plain text. Because of this, they get updated, when the imported declaration is renamed. Xtext had special handling of the Java-style imports, but Langium does not, so it makes not difference for the implementation of the language. --------- Co-authored-by: megalinter-bot <129584137+megalinter-bot@users.noreply.github.com> --- docs/language/common/imports.md | 36 +- docs/language/common/packages.md | 2 +- package-lock.json | 644 +++++++----------- package.json | 18 +- src/language/formatting/safe-ds-formatter.ts | 24 +- src/language/grammar/safe-ds.langium | 44 +- src/language/helpers/checks.ts | 19 +- src/language/helpers/shortcuts.ts | 6 + src/language/safe-ds-module.ts | 9 +- .../scoping/safe-ds-scope-computation.ts | 4 +- .../scoping/safe-ds-scope-provider.ts | 214 ++---- src/language/validation/names.ts | 2 +- src/language/validation/other/imports.ts | 16 - src/language/validation/safe-ds-validator.ts | 2 - .../workspace/safe-ds-package-manager.ts | 203 ++++++ .../safe-ds-workspace-manager.ts | 2 +- .../workspace/safe-ds-package-manager.test.ts | 117 ++++ .../safe-ds-workspace-manager.test.ts | 0 .../comments/before imports.sdstest | 4 +- ...on call and import and declaration.sdstest | 4 +- .../annotation call and import.sdstest | 4 +- ...ge name and import and declaration.sdstest | 4 +- ...n call and package name and import.sdstest | 4 +- ...calls and imports and declarations.sdstest | 15 +- .../annotation calls and imports.sdstest | 15 +- ... name and imports and declarations.sdstest | 15 +- ...calls and package name and imports.sdstest | 15 +- .../resources/formatting/modules/full.sdstest | 15 +- .../modules/import and declaration.sdstest | 4 +- .../formatting/modules/import.sdstest | 4 +- .../modules/imports and declarations.sdstest | 15 +- .../formatting/modules/imports.sdstest | 15 +- ...ge name and import and declaration.sdstest | 4 +- .../modules/package name and import.sdstest | 4 +- ... name and imports and declarations.sdstest | 15 +- .../modules/package name and imports.sdstest | 15 +- ...claration list in qualified import.sdstest | 5 + .../good-escapedKeywords.sdstest | 2 - .../bad-annotation call after import.sdstest | 2 +- ...ll between package name and import.sdstest | 2 +- .../bad-import after declaration.sdstest | 2 +- .../bad-import without declarations.sdstest | 3 + .../bad-import without package.sdstest | 3 + .../bad-package name after import.sdstest | 2 +- ...on call and import and declaration.sdstest | 2 +- .../good-annotation call and import.sdstest | 2 +- ...ge name and import and declaration.sdstest | 2 +- ...n call and package name and import.sdstest | 2 +- ...calls and imports and declarations.sdstest | 7 +- .../good-annotation calls and imports.sdstest | 7 +- ... name and imports and declarations.sdstest | 7 +- ...calls and package name and imports.sdstest | 7 +- .../good-import and declaration.sdstest | 2 +- .../grammar/modules/good-import.sdstest | 2 +- .../good-imports and declarations.sdstest | 7 +- .../grammar/modules/good-imports.sdstest | 7 +- ...ge name and import and declaration.sdstest | 2 +- .../good-package name and import.sdstest | 2 +- ... name and imports and declarations.sdstest | 7 +- .../good-package name and imports.sdstest | 7 +- ...claration list of qualified import.sdstest | 4 + ... with imports and own declarations.sdstest | 7 +- ...with multiple imports of same name.sdstest | 6 +- ...n with qualified import with alias.sdstest | 6 +- .../main with qualified import.sdstest | 8 +- .../main with wildcard import.sdstest | 2 +- .../resource other package.sdstest | 3 + .../to annotations/main.sdstest | 26 + .../resource first package.sdstest | 7 + .../resource second package.sdstest | 14 + .../to global classes/main.sdstest | 26 + .../resource first package.sdstest | 7 + .../resource second package.sdstest | 14 + .../to global enums/main.sdstest | 26 + .../resource first package.sdstest | 7 + .../resource second package.sdstest | 14 + .../to global functions/main.sdstest | 26 + .../resource first package.sdstest | 7 + .../resource second package.sdstest | 14 + .../to nested declaration/main.sdstest | 28 + .../resource first package.sdstest | 9 + .../resource second package.sdstest | 16 + .../to pipelines/main.sdstest | 26 + .../resource first package.sdstest | 7 + .../resource second package.sdstest | 14 + .../to schemas/main.sdstest | 25 + .../to schemas/resource first package.sdstest | 7 + .../resource second package.sdstest | 14 + .../to segments/main.sdstest | 42 ++ .../resource first package.sdstest | 7 + .../to segments/resource same package.sdstest | 10 + .../resource second package.sdstest | 20 + .../unresolved/main.sdstest | 4 + ... with imports and own declarations.sdstest | 9 +- ...with multiple imports of same name.sdstest | 6 +- ...n with qualified import with alias.sdstest | 6 +- .../main with qualified import.sdstest | 10 +- .../main with wildcard import.sdstest | 2 +- .../resource other package.sdstest | 3 + ... with imports and own declarations.sdstest | 9 +- ...with multiple imports of same name.sdstest | 6 +- ...n with qualified import with alias.sdstest | 6 +- .../main with qualified import.sdstest | 10 +- .../main with wildcard import.sdstest | 2 +- .../resource other package.sdstest | 3 + ... with imports and own declarations.sdstest | 7 +- ...with multiple imports of same name.sdstest | 6 +- ...n with qualified import with alias.sdstest | 6 +- .../main with qualified import.sdstest | 8 +- .../main with wildcard import.sdstest | 2 +- .../resource other package.sdstest | 3 + ... with imports and own declarations.sdstest | 7 +- ...with multiple imports of same name.sdstest | 6 +- ...n with qualified import with alias.sdstest | 6 +- .../main with qualified import.sdstest | 8 +- .../main with wildcard import.sdstest | 2 +- .../resource other package.sdstest | 3 + ... with imports and own declarations.sdstest | 7 +- ...with multiple imports of same name.sdstest | 6 +- ...n with qualified import with alias.sdstest | 6 +- .../main with qualified import.sdstest | 8 +- .../main with wildcard import.sdstest | 2 +- .../resource other package.sdstest | 3 + ... with imports and own declarations.sdstest | 7 +- ...with multiple imports of same name.sdstest | 6 +- ...n with qualified import with alias.sdstest | 6 +- .../main with qualified import.sdstest | 8 +- .../main with wildcard import.sdstest | 2 +- .../resource other package.sdstest | 3 + ... with imports and own declarations.sdstest | 7 +- ...with multiple imports of same name.sdstest | 6 +- ...n with qualified import with alias.sdstest | 6 +- .../main with qualified import.sdstest | 8 +- .../main with wildcard import.sdstest | 2 +- .../resource other package.sdstest | 3 + ... with imports and own declarations.sdstest | 7 +- ...with multiple imports of same name.sdstest | 6 +- ...n with qualified import with alias.sdstest | 6 +- .../main with qualified import.sdstest | 8 +- .../main with wildcard import.sdstest | 2 +- .../to schemas/resource other package.sdstest | 3 + ... with imports and own declarations.sdstest | 11 +- ...with multiple imports of same name.sdstest | 6 +- ...n with qualified import with alias.sdstest | 6 +- .../main with qualified import.sdstest | 14 +- .../main with wildcard import.sdstest | 2 +- .../resource other package.sdstest | 3 + .../main.sdstest | 6 - .../pipeline file (only imports).sdspipe | 2 +- 149 files changed, 1556 insertions(+), 837 deletions(-) delete mode 100644 src/language/validation/other/imports.ts create mode 100644 src/language/workspace/safe-ds-package-manager.ts rename src/language/{builtins => workspace}/safe-ds-workspace-manager.ts (93%) create mode 100644 tests/language/workspace/safe-ds-package-manager.test.ts rename tests/language/{builtins => workspace}/safe-ds-workspace-manager.test.ts (100%) create mode 100644 tests/resources/formatting/trailing commas/imported declaration list in qualified import.sdstest create mode 100644 tests/resources/grammar/modules/bad-import without declarations.sdstest create mode 100644 tests/resources/grammar/modules/bad-import without package.sdstest create mode 100644 tests/resources/grammar/trailing commas/good-imported declaration list of qualified import.sdstest create mode 100644 tests/resources/scoping/imported declarations/to annotations/main.sdstest create mode 100644 tests/resources/scoping/imported declarations/to annotations/resource first package.sdstest create mode 100644 tests/resources/scoping/imported declarations/to annotations/resource second package.sdstest create mode 100644 tests/resources/scoping/imported declarations/to global classes/main.sdstest create mode 100644 tests/resources/scoping/imported declarations/to global classes/resource first package.sdstest create mode 100644 tests/resources/scoping/imported declarations/to global classes/resource second package.sdstest create mode 100644 tests/resources/scoping/imported declarations/to global enums/main.sdstest create mode 100644 tests/resources/scoping/imported declarations/to global enums/resource first package.sdstest create mode 100644 tests/resources/scoping/imported declarations/to global enums/resource second package.sdstest create mode 100644 tests/resources/scoping/imported declarations/to global functions/main.sdstest create mode 100644 tests/resources/scoping/imported declarations/to global functions/resource first package.sdstest create mode 100644 tests/resources/scoping/imported declarations/to global functions/resource second package.sdstest create mode 100644 tests/resources/scoping/imported declarations/to nested declaration/main.sdstest create mode 100644 tests/resources/scoping/imported declarations/to nested declaration/resource first package.sdstest create mode 100644 tests/resources/scoping/imported declarations/to nested declaration/resource second package.sdstest create mode 100644 tests/resources/scoping/imported declarations/to pipelines/main.sdstest create mode 100644 tests/resources/scoping/imported declarations/to pipelines/resource first package.sdstest create mode 100644 tests/resources/scoping/imported declarations/to pipelines/resource second package.sdstest create mode 100644 tests/resources/scoping/imported declarations/to schemas/main.sdstest create mode 100644 tests/resources/scoping/imported declarations/to schemas/resource first package.sdstest create mode 100644 tests/resources/scoping/imported declarations/to schemas/resource second package.sdstest create mode 100644 tests/resources/scoping/imported declarations/to segments/main.sdstest create mode 100644 tests/resources/scoping/imported declarations/to segments/resource first package.sdstest create mode 100644 tests/resources/scoping/imported declarations/to segments/resource same package.sdstest create mode 100644 tests/resources/scoping/imported declarations/to segments/resource second package.sdstest create mode 100644 tests/resources/scoping/imported declarations/unresolved/main.sdstest delete mode 100644 tests/resources/validation/other/imports/wildcard import must not have alias/main.sdstest diff --git a/docs/language/common/imports.md b/docs/language/common/imports.md index 2926b2e7e..77a3ca2ff 100644 --- a/docs/language/common/imports.md +++ b/docs/language/common/imports.md @@ -9,41 +9,57 @@ Safe-DS has two kinds of imports, namely a _qualified import_, which imports a s A _qualified import_ makes a single declaration available. Here is an example that imports the [class][classes] `DecisionTree` in the [package][packages] `safeds.model.regression`: ```txt -import safeds.model.regression.DecisionTree +from safeds.model.regression import DecisionTree ``` The syntax consists of the following parts: -- The keyword `import` -- The _qualified name_ of the declaration to import (here `safeds.model.regression.DecisionTree`). The qualified name can be obtained by concatenating the name of the [package][packages] that contains the declaration (i.e. `safeds.model.regression`) with the name of the declaration (i.e. `DecisionTree`). The two parts are separated by a dot. +- The keyword `from`. +- The name of the [package][packages] that contains the declaration (here `safeds.model.regression`). +- The keyword `import`. +- The name of the declaration (i.e. `DecisionTree`). -Once the declaration is imported, we can refer to it by its _simple name_. This is the last segment of the qualified name, which is the name of the declaration. Here is, for example, a [call][calls] to the constructor of the `DecisionTree` class: +Once the declaration is imported, we can refer to it by its name. Here is, for example, a [call][calls] to the constructor of the `DecisionTree` class: ```txt DecisionTree() ``` +Multiple declarations can be imported from the same package in a single import statement by separating them with commas: + +```txt +from safeds.model.regression import DecisionTree, RandomForest +``` + ### Qualified Imports with Alias Sometimes the name of the imported declaration can conflict with other declarations that are imported or that are contained in the importing file. To counter this, declarations can be imported under an alias: ```txt -import safeds.model.regression.DecisionTree as StdlibDecisionTree +from safeds.model.regression import DecisionTree as StdlibDecisionTree ``` Let us take apart the syntax: +- The keyword `from`. +- The name of the [package][packages] that contains the declaration (here `safeds.model.regression`). - The keyword `import`. -- The _qualified name_ of the declaration to import (here `safeds.model.regression.DecisionTree`). The qualified name can be obtained by concatenating the name of the [package][packages] that contains the declaration (i.e. `safeds.model.regression`) with the name of the declaration (i.e. `DecisionTree`). The two parts are separated by a dot. +- The name of the declaration (i.e. `DecisionTree`). - The keyword `as`. - The alias to use (here `StdlibDecisionTree`). This can be any combination of upper- and lowercase letters, underscores, and numbers, as long as it does not start with a number. -Afterwards, the declaration can **only** be accessed using the alias. The simple name cannot be used anymore. The next example shows how to create a new instance of the class now by invoking its constructor: +Afterwards, the declaration can **only** be accessed using the alias. The next example shows how to create a new instance of the class now by invoking its constructor: ```txt StdlibDecisionTree() ``` +Multiple declarations can be imported with or without an alias in a single import statement by separating them with commas: + +```txt +from safeds.model.regression import DecisionTree as StdlibDecisionTree, RandomForest +``` + ## Wildcard Imports We can also import all declarations in a [package][packages] with a single import. While this saves some typing, it also increases the likelihood of name conflicts and can make it harder for readers of the code to determine where a declaration comes from. Therefore, this should be used with caution. @@ -51,14 +67,14 @@ We can also import all declarations in a [package][packages] with a single impor Nevertheless, let us look at an example, which imports all declarations from the [package][packages] `safeds.model.regression`: ```txt -import safeds.model.regression.* +from safeds.model.regression import * ``` Here is the breakdown of the syntax: -- The keyword `import`. +- The keyword `from`. - The name of the [package][packages] to import (here `safeds.model.regression`). -- A dot. +- The keyword `import`. - A star. Afterwards, we can again access declarations by their simple name, such as the [class][classes] `DecisionTree`: diff --git a/docs/language/common/packages.md b/docs/language/common/packages.md index 846a24dd7..f1b8d8c5a 100644 --- a/docs/language/common/packages.md +++ b/docs/language/common/packages.md @@ -143,7 +143,7 @@ Here is a breakdown of this: ```txt // Safe-DS - import safeds.model.regression.DecisionTree + from safeds.model.regression import DecisionTree ``` It is important to note that the `@PythonModule` annotation only affects the one Safe-DS file that contains it rather than the entire Safe-DS package. This allows different Safe-DS files in the same package to point to different [Python modules][python-modules]. diff --git a/package-lock.json b/package-lock.json index 38326ebb2..29fdb980d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,31 +14,31 @@ "glob": "^10.3.10", "langium": "^2.0.2", "radash": "^11.0.0", - "true-myth": "^7.0.1", + "true-myth": "^7.1.0", "vscode-languageclient": "^9.0.1", - "vscode-languageserver": "^8.1.0", - "vscode-languageserver-types": "^3.17.3", + "vscode-languageserver": "^9.0.1", + "vscode-languageserver-types": "^3.17.5", "vscode-uri": "^3.0.7" }, "bin": { "safe-ds-cli": "bin/cli" }, "devDependencies": { - "@lars-reimann/eslint-config": "^5.1.1", + "@lars-reimann/eslint-config": "^5.1.3", "@lars-reimann/prettier-config": "^5.0.0", - "@types/node": "^18.17.3", - "@types/vscode": "^1.81.0", + "@types/node": "^18.18.1", + "@types/vscode": "^1.82.0", "@vitest/coverage-v8": "^0.34.6", - "@vitest/ui": "^0.34.3", + "@vitest/ui": "^0.34.6", "concurrently": "^8.2.1", - "esbuild": "^0.19.2", + "esbuild": "^0.19.4", "esbuild-plugin-copy": "^2.1.1", "langium-cli": "^2.0.1", "typescript": "^5.2.2", "vitest": "^0.34.6" }, "engines": { - "vscode": "^1.81.0" + "vscode": "^1.82.0" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -117,9 +117,9 @@ "integrity": "sha512-YslZMgtJUyuMbZ+aKvfF3x1f5liK4mWNxghFRv7jqRR9C3R3fAOGTTKvxXDa2Y1s9zSbcpuO0cAxDYsc9SrXoQ==" }, "node_modules/@esbuild/android-arm": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.2.tgz", - "integrity": "sha512-tM8yLeYVe7pRyAu9VMi/Q7aunpLwD139EY1S99xbQkT4/q2qa6eA4ige/WJQYdJ8GBL1K33pPFhPfPdJ/WzT8Q==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.4.tgz", + "integrity": "sha512-uBIbiYMeSsy2U0XQoOGVVcpIktjLMEKa7ryz2RLr7L/vTnANNEsPVAh4xOv7ondGz6ac1zVb0F8Jx20rQikffQ==", "cpu": [ "arm" ], @@ -133,9 +133,9 @@ } }, "node_modules/@esbuild/android-arm64": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.2.tgz", - "integrity": "sha512-lsB65vAbe90I/Qe10OjkmrdxSX4UJDjosDgb8sZUKcg3oefEuW2OT2Vozz8ef7wrJbMcmhvCC+hciF8jY/uAkw==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.4.tgz", + "integrity": "sha512-mRsi2vJsk4Bx/AFsNBqOH2fqedxn5L/moT58xgg51DjX1la64Z3Npicut2VbhvDFO26qjWtPMsVxCd80YTFVeg==", "cpu": [ "arm64" ], @@ -149,9 +149,9 @@ } }, "node_modules/@esbuild/android-x64": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.2.tgz", - "integrity": "sha512-qK/TpmHt2M/Hg82WXHRc/W/2SGo/l1thtDHZWqFq7oi24AjZ4O/CpPSu6ZuYKFkEgmZlFoa7CooAyYmuvnaG8w==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.4.tgz", + "integrity": "sha512-4iPufZ1TMOD3oBlGFqHXBpa3KFT46aLl6Vy7gwed0ZSYgHaZ/mihbYb4t7Z9etjkC9Al3ZYIoOaHrU60gcMy7g==", "cpu": [ "x64" ], @@ -165,9 +165,9 @@ } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.2.tgz", - "integrity": "sha512-Ora8JokrvrzEPEpZO18ZYXkH4asCdc1DLdcVy8TGf5eWtPO1Ie4WroEJzwI52ZGtpODy3+m0a2yEX9l+KUn0tA==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.4.tgz", + "integrity": "sha512-Lviw8EzxsVQKpbS+rSt6/6zjn9ashUZ7Tbuvc2YENgRl0yZTktGlachZ9KMJUsVjZEGFVu336kl5lBgDN6PmpA==", "cpu": [ "arm64" ], @@ -181,9 +181,9 @@ } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.2.tgz", - "integrity": "sha512-tP+B5UuIbbFMj2hQaUr6EALlHOIOmlLM2FK7jeFBobPy2ERdohI4Ka6ZFjZ1ZYsrHE/hZimGuU90jusRE0pwDw==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.4.tgz", + "integrity": "sha512-YHbSFlLgDwglFn0lAO3Zsdrife9jcQXQhgRp77YiTDja23FrC2uwnhXMNkAucthsf+Psr7sTwYEryxz6FPAVqw==", "cpu": [ "x64" ], @@ -197,9 +197,9 @@ } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.2.tgz", - "integrity": "sha512-YbPY2kc0acfzL1VPVK6EnAlig4f+l8xmq36OZkU0jzBVHcOTyQDhnKQaLzZudNJQyymd9OqQezeaBgkTGdTGeQ==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.4.tgz", + "integrity": "sha512-vz59ijyrTG22Hshaj620e5yhs2dU1WJy723ofc+KUgxVCM6zxQESmWdMuVmUzxtGqtj5heHyB44PjV/HKsEmuQ==", "cpu": [ "arm64" ], @@ -213,9 +213,9 @@ } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.2.tgz", - "integrity": "sha512-nSO5uZT2clM6hosjWHAsS15hLrwCvIWx+b2e3lZ3MwbYSaXwvfO528OF+dLjas1g3bZonciivI8qKR/Hm7IWGw==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.4.tgz", + "integrity": "sha512-3sRbQ6W5kAiVQRBWREGJNd1YE7OgzS0AmOGjDmX/qZZecq8NFlQsQH0IfXjjmD0XtUYqr64e0EKNFjMUlPL3Cw==", "cpu": [ "x64" ], @@ -229,9 +229,9 @@ } }, "node_modules/@esbuild/linux-arm": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.2.tgz", - "integrity": "sha512-Odalh8hICg7SOD7XCj0YLpYCEc+6mkoq63UnExDCiRA2wXEmGlK5JVrW50vZR9Qz4qkvqnHcpH+OFEggO3PgTg==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.4.tgz", + "integrity": "sha512-z/4ArqOo9EImzTi4b6Vq+pthLnepFzJ92BnofU1jgNlcVb+UqynVFdoXMCFreTK7FdhqAzH0vmdwW5373Hm9pg==", "cpu": [ "arm" ], @@ -245,9 +245,9 @@ } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.2.tgz", - "integrity": "sha512-ig2P7GeG//zWlU0AggA3pV1h5gdix0MA3wgB+NsnBXViwiGgY77fuN9Wr5uoCrs2YzaYfogXgsWZbm+HGr09xg==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.4.tgz", + "integrity": "sha512-ZWmWORaPbsPwmyu7eIEATFlaqm0QGt+joRE9sKcnVUG3oBbr/KYdNE2TnkzdQwX6EDRdg/x8Q4EZQTXoClUqqA==", "cpu": [ "arm64" ], @@ -261,9 +261,9 @@ } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.2.tgz", - "integrity": "sha512-mLfp0ziRPOLSTek0Gd9T5B8AtzKAkoZE70fneiiyPlSnUKKI4lp+mGEnQXcQEHLJAcIYDPSyBvsUbKUG2ri/XQ==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.4.tgz", + "integrity": "sha512-EGc4vYM7i1GRUIMqRZNCTzJh25MHePYsnQfKDexD8uPTCm9mK56NIL04LUfX2aaJ+C9vyEp2fJ7jbqFEYgO9lQ==", "cpu": [ "ia32" ], @@ -277,9 +277,9 @@ } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.2.tgz", - "integrity": "sha512-hn28+JNDTxxCpnYjdDYVMNTR3SKavyLlCHHkufHV91fkewpIyQchS1d8wSbmXhs1fiYDpNww8KTFlJ1dHsxeSw==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.4.tgz", + "integrity": "sha512-WVhIKO26kmm8lPmNrUikxSpXcgd6HDog0cx12BUfA2PkmURHSgx9G6vA19lrlQOMw+UjMZ+l3PpbtzffCxFDRg==", "cpu": [ "loong64" ], @@ -293,9 +293,9 @@ } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.2.tgz", - "integrity": "sha512-KbXaC0Sejt7vD2fEgPoIKb6nxkfYW9OmFUK9XQE4//PvGIxNIfPk1NmlHmMg6f25x57rpmEFrn1OotASYIAaTg==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.4.tgz", + "integrity": "sha512-keYY+Hlj5w86hNp5JJPuZNbvW4jql7c1eXdBUHIJGTeN/+0QFutU3GrS+c27L+NTmzi73yhtojHk+lr2+502Mw==", "cpu": [ "mips64el" ], @@ -309,9 +309,9 @@ } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.2.tgz", - "integrity": "sha512-dJ0kE8KTqbiHtA3Fc/zn7lCd7pqVr4JcT0JqOnbj4LLzYnp+7h8Qi4yjfq42ZlHfhOCM42rBh0EwHYLL6LEzcw==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.4.tgz", + "integrity": "sha512-tQ92n0WMXyEsCH4m32S21fND8VxNiVazUbU4IUGVXQpWiaAxOBvtOtbEt3cXIV3GEBydYsY8pyeRMJx9kn3rvw==", "cpu": [ "ppc64" ], @@ -325,9 +325,9 @@ } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.2.tgz", - "integrity": "sha512-7Z/jKNFufZ/bbu4INqqCN6DDlrmOTmdw6D0gH+6Y7auok2r02Ur661qPuXidPOJ+FSgbEeQnnAGgsVynfLuOEw==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.4.tgz", + "integrity": "sha512-tRRBey6fG9tqGH6V75xH3lFPpj9E8BH+N+zjSUCnFOX93kEzqS0WdyJHkta/mmJHn7MBaa++9P4ARiU4ykjhig==", "cpu": [ "riscv64" ], @@ -341,9 +341,9 @@ } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.2.tgz", - "integrity": "sha512-U+RinR6aXXABFCcAY4gSlv4CL1oOVvSSCdseQmGO66H+XyuQGZIUdhG56SZaDJQcLmrSfRmx5XZOWyCJPRqS7g==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.4.tgz", + "integrity": "sha512-152aLpQqKZYhThiJ+uAM4PcuLCAOxDsCekIbnGzPKVBRUDlgaaAfaUl5NYkB1hgY6WN4sPkejxKlANgVcGl9Qg==", "cpu": [ "s390x" ], @@ -357,9 +357,9 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.2.tgz", - "integrity": "sha512-oxzHTEv6VPm3XXNaHPyUTTte+3wGv7qVQtqaZCrgstI16gCuhNOtBXLEBkBREP57YTd68P0VgDgG73jSD8bwXQ==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.4.tgz", + "integrity": "sha512-Mi4aNA3rz1BNFtB7aGadMD0MavmzuuXNTaYL6/uiYIs08U7YMPETpgNn5oue3ICr+inKwItOwSsJDYkrE9ekVg==", "cpu": [ "x64" ], @@ -373,9 +373,9 @@ } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.2.tgz", - "integrity": "sha512-WNa5zZk1XpTTwMDompZmvQLHszDDDN7lYjEHCUmAGB83Bgs20EMs7ICD+oKeT6xt4phV4NDdSi/8OfjPbSbZfQ==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.4.tgz", + "integrity": "sha512-9+Wxx1i5N/CYo505CTT7T+ix4lVzEdz0uCoYGxM5JDVlP2YdDC1Bdz+Khv6IbqmisT0Si928eAxbmGkcbiuM/A==", "cpu": [ "x64" ], @@ -389,9 +389,9 @@ } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.2.tgz", - "integrity": "sha512-S6kI1aT3S++Dedb7vxIuUOb3oAxqxk2Rh5rOXOTYnzN8JzW1VzBd+IqPiSpgitu45042SYD3HCoEyhLKQcDFDw==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.4.tgz", + "integrity": "sha512-MFsHleM5/rWRW9EivFssop+OulYVUoVcqkyOkjiynKBCGBj9Lihl7kh9IzrreDyXa4sNkquei5/DTP4uCk25xw==", "cpu": [ "x64" ], @@ -405,9 +405,9 @@ } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.2.tgz", - "integrity": "sha512-VXSSMsmb+Z8LbsQGcBMiM+fYObDNRm8p7tkUDMPG/g4fhFX5DEFmjxIEa3N8Zr96SjsJ1woAhF0DUnS3MF3ARw==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.4.tgz", + "integrity": "sha512-6Xq8SpK46yLvrGxjp6HftkDwPP49puU4OF0hEL4dTxqCbfx09LyrbUj/D7tmIRMj5D5FCUPksBbxyQhp8tmHzw==", "cpu": [ "x64" ], @@ -421,9 +421,9 @@ } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.2.tgz", - "integrity": "sha512-5NayUlSAyb5PQYFAU9x3bHdsqB88RC3aM9lKDAz4X1mo/EchMIT1Q+pSeBXNgkfNmRecLXA0O8xP+x8V+g/LKg==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.4.tgz", + "integrity": "sha512-PkIl7Jq4mP6ke7QKwyg4fD4Xvn8PXisagV/+HntWoDEdmerB2LTukRZg728Yd1Fj+LuEX75t/hKXE2Ppk8Hh1w==", "cpu": [ "arm64" ], @@ -437,9 +437,9 @@ } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.2.tgz", - "integrity": "sha512-47gL/ek1v36iN0wL9L4Q2MFdujR0poLZMJwhO2/N3gA89jgHp4MR8DKCmwYtGNksbfJb9JoTtbkoe6sDhg2QTA==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.4.tgz", + "integrity": "sha512-ga676Hnvw7/ycdKB53qPusvsKdwrWzEyJ+AtItHGoARszIqvjffTwaaW3b2L6l90i7MO9i+dlAW415INuRhSGg==", "cpu": [ "ia32" ], @@ -453,9 +453,9 @@ } }, "node_modules/@esbuild/win32-x64": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.2.tgz", - "integrity": "sha512-tcuhV7ncXBqbt/Ybf0IyrMcwVOAPDckMK9rXNHtF17UTK18OKLpg08glminN06pt2WCoALhXdLfSPbVvK/6fxw==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.4.tgz", + "integrity": "sha512-HP0GDNla1T3ZL8Ko/SHAS2GgtjOg+VmWnnYLhuTksr++EnduYB0f3Y2LzHsUwb2iQ13JGoY6G3R8h6Du/WG6uA==", "cpu": [ "x64" ], @@ -718,9 +718,9 @@ } }, "node_modules/@lars-reimann/eslint-config": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/@lars-reimann/eslint-config/-/eslint-config-5.1.2.tgz", - "integrity": "sha512-qTEjHrZrL1eYNkcAeHrA6oduD/r4SvCPUYF1NDDw9QPGXvK3fex5CF98vMa8DYLr1edTC35G6/uZTiGEj6MTug==", + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/@lars-reimann/eslint-config/-/eslint-config-5.1.3.tgz", + "integrity": "sha512-Kzw8ksILtRzwXgWAdOuJ+06c5RuuBetqCxj2xIUYohvPSvpXPusuJzoEnXwiQcjCs6MNhaf6ZlmccB7JBe8fMw==", "dev": true, "dependencies": { "eslint-config-airbnb": "^19.0.4", @@ -839,9 +839,9 @@ "peer": true }, "node_modules/@types/node": { - "version": "18.17.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.17.3.tgz", - "integrity": "sha512-2x8HWtFk0S99zqVQABU9wTpr8wPoaDHZUcAkoTKH+nL7kPv3WUI9cRi/Kk5Mz4xdqXSqTkKP7IWNoQQYCnDsTA==", + "version": "18.18.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.1.tgz", + "integrity": "sha512-3G42sxmm0fF2+Vtb9TJQpnjmP+uKlWvFa8KoEGquh4gqRmoUG/N0ufuhikw6HEsdG2G2oIKhog1GCTfz9v5NdQ==", "dev": true }, "node_modules/@types/semver": { @@ -852,9 +852,9 @@ "peer": true }, "node_modules/@types/vscode": { - "version": "1.81.0", - "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.81.0.tgz", - "integrity": "sha512-YIaCwpT+O2E7WOMq0eCgBEABE++SX3Yl/O02GoMIF2DO3qAtvw7m6BXFYsxnc6XyzwZgh6/s/UG78LSSombl2w==", + "version": "1.82.0", + "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.82.0.tgz", + "integrity": "sha512-VSHV+VnpF8DEm8LNrn8OJ8VuUNcBzN3tMvKrNpbhhfuVjFm82+6v44AbDhLvVFgCzn6vs94EJNTp7w8S6+Q1Rw==", "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { @@ -1142,20 +1142,6 @@ "url": "https://opencollective.com/vitest" } }, - "node_modules/@vitest/expect/node_modules/@vitest/utils": { - "version": "0.34.6", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-0.34.6.tgz", - "integrity": "sha512-IG5aDD8S6zlvloDsnzHw0Ut5xczlF+kv2BOTo+iXfPr54Yhi5qbVOgGB1hZaVq4iJ4C/MZ2J0y15IlsV/ZcI0A==", - "dev": true, - "dependencies": { - "diff-sequences": "^29.4.3", - "loupe": "^2.3.6", - "pretty-format": "^29.5.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, "node_modules/@vitest/runner": { "version": "0.34.6", "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-0.34.6.tgz", @@ -1170,20 +1156,6 @@ "url": "https://opencollective.com/vitest" } }, - "node_modules/@vitest/runner/node_modules/@vitest/utils": { - "version": "0.34.6", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-0.34.6.tgz", - "integrity": "sha512-IG5aDD8S6zlvloDsnzHw0Ut5xczlF+kv2BOTo+iXfPr54Yhi5qbVOgGB1hZaVq4iJ4C/MZ2J0y15IlsV/ZcI0A==", - "dev": true, - "dependencies": { - "diff-sequences": "^29.4.3", - "loupe": "^2.3.6", - "pretty-format": "^29.5.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, "node_modules/@vitest/snapshot": { "version": "0.34.6", "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-0.34.6.tgz", @@ -1211,12 +1183,12 @@ } }, "node_modules/@vitest/ui": { - "version": "0.34.3", - "resolved": "https://registry.npmjs.org/@vitest/ui/-/ui-0.34.3.tgz", - "integrity": "sha512-iNcOQ0xML9znOReiwpKJrTLSj5zFxmveD3VCxIJNqnsaMYpONSbSiiJLC1Y1dYlkmiHylp+ElNcUZYIMWdxRvA==", + "version": "0.34.6", + "resolved": "https://registry.npmjs.org/@vitest/ui/-/ui-0.34.6.tgz", + "integrity": "sha512-/fxnCwGC0Txmr3tF3BwAbo3v6U2SkBTGR9UB8zo0Ztlx0BTOXHucE0gDHY7SjwEktCOHatiGmli9kZD6gYSoWQ==", "dev": true, "dependencies": { - "@vitest/utils": "0.34.3", + "@vitest/utils": "0.34.6", "fast-glob": "^3.3.0", "fflate": "^0.8.0", "flatted": "^3.2.7", @@ -1232,9 +1204,9 @@ } }, "node_modules/@vitest/utils": { - "version": "0.34.3", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-0.34.3.tgz", - "integrity": "sha512-kiSnzLG6m/tiT0XEl4U2H8JDBjFtwVlaE8I3QfGiMFR0QvnRDfYfdP3YvTBWM/6iJDAyaPY6yVQiCTUc7ZzTHA==", + "version": "0.34.6", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-0.34.6.tgz", + "integrity": "sha512-IG5aDD8S6zlvloDsnzHw0Ut5xczlF+kv2BOTo+iXfPr54Yhi5qbVOgGB1hZaVq4iJ4C/MZ2J0y15IlsV/ZcI0A==", "dev": true, "dependencies": { "diff-sequences": "^29.4.3", @@ -2036,9 +2008,9 @@ } }, "node_modules/esbuild": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.2.tgz", - "integrity": "sha512-G6hPax8UbFakEj3hWO0Vs52LQ8k3lnBhxZWomUJDxfz3rZTLqF5k/FCzuNdLx2RbpBiQQF9H9onlDDH1lZsnjg==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.4.tgz", + "integrity": "sha512-x7jL0tbRRpv4QUyuDMjONtWFciygUxWaUM1kMX2zWxI0X2YWOt7MSA0g4UdeSiHM8fcYVzpQhKYOycZwxTdZkA==", "dev": true, "hasInstallScript": true, "bin": { @@ -2048,28 +2020,28 @@ "node": ">=12" }, "optionalDependencies": { - "@esbuild/android-arm": "0.19.2", - "@esbuild/android-arm64": "0.19.2", - "@esbuild/android-x64": "0.19.2", - "@esbuild/darwin-arm64": "0.19.2", - "@esbuild/darwin-x64": "0.19.2", - "@esbuild/freebsd-arm64": "0.19.2", - "@esbuild/freebsd-x64": "0.19.2", - "@esbuild/linux-arm": "0.19.2", - "@esbuild/linux-arm64": "0.19.2", - "@esbuild/linux-ia32": "0.19.2", - "@esbuild/linux-loong64": "0.19.2", - "@esbuild/linux-mips64el": "0.19.2", - "@esbuild/linux-ppc64": "0.19.2", - "@esbuild/linux-riscv64": "0.19.2", - "@esbuild/linux-s390x": "0.19.2", - "@esbuild/linux-x64": "0.19.2", - "@esbuild/netbsd-x64": "0.19.2", - "@esbuild/openbsd-x64": "0.19.2", - "@esbuild/sunos-x64": "0.19.2", - "@esbuild/win32-arm64": "0.19.2", - "@esbuild/win32-ia32": "0.19.2", - "@esbuild/win32-x64": "0.19.2" + "@esbuild/android-arm": "0.19.4", + "@esbuild/android-arm64": "0.19.4", + "@esbuild/android-x64": "0.19.4", + "@esbuild/darwin-arm64": "0.19.4", + "@esbuild/darwin-x64": "0.19.4", + "@esbuild/freebsd-arm64": "0.19.4", + "@esbuild/freebsd-x64": "0.19.4", + "@esbuild/linux-arm": "0.19.4", + "@esbuild/linux-arm64": "0.19.4", + "@esbuild/linux-ia32": "0.19.4", + "@esbuild/linux-loong64": "0.19.4", + "@esbuild/linux-mips64el": "0.19.4", + "@esbuild/linux-ppc64": "0.19.4", + "@esbuild/linux-riscv64": "0.19.4", + "@esbuild/linux-s390x": "0.19.4", + "@esbuild/linux-x64": "0.19.4", + "@esbuild/netbsd-x64": "0.19.4", + "@esbuild/openbsd-x64": "0.19.4", + "@esbuild/sunos-x64": "0.19.4", + "@esbuild/win32-arm64": "0.19.4", + "@esbuild/win32-ia32": "0.19.4", + "@esbuild/win32-x64": "0.19.4" } }, "node_modules/esbuild-plugin-copy": { @@ -5214,9 +5186,9 @@ } }, "node_modules/true-myth": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/true-myth/-/true-myth-7.0.1.tgz", - "integrity": "sha512-YYZ6Ev437+GuuPU1rfwwVw8n13BRYfG1U79uk4xy3XIxalICOujTE/EbD/l82RQ3t9Kam+1znJuFd6Qoyj6yYQ==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/true-myth/-/true-myth-7.1.0.tgz", + "integrity": "sha512-DcdyFRHfNyG31HgNtxqrVAHmBf7y1w4YZCpU7IR2Ohytm4LITv+u075Vc3dLyK9cdEPq6K9398iao6YpkU8hHA==", "engines": { "node": "18.* || >= 20.*" } @@ -5981,24 +5953,10 @@ } } }, - "node_modules/vitest/node_modules/@vitest/utils": { - "version": "0.34.6", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-0.34.6.tgz", - "integrity": "sha512-IG5aDD8S6zlvloDsnzHw0Ut5xczlF+kv2BOTo+iXfPr54Yhi5qbVOgGB1hZaVq4iJ4C/MZ2J0y15IlsV/ZcI0A==", - "dev": true, - "dependencies": { - "diff-sequences": "^29.4.3", - "loupe": "^2.3.6", - "pretty-format": "^29.5.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, "node_modules/vscode-jsonrpc": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.1.0.tgz", - "integrity": "sha512-6TDy/abTQk+zDGYazgbIPc+4JoXdwC8NHU9Pbn4UJP1fehUyZmM4RHp5IthX7A6L5KS30PRui+j+tbbMMMafdw==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.2.0.tgz", + "integrity": "sha512-C+r0eKJUIfiDIfwJhria30+TYWPtuHJXHtI7J0YlOmKAo7ogxP20T0zxB7HZQIFhIyvoBPwWskjxrvAtfjyZfA==", "engines": { "node": ">=14.0.0" } @@ -6035,46 +5993,24 @@ "node": ">=10" } }, - "node_modules/vscode-languageclient/node_modules/vscode-jsonrpc": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.2.0.tgz", - "integrity": "sha512-C+r0eKJUIfiDIfwJhria30+TYWPtuHJXHtI7J0YlOmKAo7ogxP20T0zxB7HZQIFhIyvoBPwWskjxrvAtfjyZfA==", - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/vscode-languageclient/node_modules/vscode-languageserver-protocol": { - "version": "3.17.5", - "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.5.tgz", - "integrity": "sha512-mb1bvRJN8SVznADSGWM9u/b07H7Ecg0I3OgXDuLdn307rl/J3A9YD6/eYOssqhecL27hK1IPZAsaqh00i/Jljg==", - "dependencies": { - "vscode-jsonrpc": "8.2.0", - "vscode-languageserver-types": "3.17.5" - } - }, - "node_modules/vscode-languageclient/node_modules/vscode-languageserver-types": { - "version": "3.17.5", - "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz", - "integrity": "sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg==" - }, "node_modules/vscode-languageserver": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-8.1.0.tgz", - "integrity": "sha512-eUt8f1z2N2IEUDBsKaNapkz7jl5QpskN2Y0G01T/ItMxBxw1fJwvtySGB9QMecatne8jFIWJGWI61dWjyTLQsw==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-9.0.1.tgz", + "integrity": "sha512-woByF3PDpkHFUreUa7Hos7+pUWdeWMXRd26+ZX2A8cFx6v/JPTtd4/uN0/jB6XQHYaOlHbio03NTHCqrgG5n7g==", "dependencies": { - "vscode-languageserver-protocol": "3.17.3" + "vscode-languageserver-protocol": "3.17.5" }, "bin": { "installServerIntoExtension": "bin/installServerIntoExtension" } }, "node_modules/vscode-languageserver-protocol": { - "version": "3.17.3", - "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.3.tgz", - "integrity": "sha512-924/h0AqsMtA5yK22GgMtCYiMdCOtWTSGgUOkgEDX+wk2b0x4sAfLiO4NxBxqbiVtz7K7/1/RgVrVI0NClZwqA==", + "version": "3.17.5", + "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.5.tgz", + "integrity": "sha512-mb1bvRJN8SVznADSGWM9u/b07H7Ecg0I3OgXDuLdn307rl/J3A9YD6/eYOssqhecL27hK1IPZAsaqh00i/Jljg==", "dependencies": { - "vscode-jsonrpc": "8.1.0", - "vscode-languageserver-types": "3.17.3" + "vscode-jsonrpc": "8.2.0", + "vscode-languageserver-types": "3.17.5" } }, "node_modules/vscode-languageserver-textdocument": { @@ -6083,9 +6019,9 @@ "integrity": "sha512-1bonkGqQs5/fxGT5UchTgjGVnfysL0O8v1AYMBjqTbWQTFn721zaPGDYFkOKtfDgFiSgXM3KwaG3FMGfW4Ed9Q==" }, "node_modules/vscode-languageserver-types": { - "version": "3.17.3", - "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.3.tgz", - "integrity": "sha512-SYU4z1dL0PyIMd4Vj8YOqFvHu7Hz/enbWtpfnVbJHU4Nd1YNYx8u0ennumc6h48GQNeOLxmwySmnADouT/AuZA==" + "version": "3.17.5", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz", + "integrity": "sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg==" }, "node_modules/vscode-uri": { "version": "3.0.7", @@ -6333,156 +6269,156 @@ "integrity": "sha512-YslZMgtJUyuMbZ+aKvfF3x1f5liK4mWNxghFRv7jqRR9C3R3fAOGTTKvxXDa2Y1s9zSbcpuO0cAxDYsc9SrXoQ==" }, "@esbuild/android-arm": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.2.tgz", - "integrity": "sha512-tM8yLeYVe7pRyAu9VMi/Q7aunpLwD139EY1S99xbQkT4/q2qa6eA4ige/WJQYdJ8GBL1K33pPFhPfPdJ/WzT8Q==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.4.tgz", + "integrity": "sha512-uBIbiYMeSsy2U0XQoOGVVcpIktjLMEKa7ryz2RLr7L/vTnANNEsPVAh4xOv7ondGz6ac1zVb0F8Jx20rQikffQ==", "dev": true, "optional": true }, "@esbuild/android-arm64": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.2.tgz", - "integrity": "sha512-lsB65vAbe90I/Qe10OjkmrdxSX4UJDjosDgb8sZUKcg3oefEuW2OT2Vozz8ef7wrJbMcmhvCC+hciF8jY/uAkw==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.4.tgz", + "integrity": "sha512-mRsi2vJsk4Bx/AFsNBqOH2fqedxn5L/moT58xgg51DjX1la64Z3Npicut2VbhvDFO26qjWtPMsVxCd80YTFVeg==", "dev": true, "optional": true }, "@esbuild/android-x64": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.2.tgz", - "integrity": "sha512-qK/TpmHt2M/Hg82WXHRc/W/2SGo/l1thtDHZWqFq7oi24AjZ4O/CpPSu6ZuYKFkEgmZlFoa7CooAyYmuvnaG8w==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.4.tgz", + "integrity": "sha512-4iPufZ1TMOD3oBlGFqHXBpa3KFT46aLl6Vy7gwed0ZSYgHaZ/mihbYb4t7Z9etjkC9Al3ZYIoOaHrU60gcMy7g==", "dev": true, "optional": true }, "@esbuild/darwin-arm64": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.2.tgz", - "integrity": "sha512-Ora8JokrvrzEPEpZO18ZYXkH4asCdc1DLdcVy8TGf5eWtPO1Ie4WroEJzwI52ZGtpODy3+m0a2yEX9l+KUn0tA==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.4.tgz", + "integrity": "sha512-Lviw8EzxsVQKpbS+rSt6/6zjn9ashUZ7Tbuvc2YENgRl0yZTktGlachZ9KMJUsVjZEGFVu336kl5lBgDN6PmpA==", "dev": true, "optional": true }, "@esbuild/darwin-x64": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.2.tgz", - "integrity": "sha512-tP+B5UuIbbFMj2hQaUr6EALlHOIOmlLM2FK7jeFBobPy2ERdohI4Ka6ZFjZ1ZYsrHE/hZimGuU90jusRE0pwDw==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.4.tgz", + "integrity": "sha512-YHbSFlLgDwglFn0lAO3Zsdrife9jcQXQhgRp77YiTDja23FrC2uwnhXMNkAucthsf+Psr7sTwYEryxz6FPAVqw==", "dev": true, "optional": true }, "@esbuild/freebsd-arm64": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.2.tgz", - "integrity": "sha512-YbPY2kc0acfzL1VPVK6EnAlig4f+l8xmq36OZkU0jzBVHcOTyQDhnKQaLzZudNJQyymd9OqQezeaBgkTGdTGeQ==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.4.tgz", + "integrity": "sha512-vz59ijyrTG22Hshaj620e5yhs2dU1WJy723ofc+KUgxVCM6zxQESmWdMuVmUzxtGqtj5heHyB44PjV/HKsEmuQ==", "dev": true, "optional": true }, "@esbuild/freebsd-x64": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.2.tgz", - "integrity": "sha512-nSO5uZT2clM6hosjWHAsS15hLrwCvIWx+b2e3lZ3MwbYSaXwvfO528OF+dLjas1g3bZonciivI8qKR/Hm7IWGw==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.4.tgz", + "integrity": "sha512-3sRbQ6W5kAiVQRBWREGJNd1YE7OgzS0AmOGjDmX/qZZecq8NFlQsQH0IfXjjmD0XtUYqr64e0EKNFjMUlPL3Cw==", "dev": true, "optional": true }, "@esbuild/linux-arm": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.2.tgz", - "integrity": "sha512-Odalh8hICg7SOD7XCj0YLpYCEc+6mkoq63UnExDCiRA2wXEmGlK5JVrW50vZR9Qz4qkvqnHcpH+OFEggO3PgTg==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.4.tgz", + "integrity": "sha512-z/4ArqOo9EImzTi4b6Vq+pthLnepFzJ92BnofU1jgNlcVb+UqynVFdoXMCFreTK7FdhqAzH0vmdwW5373Hm9pg==", "dev": true, "optional": true }, "@esbuild/linux-arm64": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.2.tgz", - "integrity": "sha512-ig2P7GeG//zWlU0AggA3pV1h5gdix0MA3wgB+NsnBXViwiGgY77fuN9Wr5uoCrs2YzaYfogXgsWZbm+HGr09xg==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.4.tgz", + "integrity": "sha512-ZWmWORaPbsPwmyu7eIEATFlaqm0QGt+joRE9sKcnVUG3oBbr/KYdNE2TnkzdQwX6EDRdg/x8Q4EZQTXoClUqqA==", "dev": true, "optional": true }, "@esbuild/linux-ia32": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.2.tgz", - "integrity": "sha512-mLfp0ziRPOLSTek0Gd9T5B8AtzKAkoZE70fneiiyPlSnUKKI4lp+mGEnQXcQEHLJAcIYDPSyBvsUbKUG2ri/XQ==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.4.tgz", + "integrity": "sha512-EGc4vYM7i1GRUIMqRZNCTzJh25MHePYsnQfKDexD8uPTCm9mK56NIL04LUfX2aaJ+C9vyEp2fJ7jbqFEYgO9lQ==", "dev": true, "optional": true }, "@esbuild/linux-loong64": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.2.tgz", - "integrity": "sha512-hn28+JNDTxxCpnYjdDYVMNTR3SKavyLlCHHkufHV91fkewpIyQchS1d8wSbmXhs1fiYDpNww8KTFlJ1dHsxeSw==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.4.tgz", + "integrity": "sha512-WVhIKO26kmm8lPmNrUikxSpXcgd6HDog0cx12BUfA2PkmURHSgx9G6vA19lrlQOMw+UjMZ+l3PpbtzffCxFDRg==", "dev": true, "optional": true }, "@esbuild/linux-mips64el": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.2.tgz", - "integrity": "sha512-KbXaC0Sejt7vD2fEgPoIKb6nxkfYW9OmFUK9XQE4//PvGIxNIfPk1NmlHmMg6f25x57rpmEFrn1OotASYIAaTg==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.4.tgz", + "integrity": "sha512-keYY+Hlj5w86hNp5JJPuZNbvW4jql7c1eXdBUHIJGTeN/+0QFutU3GrS+c27L+NTmzi73yhtojHk+lr2+502Mw==", "dev": true, "optional": true }, "@esbuild/linux-ppc64": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.2.tgz", - "integrity": "sha512-dJ0kE8KTqbiHtA3Fc/zn7lCd7pqVr4JcT0JqOnbj4LLzYnp+7h8Qi4yjfq42ZlHfhOCM42rBh0EwHYLL6LEzcw==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.4.tgz", + "integrity": "sha512-tQ92n0WMXyEsCH4m32S21fND8VxNiVazUbU4IUGVXQpWiaAxOBvtOtbEt3cXIV3GEBydYsY8pyeRMJx9kn3rvw==", "dev": true, "optional": true }, "@esbuild/linux-riscv64": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.2.tgz", - "integrity": "sha512-7Z/jKNFufZ/bbu4INqqCN6DDlrmOTmdw6D0gH+6Y7auok2r02Ur661qPuXidPOJ+FSgbEeQnnAGgsVynfLuOEw==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.4.tgz", + "integrity": "sha512-tRRBey6fG9tqGH6V75xH3lFPpj9E8BH+N+zjSUCnFOX93kEzqS0WdyJHkta/mmJHn7MBaa++9P4ARiU4ykjhig==", "dev": true, "optional": true }, "@esbuild/linux-s390x": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.2.tgz", - "integrity": "sha512-U+RinR6aXXABFCcAY4gSlv4CL1oOVvSSCdseQmGO66H+XyuQGZIUdhG56SZaDJQcLmrSfRmx5XZOWyCJPRqS7g==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.4.tgz", + "integrity": "sha512-152aLpQqKZYhThiJ+uAM4PcuLCAOxDsCekIbnGzPKVBRUDlgaaAfaUl5NYkB1hgY6WN4sPkejxKlANgVcGl9Qg==", "dev": true, "optional": true }, "@esbuild/linux-x64": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.2.tgz", - "integrity": "sha512-oxzHTEv6VPm3XXNaHPyUTTte+3wGv7qVQtqaZCrgstI16gCuhNOtBXLEBkBREP57YTd68P0VgDgG73jSD8bwXQ==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.4.tgz", + "integrity": "sha512-Mi4aNA3rz1BNFtB7aGadMD0MavmzuuXNTaYL6/uiYIs08U7YMPETpgNn5oue3ICr+inKwItOwSsJDYkrE9ekVg==", "dev": true, "optional": true }, "@esbuild/netbsd-x64": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.2.tgz", - "integrity": "sha512-WNa5zZk1XpTTwMDompZmvQLHszDDDN7lYjEHCUmAGB83Bgs20EMs7ICD+oKeT6xt4phV4NDdSi/8OfjPbSbZfQ==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.4.tgz", + "integrity": "sha512-9+Wxx1i5N/CYo505CTT7T+ix4lVzEdz0uCoYGxM5JDVlP2YdDC1Bdz+Khv6IbqmisT0Si928eAxbmGkcbiuM/A==", "dev": true, "optional": true }, "@esbuild/openbsd-x64": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.2.tgz", - "integrity": "sha512-S6kI1aT3S++Dedb7vxIuUOb3oAxqxk2Rh5rOXOTYnzN8JzW1VzBd+IqPiSpgitu45042SYD3HCoEyhLKQcDFDw==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.4.tgz", + "integrity": "sha512-MFsHleM5/rWRW9EivFssop+OulYVUoVcqkyOkjiynKBCGBj9Lihl7kh9IzrreDyXa4sNkquei5/DTP4uCk25xw==", "dev": true, "optional": true }, "@esbuild/sunos-x64": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.2.tgz", - "integrity": "sha512-VXSSMsmb+Z8LbsQGcBMiM+fYObDNRm8p7tkUDMPG/g4fhFX5DEFmjxIEa3N8Zr96SjsJ1woAhF0DUnS3MF3ARw==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.4.tgz", + "integrity": "sha512-6Xq8SpK46yLvrGxjp6HftkDwPP49puU4OF0hEL4dTxqCbfx09LyrbUj/D7tmIRMj5D5FCUPksBbxyQhp8tmHzw==", "dev": true, "optional": true }, "@esbuild/win32-arm64": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.2.tgz", - "integrity": "sha512-5NayUlSAyb5PQYFAU9x3bHdsqB88RC3aM9lKDAz4X1mo/EchMIT1Q+pSeBXNgkfNmRecLXA0O8xP+x8V+g/LKg==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.4.tgz", + "integrity": "sha512-PkIl7Jq4mP6ke7QKwyg4fD4Xvn8PXisagV/+HntWoDEdmerB2LTukRZg728Yd1Fj+LuEX75t/hKXE2Ppk8Hh1w==", "dev": true, "optional": true }, "@esbuild/win32-ia32": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.2.tgz", - "integrity": "sha512-47gL/ek1v36iN0wL9L4Q2MFdujR0poLZMJwhO2/N3gA89jgHp4MR8DKCmwYtGNksbfJb9JoTtbkoe6sDhg2QTA==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.4.tgz", + "integrity": "sha512-ga676Hnvw7/ycdKB53qPusvsKdwrWzEyJ+AtItHGoARszIqvjffTwaaW3b2L6l90i7MO9i+dlAW415INuRhSGg==", "dev": true, "optional": true }, "@esbuild/win32-x64": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.2.tgz", - "integrity": "sha512-tcuhV7ncXBqbt/Ybf0IyrMcwVOAPDckMK9rXNHtF17UTK18OKLpg08glminN06pt2WCoALhXdLfSPbVvK/6fxw==", + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.4.tgz", + "integrity": "sha512-HP0GDNla1T3ZL8Ko/SHAS2GgtjOg+VmWnnYLhuTksr++EnduYB0f3Y2LzHsUwb2iQ13JGoY6G3R8h6Du/WG6uA==", "dev": true, "optional": true }, @@ -6662,9 +6598,9 @@ } }, "@lars-reimann/eslint-config": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/@lars-reimann/eslint-config/-/eslint-config-5.1.2.tgz", - "integrity": "sha512-qTEjHrZrL1eYNkcAeHrA6oduD/r4SvCPUYF1NDDw9QPGXvK3fex5CF98vMa8DYLr1edTC35G6/uZTiGEj6MTug==", + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/@lars-reimann/eslint-config/-/eslint-config-5.1.3.tgz", + "integrity": "sha512-Kzw8ksILtRzwXgWAdOuJ+06c5RuuBetqCxj2xIUYohvPSvpXPusuJzoEnXwiQcjCs6MNhaf6ZlmccB7JBe8fMw==", "dev": true, "requires": { "eslint-config-airbnb": "^19.0.4", @@ -6759,9 +6695,9 @@ "peer": true }, "@types/node": { - "version": "18.17.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.17.3.tgz", - "integrity": "sha512-2x8HWtFk0S99zqVQABU9wTpr8wPoaDHZUcAkoTKH+nL7kPv3WUI9cRi/Kk5Mz4xdqXSqTkKP7IWNoQQYCnDsTA==", + "version": "18.18.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.1.tgz", + "integrity": "sha512-3G42sxmm0fF2+Vtb9TJQpnjmP+uKlWvFa8KoEGquh4gqRmoUG/N0ufuhikw6HEsdG2G2oIKhog1GCTfz9v5NdQ==", "dev": true }, "@types/semver": { @@ -6772,9 +6708,9 @@ "peer": true }, "@types/vscode": { - "version": "1.81.0", - "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.81.0.tgz", - "integrity": "sha512-YIaCwpT+O2E7WOMq0eCgBEABE++SX3Yl/O02GoMIF2DO3qAtvw7m6BXFYsxnc6XyzwZgh6/s/UG78LSSombl2w==", + "version": "1.82.0", + "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.82.0.tgz", + "integrity": "sha512-VSHV+VnpF8DEm8LNrn8OJ8VuUNcBzN3tMvKrNpbhhfuVjFm82+6v44AbDhLvVFgCzn6vs94EJNTp7w8S6+Q1Rw==", "dev": true }, "@typescript-eslint/eslint-plugin": { @@ -6950,19 +6886,6 @@ "@vitest/spy": "0.34.6", "@vitest/utils": "0.34.6", "chai": "^4.3.10" - }, - "dependencies": { - "@vitest/utils": { - "version": "0.34.6", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-0.34.6.tgz", - "integrity": "sha512-IG5aDD8S6zlvloDsnzHw0Ut5xczlF+kv2BOTo+iXfPr54Yhi5qbVOgGB1hZaVq4iJ4C/MZ2J0y15IlsV/ZcI0A==", - "dev": true, - "requires": { - "diff-sequences": "^29.4.3", - "loupe": "^2.3.6", - "pretty-format": "^29.5.0" - } - } } }, "@vitest/runner": { @@ -6974,19 +6897,6 @@ "@vitest/utils": "0.34.6", "p-limit": "^4.0.0", "pathe": "^1.1.1" - }, - "dependencies": { - "@vitest/utils": { - "version": "0.34.6", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-0.34.6.tgz", - "integrity": "sha512-IG5aDD8S6zlvloDsnzHw0Ut5xczlF+kv2BOTo+iXfPr54Yhi5qbVOgGB1hZaVq4iJ4C/MZ2J0y15IlsV/ZcI0A==", - "dev": true, - "requires": { - "diff-sequences": "^29.4.3", - "loupe": "^2.3.6", - "pretty-format": "^29.5.0" - } - } } }, "@vitest/snapshot": { @@ -7010,12 +6920,12 @@ } }, "@vitest/ui": { - "version": "0.34.3", - "resolved": "https://registry.npmjs.org/@vitest/ui/-/ui-0.34.3.tgz", - "integrity": "sha512-iNcOQ0xML9znOReiwpKJrTLSj5zFxmveD3VCxIJNqnsaMYpONSbSiiJLC1Y1dYlkmiHylp+ElNcUZYIMWdxRvA==", + "version": "0.34.6", + "resolved": "https://registry.npmjs.org/@vitest/ui/-/ui-0.34.6.tgz", + "integrity": "sha512-/fxnCwGC0Txmr3tF3BwAbo3v6U2SkBTGR9UB8zo0Ztlx0BTOXHucE0gDHY7SjwEktCOHatiGmli9kZD6gYSoWQ==", "dev": true, "requires": { - "@vitest/utils": "0.34.3", + "@vitest/utils": "0.34.6", "fast-glob": "^3.3.0", "fflate": "^0.8.0", "flatted": "^3.2.7", @@ -7025,9 +6935,9 @@ } }, "@vitest/utils": { - "version": "0.34.3", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-0.34.3.tgz", - "integrity": "sha512-kiSnzLG6m/tiT0XEl4U2H8JDBjFtwVlaE8I3QfGiMFR0QvnRDfYfdP3YvTBWM/6iJDAyaPY6yVQiCTUc7ZzTHA==", + "version": "0.34.6", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-0.34.6.tgz", + "integrity": "sha512-IG5aDD8S6zlvloDsnzHw0Ut5xczlF+kv2BOTo+iXfPr54Yhi5qbVOgGB1hZaVq4iJ4C/MZ2J0y15IlsV/ZcI0A==", "dev": true, "requires": { "diff-sequences": "^29.4.3", @@ -7629,33 +7539,33 @@ } }, "esbuild": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.2.tgz", - "integrity": "sha512-G6hPax8UbFakEj3hWO0Vs52LQ8k3lnBhxZWomUJDxfz3rZTLqF5k/FCzuNdLx2RbpBiQQF9H9onlDDH1lZsnjg==", - "dev": true, - "requires": { - "@esbuild/android-arm": "0.19.2", - "@esbuild/android-arm64": "0.19.2", - "@esbuild/android-x64": "0.19.2", - "@esbuild/darwin-arm64": "0.19.2", - "@esbuild/darwin-x64": "0.19.2", - "@esbuild/freebsd-arm64": "0.19.2", - "@esbuild/freebsd-x64": "0.19.2", - "@esbuild/linux-arm": "0.19.2", - "@esbuild/linux-arm64": "0.19.2", - "@esbuild/linux-ia32": "0.19.2", - "@esbuild/linux-loong64": "0.19.2", - "@esbuild/linux-mips64el": "0.19.2", - "@esbuild/linux-ppc64": "0.19.2", - "@esbuild/linux-riscv64": "0.19.2", - "@esbuild/linux-s390x": "0.19.2", - "@esbuild/linux-x64": "0.19.2", - "@esbuild/netbsd-x64": "0.19.2", - "@esbuild/openbsd-x64": "0.19.2", - "@esbuild/sunos-x64": "0.19.2", - "@esbuild/win32-arm64": "0.19.2", - "@esbuild/win32-ia32": "0.19.2", - "@esbuild/win32-x64": "0.19.2" + "version": "0.19.4", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.4.tgz", + "integrity": "sha512-x7jL0tbRRpv4QUyuDMjONtWFciygUxWaUM1kMX2zWxI0X2YWOt7MSA0g4UdeSiHM8fcYVzpQhKYOycZwxTdZkA==", + "dev": true, + "requires": { + "@esbuild/android-arm": "0.19.4", + "@esbuild/android-arm64": "0.19.4", + "@esbuild/android-x64": "0.19.4", + "@esbuild/darwin-arm64": "0.19.4", + "@esbuild/darwin-x64": "0.19.4", + "@esbuild/freebsd-arm64": "0.19.4", + "@esbuild/freebsd-x64": "0.19.4", + "@esbuild/linux-arm": "0.19.4", + "@esbuild/linux-arm64": "0.19.4", + "@esbuild/linux-ia32": "0.19.4", + "@esbuild/linux-loong64": "0.19.4", + "@esbuild/linux-mips64el": "0.19.4", + "@esbuild/linux-ppc64": "0.19.4", + "@esbuild/linux-riscv64": "0.19.4", + "@esbuild/linux-s390x": "0.19.4", + "@esbuild/linux-x64": "0.19.4", + "@esbuild/netbsd-x64": "0.19.4", + "@esbuild/openbsd-x64": "0.19.4", + "@esbuild/sunos-x64": "0.19.4", + "@esbuild/win32-arm64": "0.19.4", + "@esbuild/win32-ia32": "0.19.4", + "@esbuild/win32-x64": "0.19.4" } }, "esbuild-plugin-copy": { @@ -9952,9 +9862,9 @@ "dev": true }, "true-myth": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/true-myth/-/true-myth-7.0.1.tgz", - "integrity": "sha512-YYZ6Ev437+GuuPU1rfwwVw8n13BRYfG1U79uk4xy3XIxalICOujTE/EbD/l82RQ3t9Kam+1znJuFd6Qoyj6yYQ==" + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/true-myth/-/true-myth-7.1.0.tgz", + "integrity": "sha512-DcdyFRHfNyG31HgNtxqrVAHmBf7y1w4YZCpU7IR2Ohytm4LITv+u075Vc3dLyK9cdEPq6K9398iao6YpkU8hHA==" }, "ts-api-utils": { "version": "1.0.1", @@ -10357,25 +10267,12 @@ "vite": "^3.1.0 || ^4.0.0 || ^5.0.0-0", "vite-node": "0.34.6", "why-is-node-running": "^2.2.2" - }, - "dependencies": { - "@vitest/utils": { - "version": "0.34.6", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-0.34.6.tgz", - "integrity": "sha512-IG5aDD8S6zlvloDsnzHw0Ut5xczlF+kv2BOTo+iXfPr54Yhi5qbVOgGB1hZaVq4iJ4C/MZ2J0y15IlsV/ZcI0A==", - "dev": true, - "requires": { - "diff-sequences": "^29.4.3", - "loupe": "^2.3.6", - "pretty-format": "^29.5.0" - } - } } }, "vscode-jsonrpc": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.1.0.tgz", - "integrity": "sha512-6TDy/abTQk+zDGYazgbIPc+4JoXdwC8NHU9Pbn4UJP1fehUyZmM4RHp5IthX7A6L5KS30PRui+j+tbbMMMafdw==" + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.2.0.tgz", + "integrity": "sha512-C+r0eKJUIfiDIfwJhria30+TYWPtuHJXHtI7J0YlOmKAo7ogxP20T0zxB7HZQIFhIyvoBPwWskjxrvAtfjyZfA==" }, "vscode-languageclient": { "version": "9.0.1", @@ -10402,43 +10299,24 @@ "requires": { "brace-expansion": "^2.0.1" } - }, - "vscode-jsonrpc": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.2.0.tgz", - "integrity": "sha512-C+r0eKJUIfiDIfwJhria30+TYWPtuHJXHtI7J0YlOmKAo7ogxP20T0zxB7HZQIFhIyvoBPwWskjxrvAtfjyZfA==" - }, - "vscode-languageserver-protocol": { - "version": "3.17.5", - "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.5.tgz", - "integrity": "sha512-mb1bvRJN8SVznADSGWM9u/b07H7Ecg0I3OgXDuLdn307rl/J3A9YD6/eYOssqhecL27hK1IPZAsaqh00i/Jljg==", - "requires": { - "vscode-jsonrpc": "8.2.0", - "vscode-languageserver-types": "3.17.5" - } - }, - "vscode-languageserver-types": { - "version": "3.17.5", - "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz", - "integrity": "sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg==" } } }, "vscode-languageserver": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-8.1.0.tgz", - "integrity": "sha512-eUt8f1z2N2IEUDBsKaNapkz7jl5QpskN2Y0G01T/ItMxBxw1fJwvtySGB9QMecatne8jFIWJGWI61dWjyTLQsw==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-9.0.1.tgz", + "integrity": "sha512-woByF3PDpkHFUreUa7Hos7+pUWdeWMXRd26+ZX2A8cFx6v/JPTtd4/uN0/jB6XQHYaOlHbio03NTHCqrgG5n7g==", "requires": { - "vscode-languageserver-protocol": "3.17.3" + "vscode-languageserver-protocol": "3.17.5" } }, "vscode-languageserver-protocol": { - "version": "3.17.3", - "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.3.tgz", - "integrity": "sha512-924/h0AqsMtA5yK22GgMtCYiMdCOtWTSGgUOkgEDX+wk2b0x4sAfLiO4NxBxqbiVtz7K7/1/RgVrVI0NClZwqA==", + "version": "3.17.5", + "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.5.tgz", + "integrity": "sha512-mb1bvRJN8SVznADSGWM9u/b07H7Ecg0I3OgXDuLdn307rl/J3A9YD6/eYOssqhecL27hK1IPZAsaqh00i/Jljg==", "requires": { - "vscode-jsonrpc": "8.1.0", - "vscode-languageserver-types": "3.17.3" + "vscode-jsonrpc": "8.2.0", + "vscode-languageserver-types": "3.17.5" } }, "vscode-languageserver-textdocument": { @@ -10447,9 +10325,9 @@ "integrity": "sha512-1bonkGqQs5/fxGT5UchTgjGVnfysL0O8v1AYMBjqTbWQTFn721zaPGDYFkOKtfDgFiSgXM3KwaG3FMGfW4Ed9Q==" }, "vscode-languageserver-types": { - "version": "3.17.3", - "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.3.tgz", - "integrity": "sha512-SYU4z1dL0PyIMd4Vj8YOqFvHu7Hz/enbWtpfnVbJHU4Nd1YNYx8u0ennumc6h48GQNeOLxmwySmnADouT/AuZA==" + "version": "3.17.5", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz", + "integrity": "sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg==" }, "vscode-uri": { "version": "3.0.7", diff --git a/package.json b/package.json index 5dc6448e2..d47911955 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "Statically checked Data Science programs.", "version": "0.1.0", "engines": { - "vscode": "^1.81.0" + "vscode": "^1.82.0" }, "categories": [ "Programming Languages" @@ -58,21 +58,21 @@ "glob": "^10.3.10", "langium": "^2.0.2", "radash": "^11.0.0", - "true-myth": "^7.0.1", + "true-myth": "^7.1.0", "vscode-languageclient": "^9.0.1", - "vscode-languageserver": "^8.1.0", - "vscode-languageserver-types": "^3.17.3", + "vscode-languageserver": "^9.0.1", + "vscode-languageserver-types": "^3.17.5", "vscode-uri": "^3.0.7" }, "devDependencies": { - "@lars-reimann/eslint-config": "^5.1.1", + "@lars-reimann/eslint-config": "^5.1.3", "@lars-reimann/prettier-config": "^5.0.0", - "@types/node": "^18.17.3", - "@types/vscode": "^1.81.0", + "@types/node": "^18.18.1", + "@types/vscode": "^1.82.0", "@vitest/coverage-v8": "^0.34.6", - "@vitest/ui": "^0.34.3", + "@vitest/ui": "^0.34.6", "concurrently": "^8.2.1", - "esbuild": "^0.19.2", + "esbuild": "^0.19.4", "esbuild-plugin-copy": "^2.1.1", "langium-cli": "^2.0.1", "typescript": "^5.2.2", diff --git a/src/language/formatting/safe-ds-formatter.ts b/src/language/formatting/safe-ds-formatter.ts index 87185f036..85b24662b 100644 --- a/src/language/formatting/safe-ds-formatter.ts +++ b/src/language/formatting/safe-ds-formatter.ts @@ -4,12 +4,11 @@ import { CstNode, findCommentNode, Formatting, - isAstNode, FormattingAction, FormattingActionOptions, + isAstNode, } from 'langium'; import * as ast from '../generated/ast.js'; -import { SdsImport, SdsImportAlias, SdsModule } from '../generated/ast.js'; import { annotationCallsOrEmpty, literalsOrEmpty, typeArgumentsOrEmpty } from '../helpers/shortcuts.js'; import noSpace = Formatting.noSpace; import newLine = Formatting.newLine; @@ -38,8 +37,10 @@ export class SafeDsFormatter extends AbstractFormatter { this.formatSdsModule(node); } else if (ast.isSdsImport(node)) { this.formatSdsImport(node); - } else if (ast.isSdsImportAlias(node)) { - this.formatSdsImportAlias(node); + } else if (ast.isSdsImportedDeclarationList(node)) { + this.formatSdsImportedDeclarationList(node); + } else if (ast.isSdsImportedDeclaration(node)) { + this.formatSdsImportedDeclaration(node); } // ----------------------------------------------------------------------------- @@ -191,7 +192,7 @@ export class SafeDsFormatter extends AbstractFormatter { // Module // ----------------------------------------------------------------------------- - private formatSdsModule(node: SdsModule): void { + private formatSdsModule(node: ast.SdsModule): void { const formatter = this.getNodeFormatter(node); const annotations = annotationCallsOrEmpty(node); const name = node.name; @@ -272,14 +273,21 @@ export class SafeDsFormatter extends AbstractFormatter { }); } - private formatSdsImport(node: SdsImport): void { + private formatSdsImport(node: ast.SdsImport): void { const formatter = this.getNodeFormatter(node); - formatter.keyword('import').append(oneSpace()); + formatter.keyword('from').append(oneSpace()); formatter.keyword('.').surround(noSpace()); + formatter.keyword('import').surround(oneSpace()); + } + + private formatSdsImportedDeclarationList(node: ast.SdsImportedDeclarationList): void { + const formatter = this.getNodeFormatter(node); + + formatter.keywords(',').prepend(noSpace()).append(oneSpace()); } - private formatSdsImportAlias(node: SdsImportAlias): void { + private formatSdsImportedDeclaration(node: ast.SdsImportedDeclaration): void { const formatter = this.getNodeFormatter(node); formatter.keyword('as').surround(Formatting.oneSpace()); diff --git a/src/language/grammar/safe-ds.langium b/src/language/grammar/safe-ds.langium index f738d12d8..0d8e74438 100644 --- a/src/language/grammar/safe-ds.langium +++ b/src/language/grammar/safe-ds.langium @@ -48,26 +48,50 @@ entry SdsModule returns SdsModule: ; interface SdsImport extends SdsObject { - importedNamespace: string; - alias?: SdsImportAlias; + package: string; } SdsImport returns SdsImport: + SdsQualifiedImport + | SdsWildcardImport +; + + +interface SdsQualifiedImport extends SdsImport { + importedDeclarationList: SdsImportedDeclarationList; +} + +SdsQualifiedImport returns SdsQualifiedImport: + 'from' + package=QualifiedName 'import' - importedNamespace=QualifiedNameWithWildcard - alias=SdsImportAlias? + importedDeclarationList=SdsImportedDeclarationList ; -interface SdsImportAlias extends SdsObject { - name: string; +interface SdsImportedDeclarationList extends SdsObject { + importedDeclarations: SdsImportedDeclaration[] } -SdsImportAlias returns SdsImportAlias: - 'as' name=ID +SdsImportedDeclarationList returns SdsImportedDeclarationList: + importedDeclarations+=SdsImportedDeclaration (',' importedDeclarations+=SdsImportedDeclaration)* ','? ; -QualifiedNameWithWildcard returns string: - ID ('.' ID)* ('.' '*')? +interface SdsImportedDeclaration extends SdsObject { + declaration: @SdsModuleMember; + alias?: string; +} + +SdsImportedDeclaration returns SdsImportedDeclaration: + declaration=[SdsModuleMember:ID] ('as' alias=ID)? +; + +interface SdsWildcardImport extends SdsImport {} + +SdsWildcardImport returns SdsWildcardImport: + 'from' + package=QualifiedName + 'import' + '*' ; QualifiedName returns string: diff --git a/src/language/helpers/checks.ts b/src/language/helpers/checks.ts index d21b6da87..f1fef942c 100644 --- a/src/language/helpers/checks.ts +++ b/src/language/helpers/checks.ts @@ -1,4 +1,16 @@ -import { isSdsAttribute, isSdsClass, isSdsEnum, isSdsFunction, SdsClassMember, SdsImport } from '../generated/ast.js'; +import { + isSdsAttribute, + isSdsClass, + isSdsEnum, + isSdsFunction, + isSdsSegment, + SdsClassMember, + SdsDeclaration, +} from '../generated/ast.js'; + +export const isInternal = (node: SdsDeclaration): boolean => { + return isSdsSegment(node) && node.visibility === 'internal'; +}; export const isStatic = (node: SdsClassMember): boolean => { if (isSdsClass(node) || isSdsEnum(node)) { @@ -12,8 +24,3 @@ export const isStatic = (node: SdsClassMember): boolean => { return false; } }; - -export const isWildcardImport = function (node: SdsImport): boolean { - const importedNamespace = node.importedNamespace ?? ''; - return importedNamespace.endsWith('*'); -}; diff --git a/src/language/helpers/shortcuts.ts b/src/language/helpers/shortcuts.ts index ceaa3e243..cc6fe19b4 100644 --- a/src/language/helpers/shortcuts.ts +++ b/src/language/helpers/shortcuts.ts @@ -17,6 +17,7 @@ import { SdsEnum, SdsEnumVariant, SdsImport, + SdsImportedDeclaration, SdsLiteral, SdsLiteralType, SdsModule, @@ -24,6 +25,7 @@ import { SdsParameter, SdsParameterList, SdsPlaceholder, + SdsQualifiedImport, SdsResult, SdsResultList, SdsStatement, @@ -60,6 +62,10 @@ export const blockLambdaResultsOrEmpty = function (node: SdsBlockLambda | undefi .toArray(); }; +export const importedDeclarationsOrEmpty = function (node: SdsQualifiedImport | undefined): SdsImportedDeclaration[] { + return node?.importedDeclarationList?.importedDeclarations ?? []; +}; + export const literalsOrEmpty = function (node: SdsLiteralType | undefined): SdsLiteral[] { return node?.literalList?.literals ?? []; }; diff --git a/src/language/safe-ds-module.ts b/src/language/safe-ds-module.ts index 438a999f4..a1485de8e 100644 --- a/src/language/safe-ds-module.ts +++ b/src/language/safe-ds-module.ts @@ -12,12 +12,13 @@ import { import { SafeDsGeneratedModule, SafeDsGeneratedSharedModule } from './generated/module.js'; import { registerValidationChecks } from './validation/safe-ds-validator.js'; import { SafeDsFormatter } from './formatting/safe-ds-formatter.js'; -import { SafeDsWorkspaceManager } from './builtins/safe-ds-workspace-manager.js'; +import { SafeDsWorkspaceManager } from './workspace/safe-ds-workspace-manager.js'; import { SafeDsScopeComputation } from './scoping/safe-ds-scope-computation.js'; import { SafeDsScopeProvider } from './scoping/safe-ds-scope-provider.js'; import { SafeDsValueConverter } from './grammar/safe-ds-value-converter.js'; import { SafeDsTypeComputer } from './typing/safe-ds-type-computer.js'; import { SafeDsCoreClasses } from './builtins/safe-ds-core-classes.js'; +import { SafeDsPackageManager } from './workspace/safe-ds-package-manager.js'; /** * Declaration of custom services - add your own service classes here. @@ -29,6 +30,9 @@ export type SafeDsAddedServices = { types: { TypeComputer: SafeDsTypeComputer; }; + workspace: { + PackageManager: SafeDsPackageManager; + }; }; /** @@ -59,6 +63,9 @@ export const SafeDsModule: Module new SafeDsTypeComputer(services), }, + workspace: { + PackageManager: (services) => new SafeDsPackageManager(services), + }, }; export type SafeDsSharedServices = LangiumSharedServices; diff --git a/src/language/scoping/safe-ds-scope-computation.ts b/src/language/scoping/safe-ds-scope-computation.ts index 9e354e0d9..90ea85d03 100644 --- a/src/language/scoping/safe-ds-scope-computation.ts +++ b/src/language/scoping/safe-ds-scope-computation.ts @@ -25,8 +25,8 @@ import { export class SafeDsScopeComputation extends DefaultScopeComputation { protected override exportNode(node: AstNode, exports: AstNodeDescription[], document: LangiumDocument): void { - // Pipelines and private segments cannot be referenced from other documents - if (isSdsPipeline(node) || (isSdsSegment(node) && node.visibility === 'private')) { + // Modules, pipelines, and private segments cannot be referenced from other documents + if (isSdsModule(node) || isSdsPipeline(node) || (isSdsSegment(node) && node.visibility === 'private')) { return; } diff --git a/src/language/scoping/safe-ds-scope-provider.ts b/src/language/scoping/safe-ds-scope-provider.ts index 1dd5c302b..064cee6c3 100644 --- a/src/language/scoping/safe-ds-scope-provider.ts +++ b/src/language/scoping/safe-ds-scope-provider.ts @@ -1,13 +1,10 @@ import { AstNode, AstNodeDescription, - AstNodeLocator, DefaultScopeProvider, EMPTY_SCOPE, getContainerOfType, getDocument, - LangiumDocuments, - MultiMap, ReferenceInfo, Scope, } from 'langium'; @@ -16,9 +13,9 @@ import { isSdsBlock, isSdsCallable, isSdsClass, - isSdsDeclaration, isSdsEnum, isSdsEnumVariant, + isSdsImportedDeclaration, isSdsLambda, isSdsMemberAccess, isSdsMemberType, @@ -26,14 +23,16 @@ import { isSdsNamedType, isSdsNamedTypeDeclaration, isSdsPlaceholder, + isSdsQualifiedImport, isSdsReference, isSdsSegment, isSdsStatement, isSdsTypeArgument, + isSdsWildcardImport, isSdsYield, SdsDeclaration, SdsExpression, - SdsImport, + SdsImportedDeclaration, SdsMemberAccess, SdsMemberType, SdsNamedTypeDeclaration, @@ -48,6 +47,7 @@ import { assigneesOrEmpty, classMembersOrEmpty, enumVariantsOrEmpty, + importedDeclarationsOrEmpty, importsOrEmpty, packageNameOrNull, parametersOrEmpty, @@ -56,27 +56,28 @@ import { typeParametersOrEmpty, } from '../helpers/shortcuts.js'; import { isContainedIn } from '../helpers/ast.js'; -import { isStatic, isWildcardImport } from '../helpers/checks.js'; +import { isStatic } from '../helpers/checks.js'; import { SafeDsServices } from '../safe-ds-module.js'; import { SafeDsTypeComputer } from '../typing/safe-ds-type-computer.js'; +import { SafeDsPackageManager } from '../workspace/safe-ds-package-manager.js'; export class SafeDsScopeProvider extends DefaultScopeProvider { - private readonly astNodeLocator: AstNodeLocator; - private readonly langiumDocuments: LangiumDocuments; + private readonly packageManager: SafeDsPackageManager; private readonly typeComputer: SafeDsTypeComputer; constructor(services: SafeDsServices) { super(services); - this.astNodeLocator = services.workspace.AstNodeLocator; - this.langiumDocuments = services.shared.workspace.LangiumDocuments; + this.packageManager = services.workspace.PackageManager; this.typeComputer = services.types.TypeComputer; } override getScope(context: ReferenceInfo): Scope { const node = context.container; - if (isSdsNamedType(node) && context.property === 'declaration') { + if (isSdsImportedDeclaration(node) && context.property === 'declaration') { + return this.getScopeForImportedDeclarationDeclaration(node); + } else if (isSdsNamedType(node) && context.property === 'declaration') { if (isSdsMemberType(node.$container) && node.$containerProperty === 'member') { return this.getScopeForMemberTypeMember(node.$container); } else { @@ -97,6 +98,22 @@ export class SafeDsScopeProvider extends DefaultScopeProvider { } } + private getScopeForImportedDeclarationDeclaration(node: SdsImportedDeclaration): Scope { + const ownPackageName = packageNameOrNull(node); + + const containingQualifiedImport = getContainerOfType(node, isSdsQualifiedImport); + if (!containingQualifiedImport) { + /* c8 ignore next 2 */ + return EMPTY_SCOPE; + } + + const declarationsInPackage = this.packageManager.getDeclarationsInPackage(containingQualifiedImport.package, { + nodeType: 'SdsDeclaration', + hideInternal: containingQualifiedImport.package !== ownPackageName, + }); + return this.createScope(declarationsInPackage); + } + private getScopeForMemberTypeMember(node: SdsMemberType): Scope { const declaration = this.getUniqueReferencedDeclarationForType(node.receiver); if (!declaration) { @@ -318,149 +335,66 @@ export class SafeDsScopeProvider extends DefaultScopeProvider { } private getGlobalScopeForNode(referenceType: string, node: AstNode): Scope { - // Gather information about the containing module - const containingModule = getContainerOfType(node, isSdsModule); - const ownUri = getDocument(node).uri.toString(); - const ownPackageName = containingModule?.name; - - // Data structures to collect reachable declarations - const explicitlyImportedDeclarations = new ImportedDeclarations(importsOrEmpty(containingModule)); - const declarationsInSamePackage: AstNodeDescription[] = []; - const builtinDeclarations: AstNodeDescription[] = []; - - // Loop over all declarations in the index - const candidates = this.indexManager.allElements(referenceType); - for (const candidate of candidates) { - // Skip declarations in the same file - const candidateUri = candidate.documentUri.toString(); - if (candidateUri === ownUri) { - continue; - } + const ownPackageName = packageNameOrNull(node); - // Skip declarations that cannot be found and modules - const candidateNode = this.loadAstNode(candidate); - if (!candidateNode || isSdsModule(candidateNode)) { - continue; - } + // Builtin declarations + const builtinDeclarations = this.builtinDeclarations(referenceType); + let outerScope = this.createScope(builtinDeclarations); - // Skip declarations in a module without a package name - const candidatePackageName = packageNameOrNull(candidateNode); - if (candidatePackageName === null) { - /* c8 ignore next */ - continue; - } + // Declarations in the same package + const declarationsInSamePackage = this.declarationsInSamePackage(ownPackageName, referenceType); + outerScope = this.createScope(declarationsInSamePackage, outerScope); - // Handle internal segments, which are only reachable in the same package - if (isSdsSegment(candidateNode) && candidateNode.visibility === 'internal') { - if (candidatePackageName === ownPackageName) { - declarationsInSamePackage.push(candidate); - } - continue; - } - - // Handle explicitly imported declarations - explicitlyImportedDeclarations.addIfImported(candidate, candidateNode, candidatePackageName); - - // Handle other declarations in the same package - if (candidatePackageName === ownPackageName) { - declarationsInSamePackage.push(candidate); - continue; - } - - // Handle builtin declarations - if (this.isBuiltinPackage(candidatePackageName)) { - builtinDeclarations.push(candidate); - } - } - - // Order of precedence: - // Highest: Explicitly imported declarations - // Middle: Declarations in the same package - // Lowest: Builtin declarations - return this.createScope( - explicitlyImportedDeclarations.getDescriptions(), - this.createScope(declarationsInSamePackage, this.createScope(builtinDeclarations, EMPTY_SCOPE)), - ); - } - - private loadAstNode(nodeDescription: AstNodeDescription): AstNode | undefined { - if (nodeDescription.node) { - /* c8 ignore next 2 */ - return nodeDescription.node; - } - const document = this.langiumDocuments.getOrCreateDocument(nodeDescription.documentUri); - return this.astNodeLocator.getAstNode(document.parseResult.value, nodeDescription.path); + // Explicitly imported declarations + const explicitlyImportedDeclarations = this.explicitlyImportedDeclarations(referenceType, node); + return this.createScope(explicitlyImportedDeclarations, outerScope); } - private isBuiltinPackage(packageName: string) { - return packageName.startsWith('safeds'); - } -} - -/** - * Collects descriptions of imported declarations in the same order as the imports. - */ -class ImportedDeclarations { - private readonly descriptionsByImport = new MultiMap(); + private explicitlyImportedDeclarations(referenceType: string, node: AstNode): AstNodeDescription[] { + const containingModule = getContainerOfType(node, isSdsModule); + const imports = importsOrEmpty(containingModule); - constructor(imports: SdsImport[]) { - // Remember the imports and their order + const result: AstNodeDescription[] = []; for (const imp of imports) { - this.descriptionsByImport.addAll(imp, []); - } - } - - /** - * Adds the node if it is imported. - * - * @param description The description of the node to add. - * @param node The node to add. - * @param packageName The package name of the containing module. - */ - addIfImported(description: AstNodeDescription, node: AstNode, packageName: string): void { - if (!isSdsDeclaration(node)) { - /* c8 ignore next 2 */ - return; - } - - const firstMatchingImport = this.findFirstMatchingImport(node, packageName); - if (!firstMatchingImport) { - return; + if (isSdsQualifiedImport(imp)) { + for (const importedDeclaration of importedDeclarationsOrEmpty(imp)) { + const description = importedDeclaration.declaration.$nodeDescription; + if (!description) { + continue; + } + + if (importedDeclaration.alias) { + result.push({ ...description, name: importedDeclaration.alias }); + } else { + result.push(description); + } + } + } else if (isSdsWildcardImport(imp)) { + const declarationsInPackage = this.packageManager.getDeclarationsInPackage(imp.package, { + nodeType: referenceType, + hideInternal: true, + }); + result.push(...declarationsInPackage); + } } - const updatedDescription = this.updateDescription(description, firstMatchingImport); - this.descriptionsByImport.add(firstMatchingImport, updatedDescription); - } - - private findFirstMatchingImport(node: SdsDeclaration, packageName: string): SdsImport | undefined { - return this.descriptionsByImport.keys().find((imp) => this.importMatches(imp, node, packageName)); + return result; } - private importMatches(imp: SdsImport, node: SdsDeclaration, packageName: string): boolean { - if (isWildcardImport(imp)) { - const importedPackageName = imp.importedNamespace.replaceAll(/\.?\*$/gu, ''); - return importedPackageName === packageName; - } else { - const segments = imp.importedNamespace.split('.'); - const importedPackageName = segments.slice(0, segments.length - 1).join('.'); - const importedDeclarationName = segments[segments.length - 1]; - return importedPackageName === packageName && importedDeclarationName === node.name; + private declarationsInSamePackage(packageName: string | null, referenceType: string): AstNodeDescription[] { + if (!packageName) { + return []; } - } - private updateDescription(description: AstNodeDescription, firstMatchingImport: SdsImport): AstNodeDescription { - if (isWildcardImport(firstMatchingImport) || !firstMatchingImport.alias) { - return description; - } else { - // Declaration is available under an alias - return { ...description, name: firstMatchingImport.alias.name }; - } + return this.packageManager.getDeclarationsInPackage(packageName, { + nodeType: referenceType, + }); } - /** - * Returns descriptions of all imported declarations in the order of the imports. - */ - getDescriptions(): AstNodeDescription[] { - return this.descriptionsByImport.values().toArray(); + private builtinDeclarations(referenceType: string): AstNodeDescription[] { + return this.packageManager.getDeclarationsInPackageOrSubpackage('safeds', { + nodeType: referenceType, + hideInternal: true, + }); } } diff --git a/src/language/validation/names.ts b/src/language/validation/names.ts index c9557ca2d..81f6a8db8 100644 --- a/src/language/validation/names.ts +++ b/src/language/validation/names.ts @@ -70,7 +70,7 @@ export const nameShouldHaveCorrectCasing = (node: SdsDeclaration, accept: Valida case 'SdsModule': const name = node.name ?? ''; const segments = name.split('.'); - if (name !== '' && !segments.every(isLowerCamelCase)) { + if (name !== '' && segments.every((it) => it !== '') && !segments.every(isLowerCamelCase)) { accept('warning', 'All segments of the qualified name of a package should be lowerCamelCase.', { node, property: 'name', diff --git a/src/language/validation/other/imports.ts b/src/language/validation/other/imports.ts deleted file mode 100644 index fbe523126..000000000 --- a/src/language/validation/other/imports.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { ValidationAcceptor } from 'langium'; -import { SdsImportAlias } from '../../generated/ast.js'; -import { isWildcardImport } from '../../helpers/checks.js'; - -export const CODE_IMPORT_WILDCARD_IMPORT_WITH_ALIAS = 'import/wildcard-import-with-alias'; - -export const importAliasMustNotBeUsedForWildcardImports = (node: SdsImportAlias, accept: ValidationAcceptor): void => { - const importNode = node.$container; - - if (importNode && isWildcardImport(importNode)) { - accept('error', 'A wildcard import must not have an alias.', { - node, - code: CODE_IMPORT_WILDCARD_IMPORT_WITH_ALIAS, - }); - } -}; diff --git a/src/language/validation/safe-ds-validator.ts b/src/language/validation/safe-ds-validator.ts index edaf0fcf0..9b115dc2c 100644 --- a/src/language/validation/safe-ds-validator.ts +++ b/src/language/validation/safe-ds-validator.ts @@ -37,7 +37,6 @@ import { parameterListMustNotHaveRequiredParametersAfterOptionalParameters, parameterListVariadicParameterMustBeLast, } from './other/declarations/parameterLists.js'; -import { importAliasMustNotBeUsedForWildcardImports } from './other/imports.js'; import { unionTypeMustHaveTypeArguments } from './other/types/unionTypes.js'; import { callableTypeMustNotHaveOptionalParameters } from './other/types/callableTypes.js'; import { typeArgumentListMustNotHavePositionalArgumentsAfterNamedArguments } from './other/types/typeArgumentLists.js'; @@ -66,7 +65,6 @@ export const registerValidationChecks = function (services: SafeDsServices) { SdsEnumVariant: [enumVariantMustContainUniqueNames, enumVariantParameterListShouldNotBeEmpty], SdsExpressionLambda: [expressionLambdaMustContainUniqueNames], SdsFunction: [functionMustContainUniqueNames, functionResultListShouldNotBeEmpty], - SdsImportAlias: [importAliasMustNotBeUsedForWildcardImports], SdsModule: [moduleDeclarationsMustMatchFileKind, moduleWithDeclarationsMustStatePackage], SdsParameter: [parameterMustHaveTypeHint, parameterMustNotBeVariadicAndOptional], SdsParameterList: [ diff --git a/src/language/workspace/safe-ds-package-manager.ts b/src/language/workspace/safe-ds-package-manager.ts new file mode 100644 index 000000000..c2c081917 --- /dev/null +++ b/src/language/workspace/safe-ds-package-manager.ts @@ -0,0 +1,203 @@ +import { SafeDsServices } from '../safe-ds-module.js'; +import { + AstNode, + AstNodeDescription, + AstNodeLocator, + AstReflection, + DocumentState, + IndexManager, + LangiumDocuments, +} from 'langium'; +import { packageNameOrNull } from '../helpers/shortcuts.js'; +import { isSdsSegment } from '../generated/ast.js'; +import { isInternal } from '../helpers/checks.js'; + +export class SafeDsPackageManager { + private readonly astNodeLocator: AstNodeLocator; + private readonly astReflection: AstReflection; + private readonly indexManager: IndexManager; + private readonly langiumDocuments: LangiumDocuments; + + private readonly packageNames: PackageNames; + private readonly packageContents: PackageContents; + + constructor(services: SafeDsServices) { + this.astNodeLocator = services.workspace.AstNodeLocator; + this.astReflection = services.shared.AstReflection; + this.indexManager = services.shared.workspace.IndexManager; + this.langiumDocuments = services.shared.workspace.LangiumDocuments; + + this.packageNames = new Set(); + this.packageContents = { + subpackages: new Map(), + ownDeclarations: [], + }; + + // Update data once documents are indexed + services.shared.workspace.DocumentBuilder.onBuildPhase(DocumentState.IndexedContent, () => + this.buildPackageStructures(), + ); + } + + /** + * Returns all package names that are defined in the workspace sorted alphabetically. + */ + getPackageNames(): string[] { + return Array.from(this.packageNames).sort(); + } + + /** + * Returns whether a module with the given package name exists in the workspace. + */ + hasPackage(packageName: string): boolean { + return this.packageNames.has(packageName); + } + + /** + * Returns all declarations that are defined directly in the given package. The options can be used to filter the + * results. + */ + getDeclarationsInPackage(packageName: string, options: GetDeclarationsOptions = {}): AstNodeDescription[] { + const result = this.getPackageContents(packageName)?.ownDeclarations ?? []; + return this.filterDescriptions(result, options); + } + + /** + * Returns all declarations that are defined in the given package or any of its (transitive) subpackages. The + * options can be used to filter the results. + */ + getDeclarationsInPackageOrSubpackage( + packageName: string, + options: GetDeclarationsOptions = {}, + ): AstNodeDescription[] { + const packageContents = this.getPackageContents(packageName); + if (!packageContents) { + return []; + } + + const result: AstNodeDescription[] = []; + const queue: PackageContents[] = [packageContents]; + while (queue.length > 0) { + const current = queue.shift()!; + result.push(...current.ownDeclarations); + queue.push(...current.subpackages.values()); + } + + return this.filterDescriptions(result, options); + } + + private getPackageContents(packageName: string): PackageContents | undefined { + const parts = packageName.split('.'); + let current = this.packageContents; + + for (const part of parts) { + if (!current.subpackages.has(part)) { + return undefined; + } + + current = current.subpackages.get(part)!; + } + + return current; + } + + private filterDescriptions( + descriptions: AstNodeDescription[], + options: GetDeclarationsOptions, + ): AstNodeDescription[] { + const { nodeType, hideInternal } = options; + let result = descriptions; + + if (nodeType) { + result = descriptions.filter((it) => this.astReflection.isSubtype(it.type, nodeType)); + } + + if (hideInternal) { + result = result.filter((it) => !isSdsSegment(it.node) || !isInternal(it.node)); + } + + return result; + } + + private buildPackageStructures(): void { + this.packageNames.clear(); + this.packageContents.subpackages.clear(); + + for (const description of this.indexManager.allElements()) { + const node = this.loadAstNode(description); + if (!node) { + continue; + } + + const packageName = packageNameOrNull(node); + if (!packageName || !this.isValidPackageName(packageName)) { + /* c8 ignore next 2 */ + continue; + } + + this.packageNames.add(packageName); + this.addToTree(packageName, description, node); + } + } + + private loadAstNode(nodeDescription: AstNodeDescription): AstNode | undefined { + if (nodeDescription.node) { + /* c8 ignore next 2 */ + return nodeDescription.node; + } + + if (this.langiumDocuments.hasDocument(nodeDescription.documentUri)) { + const document = this.langiumDocuments.getOrCreateDocument(nodeDescription.documentUri); + return this.astNodeLocator.getAstNode(document.parseResult.value, nodeDescription.path); + } + + return undefined; + } + + /** + * Checks whether the given package name is valid. There must be no leading or trailing dots, and no double dots. + */ + private isValidPackageName(packageName: string): boolean { + return packageName.split('.').every((it) => it !== ''); + } + + private addToTree(packageName: string, description: AstNodeDescription, node: AstNode): void { + const descriptionWithResolvedNode = { ...description, node }; + + const parts = packageName.split('.'); + let current = this.packageContents; + + // Traverse the package tree and create missing nodes + for (const part of parts) { + if (!current.subpackages.has(part)) { + current.subpackages.set(part, { + subpackages: new Map(), + ownDeclarations: [], + }); + } + current = current.subpackages.get(part)!; + } + + current.ownDeclarations.push(descriptionWithResolvedNode); + } +} + +export interface GetDeclarationsOptions { + /** + * If specified, only declarations of the given node type are returned. + */ + readonly nodeType?: string; + + /** + * If true, internal declarations are hidden. + */ + readonly hideInternal?: boolean; +} + +type PackageNames = Set; +type PackageContents = { + subpackages: PackageTree; + ownDeclarations: OwnDeclarations; +}; +type PackageTree = Map; +type OwnDeclarations = AstNodeDescription[]; diff --git a/src/language/builtins/safe-ds-workspace-manager.ts b/src/language/workspace/safe-ds-workspace-manager.ts similarity index 93% rename from src/language/builtins/safe-ds-workspace-manager.ts rename to src/language/workspace/safe-ds-workspace-manager.ts index dbefa04fe..c3d34178a 100644 --- a/src/language/builtins/safe-ds-workspace-manager.ts +++ b/src/language/workspace/safe-ds-workspace-manager.ts @@ -1,6 +1,6 @@ import { DefaultWorkspaceManager, LangiumDocument, LangiumDocumentFactory, LangiumSharedServices } from 'langium'; import { WorkspaceFolder } from 'vscode-languageserver'; -import { listBuiltinsFiles } from './fileFinder.js'; +import { listBuiltinsFiles } from '../builtins/fileFinder.js'; export class SafeDsWorkspaceManager extends DefaultWorkspaceManager { private documentFactory: LangiumDocumentFactory; diff --git a/tests/language/workspace/safe-ds-package-manager.test.ts b/tests/language/workspace/safe-ds-package-manager.test.ts new file mode 100644 index 000000000..32c55a014 --- /dev/null +++ b/tests/language/workspace/safe-ds-package-manager.test.ts @@ -0,0 +1,117 @@ +import { afterAll, beforeAll, describe, expect, it } from 'vitest'; +import { createSafeDsServices } from '../../../src/language/safe-ds-module.js'; +import { clearDocuments, parseHelper } from 'langium/test'; +import { EmptyFileSystem } from 'langium'; + +const services = createSafeDsServices(EmptyFileSystem).SafeDs; +const packageManager = services.workspace.PackageManager; + +const document1 = ` +package myPackage1 + +class Class1 + +class Class2 +`; + +const document2 = ` +package myPackage1 + +enum Enum1 +`; + +const document3 = ` +package myPackage1.subPackage1 + +class Class3 + +enum Enum2 + +internal segment segment1() {} +`; + +const document4 = ` +package myPackage2 + +class Class4 +`; + +describe('SafeDsPackageManager', () => { + beforeAll(async () => { + await parseHelper(services)(document1); + await parseHelper(services)(document2); + await parseHelper(services)(document3); + await parseHelper(services)(document4); + }); + + afterAll(async () => { + await clearDocuments(services); + }); + + describe('getPackageNames', () => { + it('should return the package names sorted alphabetically', () => { + expect(packageManager.getPackageNames()).toStrictEqual([ + 'myPackage1', + 'myPackage1.subPackage1', + 'myPackage2', + ]); + }); + }); + + describe('hasPackage', () => { + it('should return true for existing packages', () => { + expect(packageManager.hasPackage('myPackage1')).toBeTruthy(); + }); + + it('should return false for non-existing packages', () => { + expect(packageManager.hasPackage('myPackage3')).toBeFalsy(); + }); + }); + + describe('getDeclarationsInPackage', () => { + it('should return all declarations in the given package', () => { + const result = packageManager.getDeclarationsInPackage('myPackage1'); + + expect(result.map((desc) => desc.name)).toStrictEqual(['Class1', 'Class2', 'Enum1']); + }); + + it('should filter by node type if specified', () => { + const result = packageManager.getDeclarationsInPackage('myPackage1', { nodeType: 'SdsEnum' }); + + expect(result.map((desc) => desc.name)).toStrictEqual(['Enum1']); + }); + + it('should hide internal declarations if requested', () => { + const result = packageManager.getDeclarationsInPackage('myPackage1', { hideInternal: true }); + + expect(result.map((desc) => desc.name)).toStrictEqual(['Class1', 'Class2', 'Enum1']); + }); + }); + + describe('getDeclarationsInPackageOrSubpackage', () => { + it('should return all declarations in the given package or any (transitive) subpackage', () => { + const result = packageManager.getDeclarationsInPackageOrSubpackage('myPackage1'); + + expect(result.map((desc) => desc.name)).toStrictEqual([ + 'Class1', + 'Class2', + 'Enum1', + 'Class3', + 'Enum2', + 'segment1', + ]); + }); + + it('should filter by node type if specified', () => { + const result = packageManager.getDeclarationsInPackageOrSubpackage('myPackage1', { nodeType: 'SdsEnum' }); + + expect(result.map((desc) => desc.name)).toStrictEqual(['Enum1', 'Enum2']); + }); + + it('should hide internal declarations if requested', () => { + const result = packageManager.getDeclarationsInPackageOrSubpackage('myPackage1', { hideInternal: true }); + + expect(result.map((desc) => desc.name)).toStrictEqual(['Class1', 'Class2', 'Enum1', 'Class3', 'Enum2']); + }); + }); +}); diff --git a/tests/language/builtins/safe-ds-workspace-manager.test.ts b/tests/language/workspace/safe-ds-workspace-manager.test.ts similarity index 100% rename from tests/language/builtins/safe-ds-workspace-manager.test.ts rename to tests/language/workspace/safe-ds-workspace-manager.test.ts diff --git a/tests/resources/formatting/comments/before imports.sdstest b/tests/resources/formatting/comments/before imports.sdstest index e3f919432..f6f45ae12 100644 --- a/tests/resources/formatting/comments/before imports.sdstest +++ b/tests/resources/formatting/comments/before imports.sdstest @@ -1,8 +1,8 @@ // test -import test +from test import MyClass // ----------------------------------------------------------------------------- // test -import test +from test import MyClass diff --git a/tests/resources/formatting/modules/annotation call and import and declaration.sdstest b/tests/resources/formatting/modules/annotation call and import and declaration.sdstest index 2667a5e11..068c34940 100644 --- a/tests/resources/formatting/modules/annotation call and import and declaration.sdstest +++ b/tests/resources/formatting/modules/annotation call and import and declaration.sdstest @@ -2,7 +2,7 @@ @Annotation1 -import myPackage . MyClass +from myPackage . mySubpackage import MyClass class C @@ -11,6 +11,6 @@ class C @Annotation1 -import myPackage.MyClass +from myPackage.mySubpackage import MyClass class C diff --git a/tests/resources/formatting/modules/annotation call and import.sdstest b/tests/resources/formatting/modules/annotation call and import.sdstest index ab9fca0f1..601de9f4f 100644 --- a/tests/resources/formatting/modules/annotation call and import.sdstest +++ b/tests/resources/formatting/modules/annotation call and import.sdstest @@ -2,10 +2,10 @@ @Annotation1 -import myPackage . MyClass +from myPackage . mySubpackage import MyClass // ----------------------------------------------------------------------------- @Annotation1 -import myPackage.MyClass +from myPackage.mySubpackage import MyClass diff --git a/tests/resources/formatting/modules/annotation call and package name and import and declaration.sdstest b/tests/resources/formatting/modules/annotation call and package name and import and declaration.sdstest index 55441b8bf..632aa80a5 100644 --- a/tests/resources/formatting/modules/annotation call and package name and import and declaration.sdstest +++ b/tests/resources/formatting/modules/annotation call and package name and import and declaration.sdstest @@ -5,7 +5,7 @@ package myPackage -import myPackage . MyClass +from myPackage . mySubpackage import MyClass class C @@ -16,6 +16,6 @@ class C package myPackage -import myPackage.MyClass +from myPackage.mySubpackage import MyClass class C diff --git a/tests/resources/formatting/modules/annotation call and package name and import.sdstest b/tests/resources/formatting/modules/annotation call and package name and import.sdstest index ea40f8d3e..bef34ffc3 100644 --- a/tests/resources/formatting/modules/annotation call and package name and import.sdstest +++ b/tests/resources/formatting/modules/annotation call and package name and import.sdstest @@ -5,7 +5,7 @@ package myPackage -import myPackage . MyClass +from myPackage . mySubpackage import MyClass // ----------------------------------------------------------------------------- @@ -13,4 +13,4 @@ import myPackage . MyClass package myPackage -import myPackage.MyClass +from myPackage.mySubpackage import MyClass diff --git a/tests/resources/formatting/modules/annotation calls and imports and declarations.sdstest b/tests/resources/formatting/modules/annotation calls and imports and declarations.sdstest index bce326581..8a3cd6c22 100644 --- a/tests/resources/formatting/modules/annotation calls and imports and declarations.sdstest +++ b/tests/resources/formatting/modules/annotation calls and imports and declarations.sdstest @@ -4,11 +4,13 @@ @Annotation2 -import myPackage . MyClass +from myPackage . mySubpackage import MyClass -import myPackage . MyClass as Class +from myPackage . mySubpackage import MyClass as Class -import myPackage . * +from myPackage . mySubpackage import * + +from myPackage . mySubpackage import MyClass , MyClass as Class class C @@ -21,9 +23,10 @@ class D @Annotation1 @Annotation2 -import myPackage.MyClass -import myPackage.MyClass as Class -import myPackage.* +from myPackage.mySubpackage import MyClass +from myPackage.mySubpackage import MyClass as Class +from myPackage.mySubpackage import * +from myPackage.mySubpackage import MyClass, MyClass as Class class C diff --git a/tests/resources/formatting/modules/annotation calls and imports.sdstest b/tests/resources/formatting/modules/annotation calls and imports.sdstest index 25697f1ee..d0520afa8 100644 --- a/tests/resources/formatting/modules/annotation calls and imports.sdstest +++ b/tests/resources/formatting/modules/annotation calls and imports.sdstest @@ -4,17 +4,20 @@ @Annotation2 -import myPackage . MyClass +from myPackage . mySubpackage import MyClass -import myPackage . MyClass as Class +from myPackage . mySubpackage import MyClass as Class -import myPackage . * +from myPackage . mySubpackage import * + +from myPackage . mySubpackage import MyClass , MyClass as Class // ----------------------------------------------------------------------------- @Annotation1 @Annotation2 -import myPackage.MyClass -import myPackage.MyClass as Class -import myPackage.* +from myPackage.mySubpackage import MyClass +from myPackage.mySubpackage import MyClass as Class +from myPackage.mySubpackage import * +from myPackage.mySubpackage import MyClass, MyClass as Class diff --git a/tests/resources/formatting/modules/annotation calls and package name and imports and declarations.sdstest b/tests/resources/formatting/modules/annotation calls and package name and imports and declarations.sdstest index 864e1d890..6da3c0819 100644 --- a/tests/resources/formatting/modules/annotation calls and package name and imports and declarations.sdstest +++ b/tests/resources/formatting/modules/annotation calls and package name and imports and declarations.sdstest @@ -7,11 +7,13 @@ package myPackage -import myPackage . MyClass +from myPackage . mySubpackage import MyClass -import myPackage . MyClass as Class +from myPackage . mySubpackage import MyClass as Class -import myPackage . * +from myPackage . mySubpackage import * + +from myPackage . mySubpackage import MyClass , MyClass as Class class C @@ -26,9 +28,10 @@ class D package myPackage -import myPackage.MyClass -import myPackage.MyClass as Class -import myPackage.* +from myPackage.mySubpackage import MyClass +from myPackage.mySubpackage import MyClass as Class +from myPackage.mySubpackage import * +from myPackage.mySubpackage import MyClass, MyClass as Class class C diff --git a/tests/resources/formatting/modules/annotation calls and package name and imports.sdstest b/tests/resources/formatting/modules/annotation calls and package name and imports.sdstest index ee0919194..1aec5b7fe 100644 --- a/tests/resources/formatting/modules/annotation calls and package name and imports.sdstest +++ b/tests/resources/formatting/modules/annotation calls and package name and imports.sdstest @@ -7,11 +7,13 @@ package myPackage -import myPackage . MyClass +from myPackage . mySubpackage import MyClass -import myPackage . MyClass as Class +from myPackage . mySubpackage import MyClass as Class -import myPackage . * +from myPackage . mySubpackage import * + +from myPackage . mySubpackage import MyClass , MyClass as Class // ----------------------------------------------------------------------------- @@ -20,6 +22,7 @@ import myPackage . * package myPackage -import myPackage.MyClass -import myPackage.MyClass as Class -import myPackage.* +from myPackage.mySubpackage import MyClass +from myPackage.mySubpackage import MyClass as Class +from myPackage.mySubpackage import * +from myPackage.mySubpackage import MyClass, MyClass as Class diff --git a/tests/resources/formatting/modules/full.sdstest b/tests/resources/formatting/modules/full.sdstest index 2ee8e0626..122890645 100644 --- a/tests/resources/formatting/modules/full.sdstest +++ b/tests/resources/formatting/modules/full.sdstest @@ -7,11 +7,13 @@ package myPackage -import myPackage . MyClass +from myPackage . mySubpackage import MyClass -import myPackage . MyClass as Class +from myPackage . mySubpackage import MyClass as Class -import myPackage . * +from myPackage . mySubpackage import * + +from myPackage . mySubpackage import MyClass , MyClass as Class @Annotation1 @@ -69,9 +71,10 @@ schema S {} package myPackage -import myPackage.MyClass -import myPackage.MyClass as Class -import myPackage.* +from myPackage.mySubpackage import MyClass +from myPackage.mySubpackage import MyClass as Class +from myPackage.mySubpackage import * +from myPackage.mySubpackage import MyClass, MyClass as Class @Annotation1 @Annotation2 diff --git a/tests/resources/formatting/modules/import and declaration.sdstest b/tests/resources/formatting/modules/import and declaration.sdstest index 9699a087c..1162a351e 100644 --- a/tests/resources/formatting/modules/import and declaration.sdstest +++ b/tests/resources/formatting/modules/import and declaration.sdstest @@ -1,11 +1,11 @@ -import myPackage . MyClass +from myPackage . mySubpackage import MyClass class C // ----------------------------------------------------------------------------- -import myPackage.MyClass +from myPackage.mySubpackage import MyClass class C diff --git a/tests/resources/formatting/modules/import.sdstest b/tests/resources/formatting/modules/import.sdstest index 14c49da8b..5fc63e342 100644 --- a/tests/resources/formatting/modules/import.sdstest +++ b/tests/resources/formatting/modules/import.sdstest @@ -1,6 +1,6 @@ -import myPackage . MyClass +from myPackage . mySubpackage import MyClass // ----------------------------------------------------------------------------- -import myPackage.MyClass +from myPackage.mySubpackage import MyClass diff --git a/tests/resources/formatting/modules/imports and declarations.sdstest b/tests/resources/formatting/modules/imports and declarations.sdstest index 32e4f01fe..36875e4f7 100644 --- a/tests/resources/formatting/modules/imports and declarations.sdstest +++ b/tests/resources/formatting/modules/imports and declarations.sdstest @@ -1,9 +1,11 @@ -import myPackage . MyClass +from myPackage . mySubpackage import MyClass -import myPackage . MyClass as Class +from myPackage . mySubpackage import MyClass as Class -import myPackage . * +from myPackage . mySubpackage import * + +from myPackage . mySubpackage import MyClass , MyClass as Class class C @@ -13,9 +15,10 @@ class D // ----------------------------------------------------------------------------- -import myPackage.MyClass -import myPackage.MyClass as Class -import myPackage.* +from myPackage.mySubpackage import MyClass +from myPackage.mySubpackage import MyClass as Class +from myPackage.mySubpackage import * +from myPackage.mySubpackage import MyClass, MyClass as Class class C diff --git a/tests/resources/formatting/modules/imports.sdstest b/tests/resources/formatting/modules/imports.sdstest index 419960c3f..83b142d05 100644 --- a/tests/resources/formatting/modules/imports.sdstest +++ b/tests/resources/formatting/modules/imports.sdstest @@ -1,12 +1,15 @@ -import myPackage . MyClass +from myPackage . mySubpackage import MyClass -import myPackage . MyClass as Class +from myPackage . mySubpackage import MyClass as Class -import myPackage . * +from myPackage . mySubpackage import * + +from myPackage . mySubpackage import MyClass , MyClass as Class // ----------------------------------------------------------------------------- -import myPackage.MyClass -import myPackage.MyClass as Class -import myPackage.* +from myPackage.mySubpackage import MyClass +from myPackage.mySubpackage import MyClass as Class +from myPackage.mySubpackage import * +from myPackage.mySubpackage import MyClass, MyClass as Class diff --git a/tests/resources/formatting/modules/package name and import and declaration.sdstest b/tests/resources/formatting/modules/package name and import and declaration.sdstest index 1ec659baf..6364241a8 100644 --- a/tests/resources/formatting/modules/package name and import and declaration.sdstest +++ b/tests/resources/formatting/modules/package name and import and declaration.sdstest @@ -2,7 +2,7 @@ package myPackage -import myPackage . MyClass +from myPackage . mySubpackage import MyClass class C @@ -11,6 +11,6 @@ class C package myPackage -import myPackage.MyClass +from myPackage.mySubpackage import MyClass class C diff --git a/tests/resources/formatting/modules/package name and import.sdstest b/tests/resources/formatting/modules/package name and import.sdstest index 0a6982a88..7649fff65 100644 --- a/tests/resources/formatting/modules/package name and import.sdstest +++ b/tests/resources/formatting/modules/package name and import.sdstest @@ -2,10 +2,10 @@ package myPackage -import myPackage . MyClass +from myPackage . mySubpackage import MyClass // ----------------------------------------------------------------------------- package myPackage -import myPackage.MyClass +from myPackage.mySubpackage import MyClass diff --git a/tests/resources/formatting/modules/package name and imports and declarations.sdstest b/tests/resources/formatting/modules/package name and imports and declarations.sdstest index 85bdca3a1..77f480f80 100644 --- a/tests/resources/formatting/modules/package name and imports and declarations.sdstest +++ b/tests/resources/formatting/modules/package name and imports and declarations.sdstest @@ -1,11 +1,13 @@ package myPackage -import myPackage . MyClass +from myPackage . mySubpackage import MyClass -import myPackage . MyClass as Class +from myPackage . mySubpackage import MyClass as Class -import myPackage . * +from myPackage . mySubpackage import * + +from myPackage . mySubpackage import MyClass , MyClass as Class class C @@ -17,9 +19,10 @@ class D package myPackage -import myPackage.MyClass -import myPackage.MyClass as Class -import myPackage.* +from myPackage.mySubpackage import MyClass +from myPackage.mySubpackage import MyClass as Class +from myPackage.mySubpackage import * +from myPackage.mySubpackage import MyClass, MyClass as Class class C diff --git a/tests/resources/formatting/modules/package name and imports.sdstest b/tests/resources/formatting/modules/package name and imports.sdstest index 03bb11054..426fd93f4 100644 --- a/tests/resources/formatting/modules/package name and imports.sdstest +++ b/tests/resources/formatting/modules/package name and imports.sdstest @@ -2,16 +2,19 @@ package myPackage -import myPackage . MyClass +from myPackage . mySubpackage import MyClass -import myPackage . MyClass as Class +from myPackage . mySubpackage import MyClass as Class -import myPackage . * +from myPackage . mySubpackage import * + +from myPackage . mySubpackage import MyClass , MyClass as Class // ----------------------------------------------------------------------------- package myPackage -import myPackage.MyClass -import myPackage.MyClass as Class -import myPackage.* +from myPackage.mySubpackage import MyClass +from myPackage.mySubpackage import MyClass as Class +from myPackage.mySubpackage import * +from myPackage.mySubpackage import MyClass, MyClass as Class diff --git a/tests/resources/formatting/trailing commas/imported declaration list in qualified import.sdstest b/tests/resources/formatting/trailing commas/imported declaration list in qualified import.sdstest new file mode 100644 index 000000000..8abd49c50 --- /dev/null +++ b/tests/resources/formatting/trailing commas/imported declaration list in qualified import.sdstest @@ -0,0 +1,5 @@ +from myPackage . mySubpackage import MyClass , MyClass as Class , + +// ----------------------------------------------------------------------------- + +from myPackage.mySubpackage import MyClass, MyClass as Class, diff --git a/tests/resources/grammar/keywords as names/good-escapedKeywords.sdstest b/tests/resources/grammar/keywords as names/good-escapedKeywords.sdstest index 5dcc16ee7..ad259c144 100644 --- a/tests/resources/grammar/keywords as names/good-escapedKeywords.sdstest +++ b/tests/resources/grammar/keywords as names/good-escapedKeywords.sdstest @@ -19,12 +19,10 @@ class `out` class `package` class `pipeline` class `private` -class `protocol` class `schema` class `static` class `segment` class `sub` -class `subterm` class `super` class `true` class `union` diff --git a/tests/resources/grammar/modules/bad-annotation call after import.sdstest b/tests/resources/grammar/modules/bad-annotation call after import.sdstest index 171deaf7a..69fd2c161 100644 --- a/tests/resources/grammar/modules/bad-annotation call after import.sdstest +++ b/tests/resources/grammar/modules/bad-annotation call after import.sdstest @@ -1,5 +1,5 @@ // $TEST$ syntax_error -import myPackage.MyClass +from myPackage import MyClass @Annotation1 diff --git a/tests/resources/grammar/modules/bad-annotation call between package name and import.sdstest b/tests/resources/grammar/modules/bad-annotation call between package name and import.sdstest index 3b16ac8c6..d06923756 100644 --- a/tests/resources/grammar/modules/bad-annotation call between package name and import.sdstest +++ b/tests/resources/grammar/modules/bad-annotation call between package name and import.sdstest @@ -4,4 +4,4 @@ package test @Annotation1 -import myPackage.MyClass +from myPackage import MyClass diff --git a/tests/resources/grammar/modules/bad-import after declaration.sdstest b/tests/resources/grammar/modules/bad-import after declaration.sdstest index 51e0fd341..37d05a95a 100644 --- a/tests/resources/grammar/modules/bad-import after declaration.sdstest +++ b/tests/resources/grammar/modules/bad-import after declaration.sdstest @@ -2,4 +2,4 @@ class C -import myPackage.MyClass +from myPackage import MyClass diff --git a/tests/resources/grammar/modules/bad-import without declarations.sdstest b/tests/resources/grammar/modules/bad-import without declarations.sdstest new file mode 100644 index 000000000..8e5e68c4d --- /dev/null +++ b/tests/resources/grammar/modules/bad-import without declarations.sdstest @@ -0,0 +1,3 @@ +// $TEST$ syntax_error + +from myPackage import diff --git a/tests/resources/grammar/modules/bad-import without package.sdstest b/tests/resources/grammar/modules/bad-import without package.sdstest new file mode 100644 index 000000000..e81a3ffe1 --- /dev/null +++ b/tests/resources/grammar/modules/bad-import without package.sdstest @@ -0,0 +1,3 @@ +// $TEST$ syntax_error + +from import MyClass diff --git a/tests/resources/grammar/modules/bad-package name after import.sdstest b/tests/resources/grammar/modules/bad-package name after import.sdstest index ce7d31116..fb1df5eb5 100644 --- a/tests/resources/grammar/modules/bad-package name after import.sdstest +++ b/tests/resources/grammar/modules/bad-package name after import.sdstest @@ -1,5 +1,5 @@ // $TEST$ syntax_error -import someDeclaration +from myPackage import someDeclaration package test diff --git a/tests/resources/grammar/modules/good-annotation call and import and declaration.sdstest b/tests/resources/grammar/modules/good-annotation call and import and declaration.sdstest index 271777165..235131633 100644 --- a/tests/resources/grammar/modules/good-annotation call and import and declaration.sdstest +++ b/tests/resources/grammar/modules/good-annotation call and import and declaration.sdstest @@ -2,6 +2,6 @@ @Annotation1 -import myPackage.MyClass +from myPackage import MyClass class C diff --git a/tests/resources/grammar/modules/good-annotation call and import.sdstest b/tests/resources/grammar/modules/good-annotation call and import.sdstest index bb565d674..9412b0515 100644 --- a/tests/resources/grammar/modules/good-annotation call and import.sdstest +++ b/tests/resources/grammar/modules/good-annotation call and import.sdstest @@ -2,4 +2,4 @@ @Annotation1 -import myPackage.MyClass +from myPackage import MyClass diff --git a/tests/resources/grammar/modules/good-annotation call and package name and import and declaration.sdstest b/tests/resources/grammar/modules/good-annotation call and package name and import and declaration.sdstest index 9dcb538ba..417eab28c 100644 --- a/tests/resources/grammar/modules/good-annotation call and package name and import and declaration.sdstest +++ b/tests/resources/grammar/modules/good-annotation call and package name and import and declaration.sdstest @@ -4,6 +4,6 @@ package myPackage -import myPackage.MyClass +from myPackage import MyClass class C diff --git a/tests/resources/grammar/modules/good-annotation call and package name and import.sdstest b/tests/resources/grammar/modules/good-annotation call and package name and import.sdstest index 95a2c504e..6e382d8db 100644 --- a/tests/resources/grammar/modules/good-annotation call and package name and import.sdstest +++ b/tests/resources/grammar/modules/good-annotation call and package name and import.sdstest @@ -4,4 +4,4 @@ package myPackage -import myPackage.MyClass +from myPackage import MyClass diff --git a/tests/resources/grammar/modules/good-annotation calls and imports and declarations.sdstest b/tests/resources/grammar/modules/good-annotation calls and imports and declarations.sdstest index 5d346acdc..1405718ae 100644 --- a/tests/resources/grammar/modules/good-annotation calls and imports and declarations.sdstest +++ b/tests/resources/grammar/modules/good-annotation calls and imports and declarations.sdstest @@ -3,9 +3,10 @@ @Annotation1 @Annotation2 -import myPackage.MyClass -import myPackage.MyClass as Class -import myPackage.* +from myPackage import MyClass +from myPackage import MyClass as Class +from myPackage import * +from myPackage import MyClass, MyClass as Class class C class D diff --git a/tests/resources/grammar/modules/good-annotation calls and imports.sdstest b/tests/resources/grammar/modules/good-annotation calls and imports.sdstest index e1a469205..091c3cebd 100644 --- a/tests/resources/grammar/modules/good-annotation calls and imports.sdstest +++ b/tests/resources/grammar/modules/good-annotation calls and imports.sdstest @@ -3,6 +3,7 @@ @Annotation1 @Annotation2 -import myPackage.MyClass -import myPackage.MyClass as Class -import myPackage.* +from myPackage import MyClass +from myPackage import MyClass as Class +from myPackage import * +from myPackage import MyClass, MyClass as Class diff --git a/tests/resources/grammar/modules/good-annotation calls and package name and imports and declarations.sdstest b/tests/resources/grammar/modules/good-annotation calls and package name and imports and declarations.sdstest index f0eff9127..cef48d9c5 100644 --- a/tests/resources/grammar/modules/good-annotation calls and package name and imports and declarations.sdstest +++ b/tests/resources/grammar/modules/good-annotation calls and package name and imports and declarations.sdstest @@ -5,9 +5,10 @@ package myPackage -import myPackage.MyClass -import myPackage.MyClass as Class -import myPackage.* +from myPackage import MyClass +from myPackage import MyClass as Class +from myPackage import * +from myPackage import MyClass, MyClass as Class class C class D diff --git a/tests/resources/grammar/modules/good-annotation calls and package name and imports.sdstest b/tests/resources/grammar/modules/good-annotation calls and package name and imports.sdstest index 4b5d0a79f..c35fd05c5 100644 --- a/tests/resources/grammar/modules/good-annotation calls and package name and imports.sdstest +++ b/tests/resources/grammar/modules/good-annotation calls and package name and imports.sdstest @@ -5,6 +5,7 @@ package myPackage -import myPackage.MyClass -import myPackage.MyClass as Class -import myPackage.* +from myPackage import MyClass +from myPackage import MyClass as Class +from myPackage import * +from myPackage import MyClass, MyClass as Class diff --git a/tests/resources/grammar/modules/good-import and declaration.sdstest b/tests/resources/grammar/modules/good-import and declaration.sdstest index 448ebcc73..ba1a0a173 100644 --- a/tests/resources/grammar/modules/good-import and declaration.sdstest +++ b/tests/resources/grammar/modules/good-import and declaration.sdstest @@ -1,5 +1,5 @@ // $TEST$ no_syntax_error -import myPackage.MyClass +from myPackage import MyClass class C diff --git a/tests/resources/grammar/modules/good-import.sdstest b/tests/resources/grammar/modules/good-import.sdstest index 8e9815b67..4cd7febc4 100644 --- a/tests/resources/grammar/modules/good-import.sdstest +++ b/tests/resources/grammar/modules/good-import.sdstest @@ -1,3 +1,3 @@ // $TEST$ no_syntax_error -import myPackage.MyClass +from myPackage import MyClass diff --git a/tests/resources/grammar/modules/good-imports and declarations.sdstest b/tests/resources/grammar/modules/good-imports and declarations.sdstest index afaa0c2a3..c999e0d42 100644 --- a/tests/resources/grammar/modules/good-imports and declarations.sdstest +++ b/tests/resources/grammar/modules/good-imports and declarations.sdstest @@ -1,8 +1,9 @@ // $TEST$ no_syntax_error -import myPackage.MyClass -import myPackage.MyClass as Class -import myPackage.* +from myPackage import MyClass +from myPackage import MyClass as Class +from myPackage import * +from myPackage import MyClass, MyClass as Class class C class D diff --git a/tests/resources/grammar/modules/good-imports.sdstest b/tests/resources/grammar/modules/good-imports.sdstest index 142658809..117cdede9 100644 --- a/tests/resources/grammar/modules/good-imports.sdstest +++ b/tests/resources/grammar/modules/good-imports.sdstest @@ -1,5 +1,6 @@ // $TEST$ no_syntax_error -import myPackage.MyClass -import myPackage.MyClass as Class -import myPackage.* +from myPackage import MyClass +from myPackage import MyClass as Class +from myPackage import * +from myPackage import MyClass, MyClass as Class diff --git a/tests/resources/grammar/modules/good-package name and import and declaration.sdstest b/tests/resources/grammar/modules/good-package name and import and declaration.sdstest index 5a2e75dd9..a15f84d0a 100644 --- a/tests/resources/grammar/modules/good-package name and import and declaration.sdstest +++ b/tests/resources/grammar/modules/good-package name and import and declaration.sdstest @@ -2,6 +2,6 @@ package myPackage -import myPackage.MyClass +from myPackage import MyClass class C diff --git a/tests/resources/grammar/modules/good-package name and import.sdstest b/tests/resources/grammar/modules/good-package name and import.sdstest index c9295f93a..1e641a954 100644 --- a/tests/resources/grammar/modules/good-package name and import.sdstest +++ b/tests/resources/grammar/modules/good-package name and import.sdstest @@ -2,4 +2,4 @@ package myPackage -import myPackage.MyClass +from myPackage import MyClass diff --git a/tests/resources/grammar/modules/good-package name and imports and declarations.sdstest b/tests/resources/grammar/modules/good-package name and imports and declarations.sdstest index 6aced7b55..322760744 100644 --- a/tests/resources/grammar/modules/good-package name and imports and declarations.sdstest +++ b/tests/resources/grammar/modules/good-package name and imports and declarations.sdstest @@ -2,9 +2,10 @@ package myPackage -import myPackage.MyClass -import myPackage.MyClass as Class -import myPackage.* +from myPackage import MyClass +from myPackage import MyClass as Class +from myPackage import * +from myPackage import MyClass, MyClass as Class class C class D diff --git a/tests/resources/grammar/modules/good-package name and imports.sdstest b/tests/resources/grammar/modules/good-package name and imports.sdstest index 42d39a21f..2e7a19d83 100644 --- a/tests/resources/grammar/modules/good-package name and imports.sdstest +++ b/tests/resources/grammar/modules/good-package name and imports.sdstest @@ -2,6 +2,7 @@ package myPackage -import myPackage.MyClass -import myPackage.MyClass as Class -import myPackage.* +from myPackage import MyClass +from myPackage import MyClass as Class +from myPackage import * +from myPackage import MyClass, MyClass as Class diff --git a/tests/resources/grammar/trailing commas/good-imported declaration list of qualified import.sdstest b/tests/resources/grammar/trailing commas/good-imported declaration list of qualified import.sdstest new file mode 100644 index 000000000..e98849e94 --- /dev/null +++ b/tests/resources/grammar/trailing commas/good-imported declaration list of qualified import.sdstest @@ -0,0 +1,4 @@ +// $TEST$ no_syntax_error + +from myPackage import MyClass, MyClass as Class, + \ No newline at end of file diff --git a/tests/resources/scoping/annotation calls/across files/main with imports and own declarations.sdstest b/tests/resources/scoping/annotation calls/across files/main with imports and own declarations.sdstest index f449c2b9a..26ce5d2b7 100644 --- a/tests/resources/scoping/annotation calls/across files/main with imports and own declarations.sdstest +++ b/tests/resources/scoping/annotation calls/across files/main with imports and own declarations.sdstest @@ -1,7 +1,7 @@ package tests.scoping.annotationCalls.acrossFiles -import safeds.scoping.annotationCalls.acrossFiles.MyAnnotation as MyOwnAnnotation -import tests.scoping.annotationCalls.acrossFiles.other.AnnotationInAnotherPackage +from safeds.scoping.annotationCalls.acrossFiles import MyAnnotation as MyOwnAnnotation +from tests.scoping.annotationCalls.acrossFiles.other import AnnotationInAnotherPackage, Annotation2InAnotherPackage // $TEST$ target own_MyOwnAnnotation annotation »MyOwnAnnotation« @@ -18,6 +18,9 @@ annotation »MyOwnAnnotation« // $TEST$ references other_AnnotationInAnotherPackage @»AnnotationInAnotherPackage« +// $TEST$ references other_Annotation2InAnotherPackage +@»Annotation2InAnotherPackage« + // $TEST$ unresolved @»AnnotationWithoutPackage« pipeline myPipeline {} diff --git a/tests/resources/scoping/annotation calls/across files/main with multiple imports of same name.sdstest b/tests/resources/scoping/annotation calls/across files/main with multiple imports of same name.sdstest index 0fb5e547d..6a480c88f 100644 --- a/tests/resources/scoping/annotation calls/across files/main with multiple imports of same name.sdstest +++ b/tests/resources/scoping/annotation calls/across files/main with multiple imports of same name.sdstest @@ -1,8 +1,8 @@ package tests.scoping.annotationCalls.acrossFiles -import safeds.scoping.annotationCalls.acrossFiles.MyAnnotation -import tests.scoping.annotationCalls.acrossFiles.other.MyAnnotation -import tests.scoping.annotationCalls.acrossFiles.MyAnnotation +from safeds.scoping.annotationCalls.acrossFiles import MyAnnotation +from tests.scoping.annotationCalls.acrossFiles.other import MyAnnotation +from tests.scoping.annotationCalls.acrossFiles import MyAnnotation pipeline myPipeline { // $TEST$ references safeds_MyAnnotation diff --git a/tests/resources/scoping/annotation calls/across files/main with qualified import with alias.sdstest b/tests/resources/scoping/annotation calls/across files/main with qualified import with alias.sdstest index dc07cf4ab..1d3e552f7 100644 --- a/tests/resources/scoping/annotation calls/across files/main with qualified import with alias.sdstest +++ b/tests/resources/scoping/annotation calls/across files/main with qualified import with alias.sdstest @@ -1,8 +1,8 @@ package tests.scoping.annotationCalls.acrossFiles -import tests.scoping.annotationCalls.acrossFiles.MyAnnotation as MyAnnotationInSamePackage -import safeds.scoping.annotationCalls.acrossFiles.MyAnnotation as MyAnnotationInSafeDsPackage -import tests.scoping.annotationCalls.acrossFiles.other.MyAnnotation as MyAnnotationInAnotherPackage +from tests.scoping.annotationCalls.acrossFiles import MyAnnotation as MyAnnotationInSamePackage +from safeds.scoping.annotationCalls.acrossFiles import MyAnnotation as MyAnnotationInSafeDsPackage +from tests.scoping.annotationCalls.acrossFiles.other import MyAnnotation as MyAnnotationInAnotherPackage // $TEST$ references same_MyAnnotation @»MyAnnotation« diff --git a/tests/resources/scoping/annotation calls/across files/main with qualified import.sdstest b/tests/resources/scoping/annotation calls/across files/main with qualified import.sdstest index 48e4f14cb..904dd5731 100644 --- a/tests/resources/scoping/annotation calls/across files/main with qualified import.sdstest +++ b/tests/resources/scoping/annotation calls/across files/main with qualified import.sdstest @@ -1,8 +1,7 @@ package tests.scoping.annotationCalls.acrossFiles -import safeds.scoping.annotationCalls.acrossFiles.MyAnnotation -import tests.scoping.annotationCalls.acrossFiles.other.AnnotationInAnotherPackage -import AnnotationWithoutPackage +from safeds.scoping.annotationCalls.acrossFiles import MyAnnotation +from tests.scoping.annotationCalls.acrossFiles.other import AnnotationInAnotherPackage, Annotation2InAnotherPackage // $TEST$ references safeds_MyAnnotation @»MyAnnotation« @@ -16,6 +15,9 @@ import AnnotationWithoutPackage // $TEST$ references other_AnnotationInAnotherPackage @»AnnotationInAnotherPackage« +// $TEST$ references other_Annotation2InAnotherPackage +@»Annotation2InAnotherPackage« + // $TEST$ unresolved @»AnnotationWithoutPackage« pipeline myPipeline {} diff --git a/tests/resources/scoping/annotation calls/across files/main with wildcard import.sdstest b/tests/resources/scoping/annotation calls/across files/main with wildcard import.sdstest index b469ec94b..a1e2db9b0 100644 --- a/tests/resources/scoping/annotation calls/across files/main with wildcard import.sdstest +++ b/tests/resources/scoping/annotation calls/across files/main with wildcard import.sdstest @@ -1,6 +1,6 @@ package tests.scoping.annotationCalls.acrossFiles -import safeds.scoping.annotationCalls.acrossFiles.* +from safeds.scoping.annotationCalls.acrossFiles import * // $TEST$ references safeds_MyAnnotation @»MyAnnotation« diff --git a/tests/resources/scoping/annotation calls/across files/resource other package.sdstest b/tests/resources/scoping/annotation calls/across files/resource other package.sdstest index 9ed1a6aa7..50c473001 100644 --- a/tests/resources/scoping/annotation calls/across files/resource other package.sdstest +++ b/tests/resources/scoping/annotation calls/across files/resource other package.sdstest @@ -5,3 +5,6 @@ annotation »MyAnnotation« // $TEST$ target other_AnnotationInAnotherPackage annotation »AnnotationInAnotherPackage« + +// $TEST$ target other_Annotation2InAnotherPackage +annotation »Annotation2InAnotherPackage« diff --git a/tests/resources/scoping/imported declarations/to annotations/main.sdstest b/tests/resources/scoping/imported declarations/to annotations/main.sdstest new file mode 100644 index 000000000..27dee1409 --- /dev/null +++ b/tests/resources/scoping/imported declarations/to annotations/main.sdstest @@ -0,0 +1,26 @@ +package tests.scoping.importedDeclarations.toAnnotations + +// $TEST$ references own_OwnAnnotation +from tests.scoping.importedDeclarations.toAnnotations import »OwnAnnotation« + + +// $TEST$ references firstPackage_AnnotationInFirstPackage +from tests.scoping.importedDeclarations.toAnnotations.first import »AnnotationInFirstPackage« + +// $TEST$ references secondPackage_AnnotationInSecondPackage +from tests.scoping.importedDeclarations.toAnnotations.second import »AnnotationInSecondPackage« + +// $TEST$ references secondPackage_RedeclaredAnnotationInSameFile +// $TEST$ references secondPackage_RedeclaredAnnotationInOtherFile +from tests.scoping.importedDeclarations.toAnnotations.second import »RedeclaredAnnotationInSameFile«, »RedeclaredAnnotationInOtherFile« + +// $TEST$ references secondPackage_AnnotationInBothPackages +from tests.scoping.importedDeclarations.toAnnotations.second import »AnnotationInBothPackages« + + +// $TEST$ unresolved +from tests.scoping.importedDeclarations.toAnnotations.second import »AnnotationInFirstPackage« + + +// $TEST$ target own_OwnAnnotation +annotation »OwnAnnotation« diff --git a/tests/resources/scoping/imported declarations/to annotations/resource first package.sdstest b/tests/resources/scoping/imported declarations/to annotations/resource first package.sdstest new file mode 100644 index 000000000..822775f8c --- /dev/null +++ b/tests/resources/scoping/imported declarations/to annotations/resource first package.sdstest @@ -0,0 +1,7 @@ +package tests.scoping.importedDeclarations.toAnnotations.first + +// $TEST$ target firstPackage_AnnotationInFirstPackage +annotation »AnnotationInFirstPackage« + +// $TEST$ target firstPackage_AnnotationInBothPackages +annotation »AnnotationInBothPackages« diff --git a/tests/resources/scoping/imported declarations/to annotations/resource second package.sdstest b/tests/resources/scoping/imported declarations/to annotations/resource second package.sdstest new file mode 100644 index 000000000..caaaed0f8 --- /dev/null +++ b/tests/resources/scoping/imported declarations/to annotations/resource second package.sdstest @@ -0,0 +1,14 @@ +package tests.scoping.importedDeclarations.toAnnotations.second + +// $TEST$ target secondPackage_AnnotationInSecondPackage +annotation »AnnotationInSecondPackage« + +// $TEST$ target secondPackage_RedeclaredAnnotationInSameFile +annotation »RedeclaredAnnotationInSameFile« +annotation RedeclaredAnnotationInSameFile + +// $TEST$ target secondPackage_RedeclaredAnnotationInOtherFile +annotation »RedeclaredAnnotationInOtherFile« + +// $TEST$ target secondPackage_AnnotationInBothPackages +annotation »AnnotationInBothPackages« diff --git a/tests/resources/scoping/imported declarations/to global classes/main.sdstest b/tests/resources/scoping/imported declarations/to global classes/main.sdstest new file mode 100644 index 000000000..b3b7f341b --- /dev/null +++ b/tests/resources/scoping/imported declarations/to global classes/main.sdstest @@ -0,0 +1,26 @@ +package tests.scoping.importedDeclarations.toClasses + +// $TEST$ references own_OwnClass +from tests.scoping.importedDeclarations.toClasses import »OwnClass« + + +// $TEST$ references firstPackage_ClassInFirstPackage +from tests.scoping.importedDeclarations.toClasses.first import »ClassInFirstPackage« + +// $TEST$ references secondPackage_ClassInSecondPackage +from tests.scoping.importedDeclarations.toClasses.second import »ClassInSecondPackage« + +// $TEST$ references secondPackage_RedeclaredClassInSameFile +// $TEST$ references secondPackage_RedeclaredClassInOtherFile +from tests.scoping.importedDeclarations.toClasses.second import »RedeclaredClassInSameFile«, »RedeclaredClassInOtherFile« + +// $TEST$ references secondPackage_ClassInBothPackages +from tests.scoping.importedDeclarations.toClasses.second import »ClassInBothPackages« + + +// $TEST$ unresolved +from tests.scoping.importedDeclarations.toClasses.second import »ClassInFirstPackage« + + +// $TEST$ target own_OwnClass +class »OwnClass« diff --git a/tests/resources/scoping/imported declarations/to global classes/resource first package.sdstest b/tests/resources/scoping/imported declarations/to global classes/resource first package.sdstest new file mode 100644 index 000000000..9a9ae9362 --- /dev/null +++ b/tests/resources/scoping/imported declarations/to global classes/resource first package.sdstest @@ -0,0 +1,7 @@ +package tests.scoping.importedDeclarations.toClasses.first + +// $TEST$ target firstPackage_ClassInFirstPackage +class »ClassInFirstPackage« + +// $TEST$ target firstPackage_ClassInBothPackages +class »ClassInBothPackages« diff --git a/tests/resources/scoping/imported declarations/to global classes/resource second package.sdstest b/tests/resources/scoping/imported declarations/to global classes/resource second package.sdstest new file mode 100644 index 000000000..654d717ee --- /dev/null +++ b/tests/resources/scoping/imported declarations/to global classes/resource second package.sdstest @@ -0,0 +1,14 @@ +package tests.scoping.importedDeclarations.toClasses.second + +// $TEST$ target secondPackage_ClassInSecondPackage +class »ClassInSecondPackage« + +// $TEST$ target secondPackage_RedeclaredClassInSameFile +class »RedeclaredClassInSameFile« +class RedeclaredClassInSameFile + +// $TEST$ target secondPackage_RedeclaredClassInOtherFile +class »RedeclaredClassInOtherFile« + +// $TEST$ target secondPackage_ClassInBothPackages +class »ClassInBothPackages« diff --git a/tests/resources/scoping/imported declarations/to global enums/main.sdstest b/tests/resources/scoping/imported declarations/to global enums/main.sdstest new file mode 100644 index 000000000..66594ba30 --- /dev/null +++ b/tests/resources/scoping/imported declarations/to global enums/main.sdstest @@ -0,0 +1,26 @@ +package tests.scoping.importedDeclarations.toEnums + +// $TEST$ references own_OwnEnum +from tests.scoping.importedDeclarations.toEnums import »OwnEnum« + + +// $TEST$ references firstPackage_EnumInFirstPackage +from tests.scoping.importedDeclarations.toEnums.first import »EnumInFirstPackage« + +// $TEST$ references secondPackage_EnumInSecondPackage +from tests.scoping.importedDeclarations.toEnums.second import »EnumInSecondPackage« + +// $TEST$ references secondPackage_RedeclaredEnumInSameFile +// $TEST$ references secondPackage_RedeclaredEnumInOtherFile +from tests.scoping.importedDeclarations.toEnums.second import »RedeclaredEnumInSameFile«, »RedeclaredEnumInOtherFile« + +// $TEST$ references secondPackage_EnumInBothPackages +from tests.scoping.importedDeclarations.toEnums.second import »EnumInBothPackages« + + +// $TEST$ unresolved +from tests.scoping.importedDeclarations.toEnums.second import »EnumInFirstPackage« + + +// $TEST$ target own_OwnEnum +enum »OwnEnum« diff --git a/tests/resources/scoping/imported declarations/to global enums/resource first package.sdstest b/tests/resources/scoping/imported declarations/to global enums/resource first package.sdstest new file mode 100644 index 000000000..a563a8f83 --- /dev/null +++ b/tests/resources/scoping/imported declarations/to global enums/resource first package.sdstest @@ -0,0 +1,7 @@ +package tests.scoping.importedDeclarations.toEnums.first + +// $TEST$ target firstPackage_EnumInFirstPackage +enum »EnumInFirstPackage« + +// $TEST$ target firstPackage_EnumInBothPackages +enum »EnumInBothPackages« diff --git a/tests/resources/scoping/imported declarations/to global enums/resource second package.sdstest b/tests/resources/scoping/imported declarations/to global enums/resource second package.sdstest new file mode 100644 index 000000000..670236f5d --- /dev/null +++ b/tests/resources/scoping/imported declarations/to global enums/resource second package.sdstest @@ -0,0 +1,14 @@ +package tests.scoping.importedDeclarations.toEnums.second + +// $TEST$ target secondPackage_EnumInSecondPackage +enum »EnumInSecondPackage« + +// $TEST$ target secondPackage_RedeclaredEnumInSameFile +enum »RedeclaredEnumInSameFile« +enum RedeclaredEnumInSameFile + +// $TEST$ target secondPackage_RedeclaredEnumInOtherFile +enum »RedeclaredEnumInOtherFile« + +// $TEST$ target secondPackage_EnumInBothPackages +enum »EnumInBothPackages« diff --git a/tests/resources/scoping/imported declarations/to global functions/main.sdstest b/tests/resources/scoping/imported declarations/to global functions/main.sdstest new file mode 100644 index 000000000..17f57d810 --- /dev/null +++ b/tests/resources/scoping/imported declarations/to global functions/main.sdstest @@ -0,0 +1,26 @@ +package tests.scoping.importedDeclarations.toFunctions + +// $TEST$ references own_ownFunction +from tests.scoping.importedDeclarations.toFunctions import »ownFunction« + + +// $TEST$ references firstPackage_functionInFirstPackage +from tests.scoping.importedDeclarations.toFunctions.first import »functionInFirstPackage« + +// $TEST$ references secondPackage_functionInSecondPackage +from tests.scoping.importedDeclarations.toFunctions.second import »functionInSecondPackage« + +// $TEST$ references secondPackage_redeclaredFunctionInSameFile +// $TEST$ references secondPackage_redeclaredFunctionInOtherFile +from tests.scoping.importedDeclarations.toFunctions.second import »redeclaredFunctionInSameFile«, »redeclaredFunctionInOtherFile« + +// $TEST$ references secondPackage_functionInBothPackages +from tests.scoping.importedDeclarations.toFunctions.second import »functionInBothPackages« + + +// $TEST$ unresolved +from tests.scoping.importedDeclarations.toFunctions.second import »functionInFirstPackage« + + +// $TEST$ target own_ownFunction +fun »ownFunction«() diff --git a/tests/resources/scoping/imported declarations/to global functions/resource first package.sdstest b/tests/resources/scoping/imported declarations/to global functions/resource first package.sdstest new file mode 100644 index 000000000..4fe65ce3e --- /dev/null +++ b/tests/resources/scoping/imported declarations/to global functions/resource first package.sdstest @@ -0,0 +1,7 @@ +package tests.scoping.importedDeclarations.toFunctions.first + +// $TEST$ target firstPackage_functionInFirstPackage +fun »functionInFirstPackage«() + +// $TEST$ target firstPackage_functionInBothPackages +fun »functionInBothPackages«() diff --git a/tests/resources/scoping/imported declarations/to global functions/resource second package.sdstest b/tests/resources/scoping/imported declarations/to global functions/resource second package.sdstest new file mode 100644 index 000000000..0b8571587 --- /dev/null +++ b/tests/resources/scoping/imported declarations/to global functions/resource second package.sdstest @@ -0,0 +1,14 @@ +package tests.scoping.importedDeclarations.toFunctions.second + +// $TEST$ target secondPackage_functionInSecondPackage +fun »functionInSecondPackage«() + +// $TEST$ target secondPackage_redeclaredFunctionInSameFile +fun »redeclaredFunctionInSameFile«() +fun redeclaredFunctionInSameFile() + +// $TEST$ target secondPackage_redeclaredFunctionInOtherFile +fun »redeclaredFunctionInOtherFile«() + +// $TEST$ target secondPackage_functionInBothPackages +fun »functionInBothPackages«() diff --git a/tests/resources/scoping/imported declarations/to nested declaration/main.sdstest b/tests/resources/scoping/imported declarations/to nested declaration/main.sdstest new file mode 100644 index 000000000..e0216342e --- /dev/null +++ b/tests/resources/scoping/imported declarations/to nested declaration/main.sdstest @@ -0,0 +1,28 @@ +package tests.scoping.importedDeclarations.toNestedDeclaration + +// $TEST$ unresolved +from tests.scoping.importedDeclarations.toNestedDeclaration import »OwnClass« + + +// $TEST$ unresolved +from tests.scoping.importedDeclarations.toNestedDeclaration.first import »ClassInFirstPackage« + +// $TEST$ unresolved +from tests.scoping.importedDeclarations.toNestedDeclaration.second import »ClassInSecondPackage« + +// $TEST$ unresolved +// $TEST$ unresolved +from tests.scoping.importedDeclarations.toNestedDeclaration.second import »RedeclaredClassInSameFile«, »RedeclaredClassInOtherFile« + +// $TEST$ unresolved +from tests.scoping.importedDeclarations.toNestedDeclaration.second import »ClassInBothPackages« + + +// $TEST$ unresolved +from tests.scoping.importedDeclarations.toNestedDeclaration.second import »ClassInFirstPackage« + + +class Outer { + // $TEST$ target own_OwnClass + class »OwnClass« +} diff --git a/tests/resources/scoping/imported declarations/to nested declaration/resource first package.sdstest b/tests/resources/scoping/imported declarations/to nested declaration/resource first package.sdstest new file mode 100644 index 000000000..200bf7e83 --- /dev/null +++ b/tests/resources/scoping/imported declarations/to nested declaration/resource first package.sdstest @@ -0,0 +1,9 @@ +package tests.scoping.importedDeclarations.toNestedDeclaration.first + +class Outer { + // $TEST$ target firstPackage_ClassInFirstPackage + class »ClassInFirstPackage« + + // $TEST$ target firstPackage_ClassInBothPackages + class »ClassInBothPackages« +} diff --git a/tests/resources/scoping/imported declarations/to nested declaration/resource second package.sdstest b/tests/resources/scoping/imported declarations/to nested declaration/resource second package.sdstest new file mode 100644 index 000000000..a2194dd88 --- /dev/null +++ b/tests/resources/scoping/imported declarations/to nested declaration/resource second package.sdstest @@ -0,0 +1,16 @@ +package tests.scoping.importedDeclarations.toNestedDeclaration.second + +class Outer { + // $TEST$ target secondPackage_ClassInSecondPackage + class »ClassInSecondPackage« + + // $TEST$ target secondPackage_RedeclaredClassInSameFile + class »RedeclaredClassInSameFile« + class RedeclaredClassInSameFile + + // $TEST$ target secondPackage_RedeclaredClassInOtherFile + class »RedeclaredClassInOtherFile« + + // $TEST$ target secondPackage_ClassInBothPackages + class »ClassInBothPackages« +} diff --git a/tests/resources/scoping/imported declarations/to pipelines/main.sdstest b/tests/resources/scoping/imported declarations/to pipelines/main.sdstest new file mode 100644 index 000000000..0085c16d5 --- /dev/null +++ b/tests/resources/scoping/imported declarations/to pipelines/main.sdstest @@ -0,0 +1,26 @@ +package tests.scoping.importedDeclarations.toPipelines + +// $TEST$ unresolved +from tests.scoping.importedDeclarations.toPipelines import »ownPipeline« + + +// $TEST$ unresolved +from tests.scoping.importedDeclarations.toPipelines.first import »pipelineInFirstPackage« + +// $TEST$ unresolved +from tests.scoping.importedDeclarations.toPipelines.second import »pipelineInSecondPackage« + +// $TEST$ unresolved +// $TEST$ unresolved +from tests.scoping.importedDeclarations.toPipelines.second import »redeclaredPipelineInSameFile«, »redeclaredPipelineInOtherFile« + +// $TEST$ unresolved +from tests.scoping.importedDeclarations.toPipelines.second import »pipelineInBothPackages« + + +// $TEST$ unresolved +from tests.scoping.importedDeclarations.toPipelines.second import »pipelineInFirstPackage« + + +// $TEST$ target own_ownPipeline +pipeline »ownPipeline« {} diff --git a/tests/resources/scoping/imported declarations/to pipelines/resource first package.sdstest b/tests/resources/scoping/imported declarations/to pipelines/resource first package.sdstest new file mode 100644 index 000000000..0606253cf --- /dev/null +++ b/tests/resources/scoping/imported declarations/to pipelines/resource first package.sdstest @@ -0,0 +1,7 @@ +package tests.scoping.importedDeclarations.toPipelines.first + +// $TEST$ target firstPackage_pipelineInFirstPackage +pipeline »pipelineInFirstPackage« {} + +// $TEST$ target firstPackage_pipelineInBothPackages +pipeline »pipelineInBothPackages« {} diff --git a/tests/resources/scoping/imported declarations/to pipelines/resource second package.sdstest b/tests/resources/scoping/imported declarations/to pipelines/resource second package.sdstest new file mode 100644 index 000000000..87a9d28bb --- /dev/null +++ b/tests/resources/scoping/imported declarations/to pipelines/resource second package.sdstest @@ -0,0 +1,14 @@ +package tests.scoping.importedDeclarations.toPipelines.second + +// $TEST$ target secondPackage_pipelineInSecondPackage +pipeline »pipelineInSecondPackage« {} + +// $TEST$ target secondPackage_redeclaredPipelineInSameFile +pipeline »redeclaredPipelineInSameFile« {} +pipeline redeclaredPipelineInSameFile {} + +// $TEST$ target secondPackage_redeclaredPipelineInOtherFile +pipeline »redeclaredPipelineInOtherFile« {} + +// $TEST$ target secondPackage_pipelineInBothPackages +pipeline »pipelineInBothPackages« {} diff --git a/tests/resources/scoping/imported declarations/to schemas/main.sdstest b/tests/resources/scoping/imported declarations/to schemas/main.sdstest new file mode 100644 index 000000000..50e262a55 --- /dev/null +++ b/tests/resources/scoping/imported declarations/to schemas/main.sdstest @@ -0,0 +1,25 @@ +package tests.scoping.importedDeclarations.toSchemas + +// $TEST$ references own_OwnSchema +from tests.scoping.importedDeclarations.toSchemas import »OwnSchema« + +// $TEST$ references firstPackage_SchemaInFirstPackage +from tests.scoping.importedDeclarations.toSchemas.first import »SchemaInFirstPackage« + +// $TEST$ references secondPackage_SchemaInSecondPackage +from tests.scoping.importedDeclarations.toSchemas.second import »SchemaInSecondPackage« + +// $TEST$ references secondPackage_RedeclaredSchemaInSameFile +// $TEST$ references secondPackage_RedeclaredSchemaInOtherFile +from tests.scoping.importedDeclarations.toSchemas.second import »RedeclaredSchemaInSameFile«, »RedeclaredSchemaInOtherFile« + +// $TEST$ references secondPackage_SchemaInBothPackages +from tests.scoping.importedDeclarations.toSchemas.second import »SchemaInBothPackages« + + +// $TEST$ unresolved +from tests.scoping.importedDeclarations.toSchemas.second import »SchemaInFirstPackage« + + +// $TEST$ target own_OwnSchema +schema »OwnSchema« {} diff --git a/tests/resources/scoping/imported declarations/to schemas/resource first package.sdstest b/tests/resources/scoping/imported declarations/to schemas/resource first package.sdstest new file mode 100644 index 000000000..281edb623 --- /dev/null +++ b/tests/resources/scoping/imported declarations/to schemas/resource first package.sdstest @@ -0,0 +1,7 @@ +package tests.scoping.importedDeclarations.toSchemas.first + +// $TEST$ target firstPackage_SchemaInFirstPackage +schema »SchemaInFirstPackage« {} + +// $TEST$ target firstPackage_SchemaInBothPackages +schema »SchemaInBothPackages« {} diff --git a/tests/resources/scoping/imported declarations/to schemas/resource second package.sdstest b/tests/resources/scoping/imported declarations/to schemas/resource second package.sdstest new file mode 100644 index 000000000..56f668917 --- /dev/null +++ b/tests/resources/scoping/imported declarations/to schemas/resource second package.sdstest @@ -0,0 +1,14 @@ +package tests.scoping.importedDeclarations.toSchemas.second + +// $TEST$ target secondPackage_SchemaInSecondPackage +schema »SchemaInSecondPackage« {} + +// $TEST$ target secondPackage_RedeclaredSchemaInSameFile +schema »RedeclaredSchemaInSameFile« {} +schema RedeclaredSchemaInSameFile {} + +// $TEST$ target secondPackage_RedeclaredSchemaInOtherFile +schema »RedeclaredSchemaInOtherFile« {} + +// $TEST$ target secondPackage_SchemaInBothPackages +schema »SchemaInBothPackages« {} diff --git a/tests/resources/scoping/imported declarations/to segments/main.sdstest b/tests/resources/scoping/imported declarations/to segments/main.sdstest new file mode 100644 index 000000000..caff4fa14 --- /dev/null +++ b/tests/resources/scoping/imported declarations/to segments/main.sdstest @@ -0,0 +1,42 @@ +package tests.scoping.importedDeclarations.toSegments + +// $TEST$ references own_ownSegment +from tests.scoping.importedDeclarations.toSegments import »ownSegment« + + +// $TEST$ references same_publicSegmentInSamePackage +from tests.scoping.importedDeclarations.toSegments import »publicSegmentInSamePackage« + +// $TEST$ references same_internalSegmentInSamePackage +from tests.scoping.importedDeclarations.toSegments import »internalSegmentInSamePackage« + +// $TEST$ unresolved +from tests.scoping.importedDeclarations.toSegments import »privateSegmentInSamePackage« + + +// $TEST$ references firstPackage_segmentInFirstPackage +from tests.scoping.importedDeclarations.toSegments.first import »segmentInFirstPackage« + +// $TEST$ references secondPackage_publicSegmentInSecondPackage +from tests.scoping.importedDeclarations.toSegments.second import »publicSegmentInSecondPackage« + +// $TEST$ unresolved +from tests.scoping.importedDeclarations.toSegments.second import »internalSegmentInSecondPackage« + +// $TEST$ unresolved +from tests.scoping.importedDeclarations.toSegments.second import »privateSegmentInSecondPackage« + +// $TEST$ references secondPackage_redeclaredSegmentInSameFile +// $TEST$ references secondPackage_redeclaredSegmentInOtherFile +from tests.scoping.importedDeclarations.toSegments.second import »redeclaredSegmentInSameFile«, »redeclaredSegmentInOtherFile« + +// $TEST$ references secondPackage_segmentInBothPackages +from tests.scoping.importedDeclarations.toSegments.second import »segmentInBothPackages« + + +// $TEST$ unresolved +from tests.scoping.importedDeclarations.toSegments.second import »segmentInFirstPackage« + + +// $TEST$ target own_ownSegment +segment »ownSegment«() {} diff --git a/tests/resources/scoping/imported declarations/to segments/resource first package.sdstest b/tests/resources/scoping/imported declarations/to segments/resource first package.sdstest new file mode 100644 index 000000000..8ba7afa95 --- /dev/null +++ b/tests/resources/scoping/imported declarations/to segments/resource first package.sdstest @@ -0,0 +1,7 @@ +package tests.scoping.importedDeclarations.toSegments.first + +// $TEST$ target firstPackage_segmentInFirstPackage +segment »segmentInFirstPackage«() {} + +// $TEST$ target firstPackage_segmentInBothPackages +segment »segmentInBothPackages«() {} diff --git a/tests/resources/scoping/imported declarations/to segments/resource same package.sdstest b/tests/resources/scoping/imported declarations/to segments/resource same package.sdstest new file mode 100644 index 000000000..682f954b8 --- /dev/null +++ b/tests/resources/scoping/imported declarations/to segments/resource same package.sdstest @@ -0,0 +1,10 @@ +package tests.scoping.importedDeclarations.toSegments + +// $TEST$ target same_publicSegmentInSamePackage +segment »publicSegmentInSamePackage«() {} + +// $TEST$ target same_internalSegmentInSamePackage +internal segment »internalSegmentInSamePackage«() {} + +// $TEST$ target same_privateSegmentInSamePackage +private segment »privateSegmentInSamePackage«() {} diff --git a/tests/resources/scoping/imported declarations/to segments/resource second package.sdstest b/tests/resources/scoping/imported declarations/to segments/resource second package.sdstest new file mode 100644 index 000000000..b3ee4279e --- /dev/null +++ b/tests/resources/scoping/imported declarations/to segments/resource second package.sdstest @@ -0,0 +1,20 @@ +package tests.scoping.importedDeclarations.toSegments.second + +// $TEST$ target secondPackage_publicSegmentInSecondPackage +segment »publicSegmentInSecondPackage«() {} + +// $TEST$ target secondPackage_internalSegmentInSecondPackage +internal segment »internalSegmentInSecondPackage«() {} + +// $TEST$ target secondPackage_privateSegmentInSecondPackage +private segment »privateSegmentInSecondPackage«() {} + +// $TEST$ target secondPackage_redeclaredSegmentInSameFile +segment »redeclaredSegmentInSameFile«() {} +segment redeclaredSegmentInSameFile() {} + +// $TEST$ target secondPackage_redeclaredSegmentInOtherFile +segment »redeclaredSegmentInOtherFile«() {} + +// $TEST$ target secondPackage_segmentInBothPackages +segment »segmentInBothPackages«() {} diff --git a/tests/resources/scoping/imported declarations/unresolved/main.sdstest b/tests/resources/scoping/imported declarations/unresolved/main.sdstest new file mode 100644 index 000000000..f536308a4 --- /dev/null +++ b/tests/resources/scoping/imported declarations/unresolved/main.sdstest @@ -0,0 +1,4 @@ +package tests.scoping.importedDeclarations.unresolved + +// $TEST$ unresolved +from tests.scoping.importedDeclarations.toAnnotations import »unresolved« diff --git a/tests/resources/scoping/named types/across files/to global classes/main with imports and own declarations.sdstest b/tests/resources/scoping/named types/across files/to global classes/main with imports and own declarations.sdstest index 9e298a5d3..86ba33e06 100644 --- a/tests/resources/scoping/named types/across files/to global classes/main with imports and own declarations.sdstest +++ b/tests/resources/scoping/named types/across files/to global classes/main with imports and own declarations.sdstest @@ -1,7 +1,7 @@ package tests.scoping.namedTypes.acrossFiles.toGlobalClasses -import safeds.scoping.namedTypes.acrossFiles.toGlobalClasses.MyClass as MyOwnClass -import tests.scoping.namedTypes.acrossFiles.toGlobalClasses.other.ClassInAnotherPackage +from safeds.scoping.namedTypes.acrossFiles.toGlobalClasses import MyClass as MyOwnClass +from tests.scoping.namedTypes.acrossFiles.toGlobalClasses.other import ClassInAnotherPackage, Class2InAnotherPackage // $TEST$ target own_MyOwnClass class »MyOwnClass« @@ -19,6 +19,9 @@ segment mySegment( // $TEST$ references other_ClassInAnotherPackage p4: »ClassInAnotherPackage«, + // $TEST$ references other_Class2InAnotherPackage + p5: »Class2InAnotherPackage«, + // $TEST$ unresolved - p5: »ClassWithoutPackage«, + p6: »ClassWithoutPackage«, ) {} diff --git a/tests/resources/scoping/named types/across files/to global classes/main with multiple imports of same name.sdstest b/tests/resources/scoping/named types/across files/to global classes/main with multiple imports of same name.sdstest index bd261971e..2d9adf6d0 100644 --- a/tests/resources/scoping/named types/across files/to global classes/main with multiple imports of same name.sdstest +++ b/tests/resources/scoping/named types/across files/to global classes/main with multiple imports of same name.sdstest @@ -1,8 +1,8 @@ package tests.scoping.namedTypes.acrossFiles.toGlobalClasses -import safeds.scoping.namedTypes.acrossFiles.toGlobalClasses.MyClass -import tests.scoping.namedTypes.acrossFiles.toGlobalClasses.other.MyClass -import tests.scoping.namedTypes.acrossFiles.toGlobalClasses.MyClass +from safeds.scoping.namedTypes.acrossFiles.toGlobalClasses import MyClass +from tests.scoping.namedTypes.acrossFiles.toGlobalClasses.other import MyClass +from tests.scoping.namedTypes.acrossFiles.toGlobalClasses import MyClass segment mySegment( // $TEST$ references safeds_MyClass diff --git a/tests/resources/scoping/named types/across files/to global classes/main with qualified import with alias.sdstest b/tests/resources/scoping/named types/across files/to global classes/main with qualified import with alias.sdstest index 4d194a536..476df03c8 100644 --- a/tests/resources/scoping/named types/across files/to global classes/main with qualified import with alias.sdstest +++ b/tests/resources/scoping/named types/across files/to global classes/main with qualified import with alias.sdstest @@ -1,8 +1,8 @@ package tests.scoping.namedTypes.acrossFiles.toGlobalClasses -import tests.scoping.namedTypes.acrossFiles.toGlobalClasses.MyClass as MyClassInSamePackage -import safeds.scoping.namedTypes.acrossFiles.toGlobalClasses.MyClass as MyClassInSafeDsPackage -import tests.scoping.namedTypes.acrossFiles.toGlobalClasses.other.MyClass as MyClassInAnotherPackage +from tests.scoping.namedTypes.acrossFiles.toGlobalClasses import MyClass as MyClassInSamePackage +from safeds.scoping.namedTypes.acrossFiles.toGlobalClasses import MyClass as MyClassInSafeDsPackage +from tests.scoping.namedTypes.acrossFiles.toGlobalClasses.other import MyClass as MyClassInAnotherPackage segment mySegment( // $TEST$ references same_MyClass diff --git a/tests/resources/scoping/named types/across files/to global classes/main with qualified import.sdstest b/tests/resources/scoping/named types/across files/to global classes/main with qualified import.sdstest index 544720a3f..107722742 100644 --- a/tests/resources/scoping/named types/across files/to global classes/main with qualified import.sdstest +++ b/tests/resources/scoping/named types/across files/to global classes/main with qualified import.sdstest @@ -1,8 +1,7 @@ package tests.scoping.namedTypes.acrossFiles.toGlobalClasses -import safeds.scoping.namedTypes.acrossFiles.toGlobalClasses.MyClass -import tests.scoping.namedTypes.acrossFiles.toGlobalClasses.other.ClassInAnotherPackage -import ClassWithoutPackage +from safeds.scoping.namedTypes.acrossFiles.toGlobalClasses import MyClass +from tests.scoping.namedTypes.acrossFiles.toGlobalClasses.other import ClassInAnotherPackage, Class2InAnotherPackage segment mySegment( // $TEST$ references safeds_MyClass @@ -17,6 +16,9 @@ segment mySegment( // $TEST$ references other_ClassInAnotherPackage p4: »ClassInAnotherPackage«, + // $TEST$ references other_Class2InAnotherPackage + p5: »Class2InAnotherPackage«, + // $TEST$ unresolved - p5: »ClassWithoutPackage«, + p6: »ClassWithoutPackage«, ) {} diff --git a/tests/resources/scoping/named types/across files/to global classes/main with wildcard import.sdstest b/tests/resources/scoping/named types/across files/to global classes/main with wildcard import.sdstest index d1c899a10..c68c481c0 100644 --- a/tests/resources/scoping/named types/across files/to global classes/main with wildcard import.sdstest +++ b/tests/resources/scoping/named types/across files/to global classes/main with wildcard import.sdstest @@ -1,6 +1,6 @@ package tests.scoping.namedTypes.acrossFiles.toGlobalClasses -import safeds.scoping.namedTypes.acrossFiles.toGlobalClasses.* +from safeds.scoping.namedTypes.acrossFiles.toGlobalClasses import * segment mySegment( // $TEST$ references safeds_MyClass diff --git a/tests/resources/scoping/named types/across files/to global classes/resource other package.sdstest b/tests/resources/scoping/named types/across files/to global classes/resource other package.sdstest index 512db2e9a..861695e02 100644 --- a/tests/resources/scoping/named types/across files/to global classes/resource other package.sdstest +++ b/tests/resources/scoping/named types/across files/to global classes/resource other package.sdstest @@ -5,3 +5,6 @@ class »MyClass« // $TEST$ target other_ClassInAnotherPackage class »ClassInAnotherPackage« + +// $TEST$ target other_Class2InAnotherPackage +class »Class2InAnotherPackage« diff --git a/tests/resources/scoping/named types/across files/to global enums/main with imports and own declarations.sdstest b/tests/resources/scoping/named types/across files/to global enums/main with imports and own declarations.sdstest index f4e25b3cf..e56ba80ae 100644 --- a/tests/resources/scoping/named types/across files/to global enums/main with imports and own declarations.sdstest +++ b/tests/resources/scoping/named types/across files/to global enums/main with imports and own declarations.sdstest @@ -1,7 +1,7 @@ package tests.scoping.namedTypes.acrossFiles.toGlobalEnums -import safeds.scoping.namedTypes.acrossFiles.toGlobalEnums.MyEnum as MyOwnEnum -import tests.scoping.namedTypes.acrossFiles.toGlobalEnums.other.EnumInAnotherPackage +from safeds.scoping.namedTypes.acrossFiles.toGlobalEnums import MyEnum as MyOwnEnum +from tests.scoping.namedTypes.acrossFiles.toGlobalEnums.other import EnumInAnotherPackage, Enum2InAnotherPackage // $TEST$ target own_MyOwnEnum enum »MyOwnEnum« @@ -19,6 +19,9 @@ segment mySegment( // $TEST$ references other_EnumInAnotherPackage p4: »EnumInAnotherPackage«, + // $TEST$ references other_Enum2InAnotherPackage + p5: »Enum2InAnotherPackage«, + // $TEST$ unresolved - p5: »EnumWithoutPackage«, + p6: »EnumWithoutPackage«, ) {} diff --git a/tests/resources/scoping/named types/across files/to global enums/main with multiple imports of same name.sdstest b/tests/resources/scoping/named types/across files/to global enums/main with multiple imports of same name.sdstest index 235cac0e9..b13ad0d28 100644 --- a/tests/resources/scoping/named types/across files/to global enums/main with multiple imports of same name.sdstest +++ b/tests/resources/scoping/named types/across files/to global enums/main with multiple imports of same name.sdstest @@ -1,8 +1,8 @@ package tests.scoping.namedTypes.acrossFiles.toGlobalEnums -import safeds.scoping.namedTypes.acrossFiles.toGlobalEnums.MyEnum -import tests.scoping.namedTypes.acrossFiles.toGlobalEnums.other.MyEnum -import tests.scoping.namedTypes.acrossFiles.toGlobalEnums.MyEnum +from safeds.scoping.namedTypes.acrossFiles.toGlobalEnums import MyEnum +from tests.scoping.namedTypes.acrossFiles.toGlobalEnums.other import MyEnum +from tests.scoping.namedTypes.acrossFiles.toGlobalEnums import MyEnum segment mySegment( // $TEST$ references safeds_MyEnum diff --git a/tests/resources/scoping/named types/across files/to global enums/main with qualified import with alias.sdstest b/tests/resources/scoping/named types/across files/to global enums/main with qualified import with alias.sdstest index 4c58b1389..fbd4b754d 100644 --- a/tests/resources/scoping/named types/across files/to global enums/main with qualified import with alias.sdstest +++ b/tests/resources/scoping/named types/across files/to global enums/main with qualified import with alias.sdstest @@ -1,8 +1,8 @@ package tests.scoping.namedTypes.acrossFiles.toGlobalEnums -import tests.scoping.namedTypes.acrossFiles.toGlobalEnums.MyEnum as MyEnumInSamePackage -import safeds.scoping.namedTypes.acrossFiles.toGlobalEnums.MyEnum as MyEnumInSafeDsPackage -import tests.scoping.namedTypes.acrossFiles.toGlobalEnums.other.MyEnum as MyEnumInAnotherPackage +from tests.scoping.namedTypes.acrossFiles.toGlobalEnums import MyEnum as MyEnumInSamePackage +from safeds.scoping.namedTypes.acrossFiles.toGlobalEnums import MyEnum as MyEnumInSafeDsPackage +from tests.scoping.namedTypes.acrossFiles.toGlobalEnums.other import MyEnum as MyEnumInAnotherPackage segment mySegment( // $TEST$ references same_MyEnum diff --git a/tests/resources/scoping/named types/across files/to global enums/main with qualified import.sdstest b/tests/resources/scoping/named types/across files/to global enums/main with qualified import.sdstest index afded84e7..300f7286c 100644 --- a/tests/resources/scoping/named types/across files/to global enums/main with qualified import.sdstest +++ b/tests/resources/scoping/named types/across files/to global enums/main with qualified import.sdstest @@ -1,8 +1,7 @@ package tests.scoping.namedTypes.acrossFiles.toGlobalEnums -import safeds.scoping.namedTypes.acrossFiles.toGlobalEnums.MyEnum -import tests.scoping.namedTypes.acrossFiles.toGlobalEnums.other.EnumInAnotherPackage -import EnumWithoutPackage +from safeds.scoping.namedTypes.acrossFiles.toGlobalEnums import MyEnum +from tests.scoping.namedTypes.acrossFiles.toGlobalEnums.other import EnumInAnotherPackage, Enum2InAnotherPackage segment mySegment( // $TEST$ references safeds_MyEnum @@ -17,6 +16,9 @@ segment mySegment( // $TEST$ references other_EnumInAnotherPackage p4: »EnumInAnotherPackage«, + // $TEST$ references other_Enum2InAnotherPackage + p5: »Enum2InAnotherPackage«, + // $TEST$ unresolved - p5: »EnumWithoutPackage«, + p6: »EnumWithoutPackage«, ) {} diff --git a/tests/resources/scoping/named types/across files/to global enums/main with wildcard import.sdstest b/tests/resources/scoping/named types/across files/to global enums/main with wildcard import.sdstest index 3e4f0aec6..a3970f20a 100644 --- a/tests/resources/scoping/named types/across files/to global enums/main with wildcard import.sdstest +++ b/tests/resources/scoping/named types/across files/to global enums/main with wildcard import.sdstest @@ -1,6 +1,6 @@ package tests.scoping.namedTypes.acrossFiles.toGlobalEnums -import safeds.scoping.namedTypes.acrossFiles.toGlobalEnums.* +from safeds.scoping.namedTypes.acrossFiles.toGlobalEnums import * segment mySegment( // $TEST$ references safeds_MyEnum diff --git a/tests/resources/scoping/named types/across files/to global enums/resource other package.sdstest b/tests/resources/scoping/named types/across files/to global enums/resource other package.sdstest index eb3108406..9d9d0c773 100644 --- a/tests/resources/scoping/named types/across files/to global enums/resource other package.sdstest +++ b/tests/resources/scoping/named types/across files/to global enums/resource other package.sdstest @@ -5,3 +5,6 @@ enum »MyEnum« // $TEST$ target other_EnumInAnotherPackage enum »EnumInAnotherPackage« + +// $TEST$ target other_Enum2InAnotherPackage +enum »Enum2InAnotherPackage« diff --git a/tests/resources/scoping/references/across files/to annotations/main with imports and own declarations.sdstest b/tests/resources/scoping/references/across files/to annotations/main with imports and own declarations.sdstest index 247c840fa..795246eff 100644 --- a/tests/resources/scoping/references/across files/to annotations/main with imports and own declarations.sdstest +++ b/tests/resources/scoping/references/across files/to annotations/main with imports and own declarations.sdstest @@ -1,7 +1,7 @@ package tests.scoping.references.acrossFiles.toAnnotations -import safeds.scoping.references.acrossFiles.toAnnotations.MyAnnotation as MyOwnAnnotation -import tests.scoping.references.acrossFiles.toAnnotations.other.AnnotationInAnotherPackage +from safeds.scoping.references.acrossFiles.toAnnotations import MyAnnotation as MyOwnAnnotation +from tests.scoping.references.acrossFiles.toAnnotations.other import AnnotationInAnotherPackage, Annotation2InAnotherPackage // $TEST$ target own_MyOwnAnnotation annotation »MyOwnAnnotation« @@ -19,6 +19,9 @@ pipeline myPipeline { // $TEST$ references other_AnnotationInAnotherPackage »AnnotationInAnotherPackage«; + // $TEST$ references other_Annotation2InAnotherPackage + »Annotation2InAnotherPackage«; + // $TEST$ unresolved »AnnotationWithoutPackage«; } diff --git a/tests/resources/scoping/references/across files/to annotations/main with multiple imports of same name.sdstest b/tests/resources/scoping/references/across files/to annotations/main with multiple imports of same name.sdstest index 76d0c5310..9c10eff56 100644 --- a/tests/resources/scoping/references/across files/to annotations/main with multiple imports of same name.sdstest +++ b/tests/resources/scoping/references/across files/to annotations/main with multiple imports of same name.sdstest @@ -1,8 +1,8 @@ package tests.scoping.references.acrossFiles.toAnnotations -import safeds.scoping.references.acrossFiles.toAnnotations.MyAnnotation -import tests.scoping.references.acrossFiles.toAnnotations.other.MyAnnotation -import tests.scoping.references.acrossFiles.toAnnotations.MyAnnotation +from safeds.scoping.references.acrossFiles.toAnnotations import MyAnnotation +from tests.scoping.references.acrossFiles.toAnnotations.other import MyAnnotation +from tests.scoping.references.acrossFiles.toAnnotations import MyAnnotation pipeline myPipeline { // $TEST$ references safeds_MyAnnotation diff --git a/tests/resources/scoping/references/across files/to annotations/main with qualified import with alias.sdstest b/tests/resources/scoping/references/across files/to annotations/main with qualified import with alias.sdstest index dc830eec3..8e57d387b 100644 --- a/tests/resources/scoping/references/across files/to annotations/main with qualified import with alias.sdstest +++ b/tests/resources/scoping/references/across files/to annotations/main with qualified import with alias.sdstest @@ -1,8 +1,8 @@ package tests.scoping.references.acrossFiles.toAnnotations -import tests.scoping.references.acrossFiles.toAnnotations.MyAnnotation as MyAnnotationInSamePackage -import safeds.scoping.references.acrossFiles.toAnnotations.MyAnnotation as MyAnnotationInSafeDsPackage -import tests.scoping.references.acrossFiles.toAnnotations.other.MyAnnotation as MyAnnotationInAnotherPackage +from tests.scoping.references.acrossFiles.toAnnotations import MyAnnotation as MyAnnotationInSamePackage +from safeds.scoping.references.acrossFiles.toAnnotations import MyAnnotation as MyAnnotationInSafeDsPackage +from tests.scoping.references.acrossFiles.toAnnotations.other import MyAnnotation as MyAnnotationInAnotherPackage pipeline myPipeline { // $TEST$ references same_MyAnnotation diff --git a/tests/resources/scoping/references/across files/to annotations/main with qualified import.sdstest b/tests/resources/scoping/references/across files/to annotations/main with qualified import.sdstest index c9942f5d0..f2e10fd98 100644 --- a/tests/resources/scoping/references/across files/to annotations/main with qualified import.sdstest +++ b/tests/resources/scoping/references/across files/to annotations/main with qualified import.sdstest @@ -1,8 +1,7 @@ package tests.scoping.references.acrossFiles.toAnnotations -import safeds.scoping.references.acrossFiles.toAnnotations.MyAnnotation -import tests.scoping.references.acrossFiles.toAnnotations.other.AnnotationInAnotherPackage -import AnnotationWithoutPackage +from safeds.scoping.references.acrossFiles.toAnnotations import MyAnnotation +from tests.scoping.references.acrossFiles.toAnnotations.other import AnnotationInAnotherPackage, Annotation2InAnotherPackage pipeline myPipeline { // $TEST$ references safeds_MyAnnotation @@ -17,6 +16,9 @@ pipeline myPipeline { // $TEST$ references other_AnnotationInAnotherPackage »AnnotationInAnotherPackage«; + // $TEST$ references other_Annotation2InAnotherPackage + »Annotation2InAnotherPackage«; + // $TEST$ unresolved »AnnotationWithoutPackage«; } diff --git a/tests/resources/scoping/references/across files/to annotations/main with wildcard import.sdstest b/tests/resources/scoping/references/across files/to annotations/main with wildcard import.sdstest index a2efcb382..db146974d 100644 --- a/tests/resources/scoping/references/across files/to annotations/main with wildcard import.sdstest +++ b/tests/resources/scoping/references/across files/to annotations/main with wildcard import.sdstest @@ -1,6 +1,6 @@ package tests.scoping.references.acrossFiles.toAnnotations -import safeds.scoping.references.acrossFiles.toAnnotations.* +from safeds.scoping.references.acrossFiles.toAnnotations import * pipeline myPipeline { // $TEST$ references safeds_MyAnnotation diff --git a/tests/resources/scoping/references/across files/to annotations/resource other package.sdstest b/tests/resources/scoping/references/across files/to annotations/resource other package.sdstest index 0218c00f5..88ac9ad58 100644 --- a/tests/resources/scoping/references/across files/to annotations/resource other package.sdstest +++ b/tests/resources/scoping/references/across files/to annotations/resource other package.sdstest @@ -5,3 +5,6 @@ annotation »MyAnnotation« // $TEST$ target other_AnnotationInAnotherPackage annotation »AnnotationInAnotherPackage« + +// $TEST$ target other_Annotation2InAnotherPackage +annotation »Annotation2InAnotherPackage« diff --git a/tests/resources/scoping/references/across files/to global classes/main with imports and own declarations.sdstest b/tests/resources/scoping/references/across files/to global classes/main with imports and own declarations.sdstest index d6c523d16..1f05fa8b7 100644 --- a/tests/resources/scoping/references/across files/to global classes/main with imports and own declarations.sdstest +++ b/tests/resources/scoping/references/across files/to global classes/main with imports and own declarations.sdstest @@ -1,7 +1,7 @@ package tests.scoping.references.acrossFiles.toGlobalClasses -import safeds.scoping.references.acrossFiles.toGlobalClasses.MyClass as MyOwnClass -import tests.scoping.references.acrossFiles.toGlobalClasses.other.ClassInAnotherPackage +from safeds.scoping.references.acrossFiles.toGlobalClasses import MyClass as MyOwnClass +from tests.scoping.references.acrossFiles.toGlobalClasses.other import ClassInAnotherPackage, Class2InAnotherPackage // $TEST$ target own_MyOwnClass class »MyOwnClass« @@ -19,6 +19,9 @@ pipeline myPipeline { // $TEST$ references other_ClassInAnotherPackage »ClassInAnotherPackage«; + // $TEST$ references other_Class2InAnotherPackage + »Class2InAnotherPackage«; + // $TEST$ unresolved »ClassWithoutPackage«; } diff --git a/tests/resources/scoping/references/across files/to global classes/main with multiple imports of same name.sdstest b/tests/resources/scoping/references/across files/to global classes/main with multiple imports of same name.sdstest index f4326c124..8b624512a 100644 --- a/tests/resources/scoping/references/across files/to global classes/main with multiple imports of same name.sdstest +++ b/tests/resources/scoping/references/across files/to global classes/main with multiple imports of same name.sdstest @@ -1,8 +1,8 @@ package tests.scoping.references.acrossFiles.toGlobalClasses -import safeds.scoping.references.acrossFiles.toGlobalClasses.MyClass -import tests.scoping.references.acrossFiles.toGlobalClasses.other.MyClass -import tests.scoping.references.acrossFiles.toGlobalClasses.MyClass +from safeds.scoping.references.acrossFiles.toGlobalClasses import MyClass +from tests.scoping.references.acrossFiles.toGlobalClasses.other import MyClass +from tests.scoping.references.acrossFiles.toGlobalClasses import MyClass pipeline myPipeline { // $TEST$ references safeds_MyClass diff --git a/tests/resources/scoping/references/across files/to global classes/main with qualified import with alias.sdstest b/tests/resources/scoping/references/across files/to global classes/main with qualified import with alias.sdstest index f46bf7b45..2a7d6d902 100644 --- a/tests/resources/scoping/references/across files/to global classes/main with qualified import with alias.sdstest +++ b/tests/resources/scoping/references/across files/to global classes/main with qualified import with alias.sdstest @@ -1,8 +1,8 @@ package tests.scoping.references.acrossFiles.toGlobalClasses -import tests.scoping.references.acrossFiles.toGlobalClasses.MyClass as MyClassInSamePackage -import safeds.scoping.references.acrossFiles.toGlobalClasses.MyClass as MyClassInSafeDsPackage -import tests.scoping.references.acrossFiles.toGlobalClasses.other.MyClass as MyClassInAnotherPackage +from tests.scoping.references.acrossFiles.toGlobalClasses import MyClass as MyClassInSamePackage +from safeds.scoping.references.acrossFiles.toGlobalClasses import MyClass as MyClassInSafeDsPackage +from tests.scoping.references.acrossFiles.toGlobalClasses.other import MyClass as MyClassInAnotherPackage pipeline myPipeline { // $TEST$ references same_MyClass diff --git a/tests/resources/scoping/references/across files/to global classes/main with qualified import.sdstest b/tests/resources/scoping/references/across files/to global classes/main with qualified import.sdstest index 1b146cc38..10bf0a70e 100644 --- a/tests/resources/scoping/references/across files/to global classes/main with qualified import.sdstest +++ b/tests/resources/scoping/references/across files/to global classes/main with qualified import.sdstest @@ -1,8 +1,7 @@ package tests.scoping.references.acrossFiles.toGlobalClasses -import safeds.scoping.references.acrossFiles.toGlobalClasses.MyClass -import tests.scoping.references.acrossFiles.toGlobalClasses.other.ClassInAnotherPackage -import ClassWithoutPackage +from safeds.scoping.references.acrossFiles.toGlobalClasses import MyClass +from tests.scoping.references.acrossFiles.toGlobalClasses.other import ClassInAnotherPackage, Class2InAnotherPackage pipeline myPipeline { // $TEST$ references safeds_MyClass @@ -17,6 +16,9 @@ pipeline myPipeline { // $TEST$ references other_ClassInAnotherPackage »ClassInAnotherPackage«; + // $TEST$ references other_Class2InAnotherPackage + »Class2InAnotherPackage«; + // $TEST$ unresolved »ClassWithoutPackage«; } diff --git a/tests/resources/scoping/references/across files/to global classes/main with wildcard import.sdstest b/tests/resources/scoping/references/across files/to global classes/main with wildcard import.sdstest index f8e3c627b..2e24c405b 100644 --- a/tests/resources/scoping/references/across files/to global classes/main with wildcard import.sdstest +++ b/tests/resources/scoping/references/across files/to global classes/main with wildcard import.sdstest @@ -1,6 +1,6 @@ package tests.scoping.references.acrossFiles.toGlobalClasses -import safeds.scoping.references.acrossFiles.toGlobalClasses.* +from safeds.scoping.references.acrossFiles.toGlobalClasses import * pipeline myPipeline { // $TEST$ references safeds_MyClass diff --git a/tests/resources/scoping/references/across files/to global classes/resource other package.sdstest b/tests/resources/scoping/references/across files/to global classes/resource other package.sdstest index c4ffdc7b0..67c9b8be1 100644 --- a/tests/resources/scoping/references/across files/to global classes/resource other package.sdstest +++ b/tests/resources/scoping/references/across files/to global classes/resource other package.sdstest @@ -5,3 +5,6 @@ class »MyClass« // $TEST$ target other_ClassInAnotherPackage class »ClassInAnotherPackage« + +// $TEST$ target other_Class2InAnotherPackage +class »Class2InAnotherPackage« diff --git a/tests/resources/scoping/references/across files/to global enums/main with imports and own declarations.sdstest b/tests/resources/scoping/references/across files/to global enums/main with imports and own declarations.sdstest index 4f572fee9..5d3127faa 100644 --- a/tests/resources/scoping/references/across files/to global enums/main with imports and own declarations.sdstest +++ b/tests/resources/scoping/references/across files/to global enums/main with imports and own declarations.sdstest @@ -1,7 +1,7 @@ package tests.scoping.references.acrossFiles.toGlobalEnums -import safeds.scoping.references.acrossFiles.toGlobalEnums.MyEnum as MyOwnEnum -import tests.scoping.references.acrossFiles.toGlobalEnums.other.EnumInAnotherPackage +from safeds.scoping.references.acrossFiles.toGlobalEnums import MyEnum as MyOwnEnum +from tests.scoping.references.acrossFiles.toGlobalEnums.other import EnumInAnotherPackage, Enum2InAnotherPackage // $TEST$ target own_MyOwnEnum enum »MyOwnEnum« @@ -19,6 +19,9 @@ pipeline myPipeline { // $TEST$ references other_EnumInAnotherPackage »EnumInAnotherPackage«; + // $TEST$ references other_Enum2InAnotherPackage + »Enum2InAnotherPackage«; + // $TEST$ unresolved »EnumWithoutPackage«; } diff --git a/tests/resources/scoping/references/across files/to global enums/main with multiple imports of same name.sdstest b/tests/resources/scoping/references/across files/to global enums/main with multiple imports of same name.sdstest index 904946238..6a8fe5b74 100644 --- a/tests/resources/scoping/references/across files/to global enums/main with multiple imports of same name.sdstest +++ b/tests/resources/scoping/references/across files/to global enums/main with multiple imports of same name.sdstest @@ -1,8 +1,8 @@ package tests.scoping.references.acrossFiles.toGlobalEnums -import safeds.scoping.references.acrossFiles.toGlobalEnums.MyEnum -import tests.scoping.references.acrossFiles.toGlobalEnums.other.MyEnum -import tests.scoping.references.acrossFiles.toGlobalEnums.MyEnum +from safeds.scoping.references.acrossFiles.toGlobalEnums import MyEnum +from tests.scoping.references.acrossFiles.toGlobalEnums.other import MyEnum +from tests.scoping.references.acrossFiles.toGlobalEnums import MyEnum pipeline myPipeline { // $TEST$ references safeds_MyEnum diff --git a/tests/resources/scoping/references/across files/to global enums/main with qualified import with alias.sdstest b/tests/resources/scoping/references/across files/to global enums/main with qualified import with alias.sdstest index a552b6d6d..6139ad2fc 100644 --- a/tests/resources/scoping/references/across files/to global enums/main with qualified import with alias.sdstest +++ b/tests/resources/scoping/references/across files/to global enums/main with qualified import with alias.sdstest @@ -1,8 +1,8 @@ package tests.scoping.references.acrossFiles.toGlobalEnums -import tests.scoping.references.acrossFiles.toGlobalEnums.MyEnum as MyEnumInSamePackage -import safeds.scoping.references.acrossFiles.toGlobalEnums.MyEnum as MyEnumInSafeDsPackage -import tests.scoping.references.acrossFiles.toGlobalEnums.other.MyEnum as MyEnumInAnotherPackage +from tests.scoping.references.acrossFiles.toGlobalEnums import MyEnum as MyEnumInSamePackage +from safeds.scoping.references.acrossFiles.toGlobalEnums import MyEnum as MyEnumInSafeDsPackage +from tests.scoping.references.acrossFiles.toGlobalEnums.other import MyEnum as MyEnumInAnotherPackage pipeline myPipeline { // $TEST$ references same_MyEnum diff --git a/tests/resources/scoping/references/across files/to global enums/main with qualified import.sdstest b/tests/resources/scoping/references/across files/to global enums/main with qualified import.sdstest index 75ba66f8d..c844cc991 100644 --- a/tests/resources/scoping/references/across files/to global enums/main with qualified import.sdstest +++ b/tests/resources/scoping/references/across files/to global enums/main with qualified import.sdstest @@ -1,8 +1,7 @@ package tests.scoping.references.acrossFiles.toGlobalEnums -import safeds.scoping.references.acrossFiles.toGlobalEnums.MyEnum -import tests.scoping.references.acrossFiles.toGlobalEnums.other.EnumInAnotherPackage -import EnumWithoutPackage +from safeds.scoping.references.acrossFiles.toGlobalEnums import MyEnum +from tests.scoping.references.acrossFiles.toGlobalEnums.other import EnumInAnotherPackage, Enum2InAnotherPackage pipeline myPipeline { // $TEST$ references safeds_MyEnum @@ -17,6 +16,9 @@ pipeline myPipeline { // $TEST$ references other_EnumInAnotherPackage »EnumInAnotherPackage«; + // $TEST$ references other_Enum2InAnotherPackage + »Enum2InAnotherPackage«; + // $TEST$ unresolved »EnumWithoutPackage«; } diff --git a/tests/resources/scoping/references/across files/to global enums/main with wildcard import.sdstest b/tests/resources/scoping/references/across files/to global enums/main with wildcard import.sdstest index f42942c0a..391d353e6 100644 --- a/tests/resources/scoping/references/across files/to global enums/main with wildcard import.sdstest +++ b/tests/resources/scoping/references/across files/to global enums/main with wildcard import.sdstest @@ -1,6 +1,6 @@ package tests.scoping.references.acrossFiles.toGlobalEnums -import safeds.scoping.references.acrossFiles.toGlobalEnums.* +from safeds.scoping.references.acrossFiles.toGlobalEnums import * pipeline myPipeline { // $TEST$ references safeds_MyEnum diff --git a/tests/resources/scoping/references/across files/to global enums/resource other package.sdstest b/tests/resources/scoping/references/across files/to global enums/resource other package.sdstest index 442ce1455..a561a587f 100644 --- a/tests/resources/scoping/references/across files/to global enums/resource other package.sdstest +++ b/tests/resources/scoping/references/across files/to global enums/resource other package.sdstest @@ -5,3 +5,6 @@ enum »MyEnum« // $TEST$ target other_EnumInAnotherPackage enum »EnumInAnotherPackage« + +// $TEST$ target other_Enum2InAnotherPackage +enum »Enum2InAnotherPackage« diff --git a/tests/resources/scoping/references/across files/to global functions/main with imports and own declarations.sdstest b/tests/resources/scoping/references/across files/to global functions/main with imports and own declarations.sdstest index 356f325f7..822b94b9a 100644 --- a/tests/resources/scoping/references/across files/to global functions/main with imports and own declarations.sdstest +++ b/tests/resources/scoping/references/across files/to global functions/main with imports and own declarations.sdstest @@ -1,7 +1,7 @@ package tests.scoping.references.acrossFiles.toGlobalFunctions -import safeds.scoping.references.acrossFiles.toGlobalFunctions.myFunction as myOwnFunction -import tests.scoping.references.acrossFiles.toGlobalFunctions.other.functionInAnotherPackage +from safeds.scoping.references.acrossFiles.toGlobalFunctions import myFunction as myOwnFunction +from tests.scoping.references.acrossFiles.toGlobalFunctions.other import functionInAnotherPackage, function2InAnotherPackage // $TEST$ target own_myOwnFunction fun »myOwnFunction«() @@ -19,6 +19,9 @@ pipeline myPipeline { // $TEST$ references other_functionInAnotherPackage »functionInAnotherPackage«; + // $TEST$ references other_function2InAnotherPackage + »function2InAnotherPackage«; + // $TEST$ unresolved »functionWithoutPackage«; } diff --git a/tests/resources/scoping/references/across files/to global functions/main with multiple imports of same name.sdstest b/tests/resources/scoping/references/across files/to global functions/main with multiple imports of same name.sdstest index 761931ccd..d19d3dff0 100644 --- a/tests/resources/scoping/references/across files/to global functions/main with multiple imports of same name.sdstest +++ b/tests/resources/scoping/references/across files/to global functions/main with multiple imports of same name.sdstest @@ -1,8 +1,8 @@ package tests.scoping.references.acrossFiles.toGlobalFunctions -import safeds.scoping.references.acrossFiles.toGlobalFunctions.myFunction -import tests.scoping.references.acrossFiles.toGlobalFunctions.other.myFunction -import tests.scoping.references.acrossFiles.toGlobalFunctions.myFunction +from safeds.scoping.references.acrossFiles.toGlobalFunctions import myFunction +from tests.scoping.references.acrossFiles.toGlobalFunctions.other import myFunction +from tests.scoping.references.acrossFiles.toGlobalFunctions import myFunction pipeline myPipeline { // $TEST$ references safeds_myFunction diff --git a/tests/resources/scoping/references/across files/to global functions/main with qualified import with alias.sdstest b/tests/resources/scoping/references/across files/to global functions/main with qualified import with alias.sdstest index 100fa1158..fd2a9cb94 100644 --- a/tests/resources/scoping/references/across files/to global functions/main with qualified import with alias.sdstest +++ b/tests/resources/scoping/references/across files/to global functions/main with qualified import with alias.sdstest @@ -1,8 +1,8 @@ package tests.scoping.references.acrossFiles.toGlobalFunctions -import tests.scoping.references.acrossFiles.toGlobalFunctions.myFunction as myFunctionInSamePackage -import safeds.scoping.references.acrossFiles.toGlobalFunctions.myFunction as myFunctionInSafeDsPackage -import tests.scoping.references.acrossFiles.toGlobalFunctions.other.myFunction as myFunctionInAnotherPackage +from tests.scoping.references.acrossFiles.toGlobalFunctions import myFunction as myFunctionInSamePackage +from safeds.scoping.references.acrossFiles.toGlobalFunctions import myFunction as myFunctionInSafeDsPackage +from tests.scoping.references.acrossFiles.toGlobalFunctions.other import myFunction as myFunctionInAnotherPackage pipeline myPipeline { // $TEST$ references same_myFunction diff --git a/tests/resources/scoping/references/across files/to global functions/main with qualified import.sdstest b/tests/resources/scoping/references/across files/to global functions/main with qualified import.sdstest index 1b284e43a..056e08fc4 100644 --- a/tests/resources/scoping/references/across files/to global functions/main with qualified import.sdstest +++ b/tests/resources/scoping/references/across files/to global functions/main with qualified import.sdstest @@ -1,8 +1,7 @@ package tests.scoping.references.acrossFiles.toGlobalFunctions -import safeds.scoping.references.acrossFiles.toGlobalFunctions.myFunction -import tests.scoping.references.acrossFiles.toGlobalFunctions.other.functionInAnotherPackage -import functionWithoutPackage +from safeds.scoping.references.acrossFiles.toGlobalFunctions import myFunction +from tests.scoping.references.acrossFiles.toGlobalFunctions.other import functionInAnotherPackage, function2InAnotherPackage pipeline myPipeline { // $TEST$ references safeds_myFunction @@ -17,6 +16,9 @@ pipeline myPipeline { // $TEST$ references other_functionInAnotherPackage »functionInAnotherPackage«; + // $TEST$ references other_function2InAnotherPackage + »function2InAnotherPackage«; + // $TEST$ unresolved »functionWithoutPackage«; } diff --git a/tests/resources/scoping/references/across files/to global functions/main with wildcard import.sdstest b/tests/resources/scoping/references/across files/to global functions/main with wildcard import.sdstest index 25a9bec1f..e152bdc87 100644 --- a/tests/resources/scoping/references/across files/to global functions/main with wildcard import.sdstest +++ b/tests/resources/scoping/references/across files/to global functions/main with wildcard import.sdstest @@ -1,6 +1,6 @@ package tests.scoping.references.acrossFiles.toGlobalFunctions -import safeds.scoping.references.acrossFiles.toGlobalFunctions.* +from safeds.scoping.references.acrossFiles.toGlobalFunctions import * pipeline myPipeline { // $TEST$ references safeds_myFunction diff --git a/tests/resources/scoping/references/across files/to global functions/resource other package.sdstest b/tests/resources/scoping/references/across files/to global functions/resource other package.sdstest index 7bd735c20..350069f5d 100644 --- a/tests/resources/scoping/references/across files/to global functions/resource other package.sdstest +++ b/tests/resources/scoping/references/across files/to global functions/resource other package.sdstest @@ -5,3 +5,6 @@ fun »myFunction«() // $TEST$ target other_functionInAnotherPackage fun »functionInAnotherPackage«() + +// $TEST$ target other_function2InAnotherPackage +fun »function2InAnotherPackage«() diff --git a/tests/resources/scoping/references/across files/to pipelines/main with imports and own declarations.sdstest b/tests/resources/scoping/references/across files/to pipelines/main with imports and own declarations.sdstest index 2316d125e..18d497142 100644 --- a/tests/resources/scoping/references/across files/to pipelines/main with imports and own declarations.sdstest +++ b/tests/resources/scoping/references/across files/to pipelines/main with imports and own declarations.sdstest @@ -1,7 +1,7 @@ package tests.scoping.references.acrossFiles.toPipelines -import safeds.scoping.references.acrossFiles.toPipelines.myPipeline as myOwnPipeline -import tests.scoping.references.acrossFiles.toPipelines.other.pipelineInAnotherPackage +from safeds.scoping.references.acrossFiles.toPipelines import myPipeline as myOwnPipeline +from tests.scoping.references.acrossFiles.toPipelines.other import pipelineInAnotherPackage, pipeline2InAnotherPackage // $TEST$ target own_myOwnPipeline pipeline »myOwnPipeline« {} @@ -19,6 +19,9 @@ segment mySegment() { // $TEST$ unresolved »pipelineInAnotherPackage«; + // $TEST$ unresolved + »pipeline2InAnotherPackage«; + // $TEST$ unresolved »pipelineWithoutPackage«; } diff --git a/tests/resources/scoping/references/across files/to pipelines/main with multiple imports of same name.sdstest b/tests/resources/scoping/references/across files/to pipelines/main with multiple imports of same name.sdstest index 5a5d0b776..9720b43e7 100644 --- a/tests/resources/scoping/references/across files/to pipelines/main with multiple imports of same name.sdstest +++ b/tests/resources/scoping/references/across files/to pipelines/main with multiple imports of same name.sdstest @@ -1,8 +1,8 @@ package tests.scoping.references.acrossFiles.toPipelines -import safeds.scoping.references.acrossFiles.toPipelines.myPipeline -import tests.scoping.references.acrossFiles.toPipelines.other.myPipeline -import tests.scoping.references.acrossFiles.toPipelines.myPipeline +from safeds.scoping.references.acrossFiles.toPipelines import myPipeline +from tests.scoping.references.acrossFiles.toPipelines.other import myPipeline +from tests.scoping.references.acrossFiles.toPipelines import myPipeline segment mySegment() { // $TEST$ unresolved diff --git a/tests/resources/scoping/references/across files/to pipelines/main with qualified import with alias.sdstest b/tests/resources/scoping/references/across files/to pipelines/main with qualified import with alias.sdstest index 31df86e91..9f3eb5e3f 100644 --- a/tests/resources/scoping/references/across files/to pipelines/main with qualified import with alias.sdstest +++ b/tests/resources/scoping/references/across files/to pipelines/main with qualified import with alias.sdstest @@ -1,8 +1,8 @@ package tests.scoping.references.acrossFiles.toPipelines -import tests.scoping.references.acrossFiles.toPipelines.myPipeline as myPipelineInSamePackage -import safeds.scoping.references.acrossFiles.toPipelines.myPipeline as myPipelineInSafeDsPackage -import tests.scoping.references.acrossFiles.toPipelines.other.myPipeline as myPipelineInAnotherPackage +from tests.scoping.references.acrossFiles.toPipelines import myPipeline as myPipelineInSamePackage +from safeds.scoping.references.acrossFiles.toPipelines import myPipeline as myPipelineInSafeDsPackage +from tests.scoping.references.acrossFiles.toPipelines.other import myPipeline as myPipelineInAnotherPackage segment mySegment() { // $TEST$ unresolved diff --git a/tests/resources/scoping/references/across files/to pipelines/main with qualified import.sdstest b/tests/resources/scoping/references/across files/to pipelines/main with qualified import.sdstest index a7abe3f1c..5b97bbc9a 100644 --- a/tests/resources/scoping/references/across files/to pipelines/main with qualified import.sdstest +++ b/tests/resources/scoping/references/across files/to pipelines/main with qualified import.sdstest @@ -1,8 +1,7 @@ package tests.scoping.references.acrossFiles.toPipelines -import safeds.scoping.references.acrossFiles.toPipelines.myPipeline -import tests.scoping.references.acrossFiles.toPipelines.other.pipelineInAnotherPackage -import pipelineWithoutPackage +from safeds.scoping.references.acrossFiles.toPipelines import myPipeline +from tests.scoping.references.acrossFiles.toPipelines.other import pipelineInAnotherPackage, pipeline2InAnotherPackage segment mySegment() { // $TEST$ unresolved @@ -17,6 +16,9 @@ segment mySegment() { // $TEST$ unresolved »pipelineInAnotherPackage«; + // $TEST$ unresolved + »pipeline2InAnotherPackage«; + // $TEST$ unresolved »pipelineWithoutPackage«; } diff --git a/tests/resources/scoping/references/across files/to pipelines/main with wildcard import.sdstest b/tests/resources/scoping/references/across files/to pipelines/main with wildcard import.sdstest index b927897c3..8747eb065 100644 --- a/tests/resources/scoping/references/across files/to pipelines/main with wildcard import.sdstest +++ b/tests/resources/scoping/references/across files/to pipelines/main with wildcard import.sdstest @@ -1,6 +1,6 @@ package tests.scoping.references.acrossFiles.toPipelines -import safeds.scoping.references.acrossFiles.toPipelines.* +from safeds.scoping.references.acrossFiles.toPipelines import * segment mySegment() { // $TEST$ unresolved diff --git a/tests/resources/scoping/references/across files/to pipelines/resource other package.sdstest b/tests/resources/scoping/references/across files/to pipelines/resource other package.sdstest index 5b3b1fed0..3adecca80 100644 --- a/tests/resources/scoping/references/across files/to pipelines/resource other package.sdstest +++ b/tests/resources/scoping/references/across files/to pipelines/resource other package.sdstest @@ -5,3 +5,6 @@ pipeline »myPipeline« {} // $TEST$ target other_pipelineInAnotherPackage pipeline »pipelineInAnotherPackage« {} + +// $TEST$ target other_pipeline2InAnotherPackage +pipeline »pipeline2InAnotherPackage« {} diff --git a/tests/resources/scoping/references/across files/to schemas/main with imports and own declarations.sdstest b/tests/resources/scoping/references/across files/to schemas/main with imports and own declarations.sdstest index f1a352bb6..3aa405425 100644 --- a/tests/resources/scoping/references/across files/to schemas/main with imports and own declarations.sdstest +++ b/tests/resources/scoping/references/across files/to schemas/main with imports and own declarations.sdstest @@ -1,7 +1,7 @@ package tests.scoping.references.acrossFiles.toSchemas -import safeds.scoping.references.acrossFiles.toSchemas.MySchema as MyOwnSchema -import tests.scoping.references.acrossFiles.toSchemas.other.SchemaInAnotherPackage +from safeds.scoping.references.acrossFiles.toSchemas import MySchema as MyOwnSchema +from tests.scoping.references.acrossFiles.toSchemas.other import SchemaInAnotherPackage, Schema2InAnotherPackage // $TEST$ target own_MyOwnSchema schema »MyOwnSchema« {} @@ -19,6 +19,9 @@ pipeline myPipeline { // $TEST$ references other_SchemaInAnotherPackage »SchemaInAnotherPackage«; + // $TEST$ references other_Schema2InAnotherPackage + »Schema2InAnotherPackage«; + // $TEST$ unresolved »SchemaWithoutPackage«; } diff --git a/tests/resources/scoping/references/across files/to schemas/main with multiple imports of same name.sdstest b/tests/resources/scoping/references/across files/to schemas/main with multiple imports of same name.sdstest index 2432bbea7..1fb7f3e68 100644 --- a/tests/resources/scoping/references/across files/to schemas/main with multiple imports of same name.sdstest +++ b/tests/resources/scoping/references/across files/to schemas/main with multiple imports of same name.sdstest @@ -1,8 +1,8 @@ package tests.scoping.references.acrossFiles.toSchemas -import safeds.scoping.references.acrossFiles.toSchemas.MySchema -import tests.scoping.references.acrossFiles.toSchemas.other.MySchema -import tests.scoping.references.acrossFiles.toSchemas.MySchema +from safeds.scoping.references.acrossFiles.toSchemas import MySchema +from tests.scoping.references.acrossFiles.toSchemas.other import MySchema +from tests.scoping.references.acrossFiles.toSchemas import MySchema pipeline myPipeline { // $TEST$ references safeds_MySchema diff --git a/tests/resources/scoping/references/across files/to schemas/main with qualified import with alias.sdstest b/tests/resources/scoping/references/across files/to schemas/main with qualified import with alias.sdstest index be3848aed..a4d0ffb97 100644 --- a/tests/resources/scoping/references/across files/to schemas/main with qualified import with alias.sdstest +++ b/tests/resources/scoping/references/across files/to schemas/main with qualified import with alias.sdstest @@ -1,8 +1,8 @@ package tests.scoping.references.acrossFiles.toSchemas -import tests.scoping.references.acrossFiles.toSchemas.MySchema as MySchemaInSamePackage -import safeds.scoping.references.acrossFiles.toSchemas.MySchema as MySchemaInSafeDsPackage -import tests.scoping.references.acrossFiles.toSchemas.other.MySchema as MySchemaInAnotherPackage +from tests.scoping.references.acrossFiles.toSchemas import MySchema as MySchemaInSamePackage +from safeds.scoping.references.acrossFiles.toSchemas import MySchema as MySchemaInSafeDsPackage +from tests.scoping.references.acrossFiles.toSchemas.other import MySchema as MySchemaInAnotherPackage pipeline myPipeline { // $TEST$ references same_MySchema diff --git a/tests/resources/scoping/references/across files/to schemas/main with qualified import.sdstest b/tests/resources/scoping/references/across files/to schemas/main with qualified import.sdstest index 7fa2ba368..49e621449 100644 --- a/tests/resources/scoping/references/across files/to schemas/main with qualified import.sdstest +++ b/tests/resources/scoping/references/across files/to schemas/main with qualified import.sdstest @@ -1,8 +1,7 @@ package tests.scoping.references.acrossFiles.toSchemas -import safeds.scoping.references.acrossFiles.toSchemas.MySchema -import tests.scoping.references.acrossFiles.toSchemas.other.SchemaInAnotherPackage -import SchemaWithoutPackage +from safeds.scoping.references.acrossFiles.toSchemas import MySchema +from tests.scoping.references.acrossFiles.toSchemas.other import SchemaInAnotherPackage, Schema2InAnotherPackage pipeline myPipeline { // $TEST$ references safeds_MySchema @@ -17,6 +16,9 @@ pipeline myPipeline { // $TEST$ references other_SchemaInAnotherPackage »SchemaInAnotherPackage«; + // $TEST$ references other_Schema2InAnotherPackage + »Schema2InAnotherPackage«; + // $TEST$ unresolved »SchemaWithoutPackage«; } diff --git a/tests/resources/scoping/references/across files/to schemas/main with wildcard import.sdstest b/tests/resources/scoping/references/across files/to schemas/main with wildcard import.sdstest index fb588ead9..c7beb819e 100644 --- a/tests/resources/scoping/references/across files/to schemas/main with wildcard import.sdstest +++ b/tests/resources/scoping/references/across files/to schemas/main with wildcard import.sdstest @@ -1,6 +1,6 @@ package tests.scoping.references.acrossFiles.toSchemas -import safeds.scoping.references.acrossFiles.toSchemas.* +from safeds.scoping.references.acrossFiles.toSchemas import * pipeline myPipeline { // $TEST$ references safeds_MySchema diff --git a/tests/resources/scoping/references/across files/to schemas/resource other package.sdstest b/tests/resources/scoping/references/across files/to schemas/resource other package.sdstest index ec9b6e799..27b7146ea 100644 --- a/tests/resources/scoping/references/across files/to schemas/resource other package.sdstest +++ b/tests/resources/scoping/references/across files/to schemas/resource other package.sdstest @@ -5,3 +5,6 @@ schema »MySchema« {} // $TEST$ target other_SchemaInAnotherPackage schema »SchemaInAnotherPackage« {} + +// $TEST$ target other_Schema2InAnotherPackage +schema »Schema2InAnotherPackage« {} diff --git a/tests/resources/scoping/references/across files/to segments/main with imports and own declarations.sdstest b/tests/resources/scoping/references/across files/to segments/main with imports and own declarations.sdstest index fe7c506b7..f179230e5 100644 --- a/tests/resources/scoping/references/across files/to segments/main with imports and own declarations.sdstest +++ b/tests/resources/scoping/references/across files/to segments/main with imports and own declarations.sdstest @@ -1,9 +1,9 @@ package tests.scoping.references.acrossFiles.toSegments -import safeds.scoping.references.acrossFiles.toSegments.mySegment as myOwnSegment -import tests.scoping.references.acrossFiles.toSegments.other.publicSegmentInAnotherPackage -import tests.scoping.references.acrossFiles.toSegments.other.internalSegmentInAnotherPackage -import tests.scoping.references.acrossFiles.toSegments.other.privateSegmentInAnotherPackage +from safeds.scoping.references.acrossFiles.toSegments import mySegment as myOwnSegment +from tests.scoping.references.acrossFiles.toSegments.other import publicSegmentInAnotherPackage, public2SegmentInAnotherPackage +from tests.scoping.references.acrossFiles.toSegments.other import internalSegmentInAnotherPackage +from tests.scoping.references.acrossFiles.toSegments.other import privateSegmentInAnotherPackage // $TEST$ target own_myOwnSegment segment »myOwnSegment«() {} @@ -36,6 +36,9 @@ pipeline myPipeline { // $TEST$ references other_publicSegmentInAnotherPackage »publicSegmentInAnotherPackage«; + // $TEST$ references other_public2SegmentInAnotherPackage + »public2SegmentInAnotherPackage«; + // $TEST$ unresolved »internalSegmentInAnotherPackage«; diff --git a/tests/resources/scoping/references/across files/to segments/main with multiple imports of same name.sdstest b/tests/resources/scoping/references/across files/to segments/main with multiple imports of same name.sdstest index acf8a5dbb..3f6a60a02 100644 --- a/tests/resources/scoping/references/across files/to segments/main with multiple imports of same name.sdstest +++ b/tests/resources/scoping/references/across files/to segments/main with multiple imports of same name.sdstest @@ -1,8 +1,8 @@ package tests.scoping.references.acrossFiles.toSegments -import safeds.scoping.references.acrossFiles.toSegments.mySegment -import tests.scoping.references.acrossFiles.toSegments.other.mySegment -import tests.scoping.references.acrossFiles.toSegments.mySegment +from safeds.scoping.references.acrossFiles.toSegments import mySegment +from tests.scoping.references.acrossFiles.toSegments.other import mySegment +from tests.scoping.references.acrossFiles.toSegments import mySegment pipeline myPipeline { // $TEST$ references safeds_mySegment diff --git a/tests/resources/scoping/references/across files/to segments/main with qualified import with alias.sdstest b/tests/resources/scoping/references/across files/to segments/main with qualified import with alias.sdstest index 31142f1e7..a82b6d781 100644 --- a/tests/resources/scoping/references/across files/to segments/main with qualified import with alias.sdstest +++ b/tests/resources/scoping/references/across files/to segments/main with qualified import with alias.sdstest @@ -1,8 +1,8 @@ package tests.scoping.references.acrossFiles.toSegments -import tests.scoping.references.acrossFiles.toSegments.mySegment as mySegmentInSamePackage -import safeds.scoping.references.acrossFiles.toSegments.mySegment as mySegmentInSafeDsPackage -import tests.scoping.references.acrossFiles.toSegments.other.mySegment as mySegmentInAnotherPackage +from tests.scoping.references.acrossFiles.toSegments import mySegment as mySegmentInSamePackage +from safeds.scoping.references.acrossFiles.toSegments import mySegment as mySegmentInSafeDsPackage +from tests.scoping.references.acrossFiles.toSegments.other import mySegment as mySegmentInAnotherPackage pipeline myPipeline { // $TEST$ references same_mySegment diff --git a/tests/resources/scoping/references/across files/to segments/main with qualified import.sdstest b/tests/resources/scoping/references/across files/to segments/main with qualified import.sdstest index 27ac77fa3..b0a350a45 100644 --- a/tests/resources/scoping/references/across files/to segments/main with qualified import.sdstest +++ b/tests/resources/scoping/references/across files/to segments/main with qualified import.sdstest @@ -1,12 +1,9 @@ package tests.scoping.references.acrossFiles.toSegments -import safeds.scoping.references.acrossFiles.toSegments.mySegment -import tests.scoping.references.acrossFiles.toSegments.other.publicSegmentInAnotherPackage -import tests.scoping.references.acrossFiles.toSegments.other.internalSegmentInAnotherPackage -import tests.scoping.references.acrossFiles.toSegments.other.privateSegmentInAnotherPackage -import publicSegmentWithoutPackage -import internalSegmentWithoutPackage -import privateSegmentWithoutPackage +from safeds.scoping.references.acrossFiles.toSegments import mySegment +from tests.scoping.references.acrossFiles.toSegments.other import publicSegmentInAnotherPackage, public2SegmentInAnotherPackage +from tests.scoping.references.acrossFiles.toSegments.other import internalSegmentInAnotherPackage +from tests.scoping.references.acrossFiles.toSegments.other import privateSegmentInAnotherPackage pipeline myPipeline { // $TEST$ references safeds_mySegment @@ -36,6 +33,9 @@ pipeline myPipeline { // $TEST$ references other_publicSegmentInAnotherPackage »publicSegmentInAnotherPackage«; + // $TEST$ references other_public2SegmentInAnotherPackage + »public2SegmentInAnotherPackage«; + // $TEST$ unresolved »internalSegmentInAnotherPackage«; diff --git a/tests/resources/scoping/references/across files/to segments/main with wildcard import.sdstest b/tests/resources/scoping/references/across files/to segments/main with wildcard import.sdstest index d30873df9..86caa3071 100644 --- a/tests/resources/scoping/references/across files/to segments/main with wildcard import.sdstest +++ b/tests/resources/scoping/references/across files/to segments/main with wildcard import.sdstest @@ -1,6 +1,6 @@ package tests.scoping.references.acrossFiles.toSegments -import safeds.scoping.references.acrossFiles.toSegments.* +from safeds.scoping.references.acrossFiles.toSegments import * pipeline myPipeline { // $TEST$ references safeds_mySegment diff --git a/tests/resources/scoping/references/across files/to segments/resource other package.sdstest b/tests/resources/scoping/references/across files/to segments/resource other package.sdstest index e444de353..02cd0f13d 100644 --- a/tests/resources/scoping/references/across files/to segments/resource other package.sdstest +++ b/tests/resources/scoping/references/across files/to segments/resource other package.sdstest @@ -6,6 +6,9 @@ segment »mySegment«() {} // $TEST$ target other_publicSegmentInAnotherPackage segment »publicSegmentInAnotherPackage«() {} +// $TEST$ target other_public2SegmentInAnotherPackage +segment »public2SegmentInAnotherPackage«() {} + // $TEST$ target other_internalSegmentInAnotherPackage internal segment »internalSegmentInAnotherPackage«() {} diff --git a/tests/resources/validation/other/imports/wildcard import must not have alias/main.sdstest b/tests/resources/validation/other/imports/wildcard import must not have alias/main.sdstest deleted file mode 100644 index 98ffbd81e..000000000 --- a/tests/resources/validation/other/imports/wildcard import must not have alias/main.sdstest +++ /dev/null @@ -1,6 +0,0 @@ -package tests.validation.other.modules.wildcardImportMustNotHaveAlias - -// $TEST$ error "A wildcard import must not have an alias." -import stuff.* »as S« -// $TEST$ no error "A wildcard import must not have an alias." -import stuff.Stuff »as S« diff --git a/tests/resources/validation/other/modules/must state package/pipeline file (only imports).sdspipe b/tests/resources/validation/other/modules/must state package/pipeline file (only imports).sdspipe index cb93ed6cf..d27d113d5 100644 --- a/tests/resources/validation/other/modules/must state package/pipeline file (only imports).sdspipe +++ b/tests/resources/validation/other/modules/must state package/pipeline file (only imports).sdspipe @@ -1,3 +1,3 @@ // $TEST$ no error "A module with declarations must state its package." -import myPackage +from myPackage import MyClass