diff --git a/src/language/helpers/shortcuts.ts b/src/language/helpers/shortcuts.ts index 8a28a2f80..69340bc13 100644 --- a/src/language/helpers/shortcuts.ts +++ b/src/language/helpers/shortcuts.ts @@ -2,6 +2,7 @@ import { isSdsAssignment, isSdsBlockLambdaResult, isSdsDeclaration, + isSdsModule, isSdsPlaceholder, SdsAnnotatedObject, SdsAnnotationCall, @@ -14,8 +15,10 @@ import { SdsClassMember, SdsEnum, SdsEnumVariant, + SdsImport, SdsLiteral, SdsLiteralType, + SdsModule, SdsParameter, SdsParameterList, SdsPlaceholder, @@ -27,7 +30,7 @@ import { SdsTypeParameter, SdsTypeParameterList, } from '../generated/ast.js'; -import { stream } from 'langium'; +import { AstNode, getContainerOfType, stream } from 'langium'; export const annotationCallsOrEmpty = function (node: SdsAnnotatedObject | undefined): SdsAnnotationCall[] { if (!node) { @@ -70,6 +73,14 @@ export const enumVariantsOrEmpty = function (node: SdsEnum | undefined): SdsEnum return node?.body?.variants ?? []; }; +export const importsOrEmpty = function (node: SdsModule | undefined): SdsImport[] { + return node?.imports ?? []; +}; + +export const packageNameOrNull = function (node: AstNode | undefined): string | null { + return getContainerOfType(node, isSdsModule)?.name ?? null; +}; + export const parametersOrEmpty = function (node: SdsParameterList | undefined): SdsParameter[] { return node?.parameters ?? []; }; diff --git a/src/language/scoping/safe-ds-scope-computation.ts b/src/language/scoping/safe-ds-scope-computation.ts index 3d7db4c19..9e354e0d9 100644 --- a/src/language/scoping/safe-ds-scope-computation.ts +++ b/src/language/scoping/safe-ds-scope-computation.ts @@ -13,6 +13,8 @@ import { isSdsEnumVariant, isSdsFunction, isSdsModule, + isSdsPipeline, + isSdsSegment, isSdsTypeParameter, isSdsTypeParameterList, SdsClass, @@ -22,7 +24,22 @@ import { } from '../generated/ast.js'; export class SafeDsScopeComputation extends DefaultScopeComputation { - override processNode(node: AstNode, document: LangiumDocument, scopes: PrecomputedScopes): void { + 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')) { + return; + } + + // Modules that don't state their package don't export anything + const containingModule = getContainerOfType(node, isSdsModule); + if (!containingModule || !containingModule.name) { + return; + } + + super.exportNode(node, exports, document); + } + + protected override processNode(node: AstNode, document: LangiumDocument, scopes: PrecomputedScopes): void { if (isSdsClass(node)) { this.processSdsClass(node, document, scopes); } else if (isSdsEnum(node)) { diff --git a/src/language/scoping/safe-ds-scope-provider.ts b/src/language/scoping/safe-ds-scope-provider.ts index 09a345d74..98d499418 100644 --- a/src/language/scoping/safe-ds-scope-provider.ts +++ b/src/language/scoping/safe-ds-scope-provider.ts @@ -1,9 +1,15 @@ import { AstNode, + AstNodeDescription, + AstNodeDescriptionProvider, + AstNodeLocator, DefaultScopeProvider, EMPTY_SCOPE, getContainerOfType, getDocument, + LangiumDocuments, + LangiumServices, + MultiMap, ReferenceInfo, Scope, } from 'langium'; @@ -12,6 +18,7 @@ import { isSdsBlock, isSdsCallable, isSdsClass, + isSdsDeclaration, isSdsEnum, isSdsEnumVariant, isSdsLambda, @@ -28,6 +35,7 @@ import { isSdsYield, SdsDeclaration, SdsExpression, + SdsImport, SdsMemberAccess, SdsMemberType, SdsNamedTypeDeclaration, @@ -42,15 +50,29 @@ import { assigneesOrEmpty, classMembersOrEmpty, enumVariantsOrEmpty, + importsOrEmpty, + packageNameOrNull, parametersOrEmpty, resultsOrEmpty, statementsOrEmpty, typeParametersOrEmpty, } from '../helpers/shortcuts.js'; import { isContainedIn } from '../helpers/ast.js'; -import { isStatic } from '../helpers/checks.js'; +import { isStatic, isWildcardImport } from '../helpers/checks.js'; export class SafeDsScopeProvider extends DefaultScopeProvider { + readonly documents: LangiumDocuments; + readonly astNodeDescriptionProvider: AstNodeDescriptionProvider; + readonly astNodeLocator: AstNodeLocator; + + constructor(services: LangiumServices) { + super(services); + + this.documents = services.shared.workspace.LangiumDocuments; + this.astNodeDescriptionProvider = services.workspace.AstNodeDescriptionProvider; + this.astNodeLocator = services.workspace.AstNodeLocator; + } + override getScope(context: ReferenceInfo): Scope { const node = context.container; @@ -64,7 +86,7 @@ export class SafeDsScopeProvider extends DefaultScopeProvider { if (isSdsMemberAccess(node.$container) && node.$containerProperty === 'member') { return this.getScopeForMemberAccessMember(node.$container); } else { - return this.getScopeForDirectReferenceTarget(node); + return this.getScopeForDirectReferenceTarget(node, context); } } else if (isSdsTypeArgument(node) && context.property === 'typeParameter') { return this.getScopeForTypeArgumentTypeParameter(node); @@ -174,19 +196,12 @@ export class SafeDsScopeProvider extends DefaultScopeProvider { } } - private getScopeForDirectReferenceTarget(node: SdsReference): Scope { - // val resource = context.eResource() - // val packageName = context.containingCompilationUnitOrNull()?.qualifiedNameOrNull() - // - // // Declarations in other files - // var result: IScope = FilteringScope( - // super.delegateGetScope(context, SafeDSPackage.Literals.SDS_REFERENCE__DECLARATION), - // ) { - // it.isReferencableExternalDeclaration(resource, packageName) - // } + private getScopeForDirectReferenceTarget(node: SdsReference, context: ReferenceInfo): Scope { + // Declarations in other files + let currentScope = this.getGlobalScope('SdsDeclaration', context); // Declarations in this file - const currentScope = this.globalDeclarationsInSameFile(node, EMPTY_SCOPE); + currentScope = this.globalDeclarationsInSameFile(node, currentScope); // // Declarations in containing classes // context.containingClassOrNull()?.let { @@ -208,33 +223,6 @@ export class SafeDsScopeProvider extends DefaultScopeProvider { // } // } - // /** - // * Removes declarations in this [Resource], [SdsAnnotation]s, and internal [SdsStep]s located in other - // * [SdsCompilationUnit]s. - // */ - // private fun IEObjectDescription?.isReferencableExternalDeclaration( - // fromResource: Resource, - // fromPackageWithQualifiedName: QualifiedName?, - // ): Boolean { - // // Resolution failed in delegate scope - // if (this == null) return false - // - // val obj = this.eObjectOrProxy - // - // // Local declarations are added later using custom scoping rules - // if (obj.eResource() == fromResource) return false - // - // // Annotations cannot be referenced - // if (obj is SdsAnnotation) return false - // - // // Internal steps in another package cannot be referenced - // return !( - // obj is SdsStep && - // obj.visibility() == SdsVisibility.Internal && - // obj.containingCompilationUnitOrNull()?.qualifiedNameOrNull() != fromPackageWithQualifiedName - // ) - // } - private globalDeclarationsInSameFile(node: AstNode, outerScope: Scope): Scope { const module = getContainerOfType(node, isSdsModule); if (!module) { @@ -324,4 +312,157 @@ export class SafeDsScopeProvider extends DefaultScopeProvider { return this.createScopeForNodes(resultsOrEmpty(containingSegment.resultList)); } + + protected override getGlobalScope(referenceType: string, context: ReferenceInfo): Scope { + const node = context.container; + const key = `${getDocument(node).uri}~${referenceType}`; + return this.globalScopeCache.get(key, () => this.getGlobalScopeForNode(referenceType, node)); + } + + 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; + } + + // Skip declarations that cannot be found and modules + const candidateNode = this.loadAstNode(candidate); + if (!candidateNode || isSdsModule(candidateNode)) { + continue; + } + + // Skip declarations in a module without a package name + const candidatePackageName = packageNameOrNull(candidateNode); + if (candidatePackageName === null) { + /* c8 ignore next */ + continue; + } + + // 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.documents.getOrCreateDocument(nodeDescription.documentUri); + return this.astNodeLocator.getAstNode(document.parseResult.value, nodeDescription.path); + } + + 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(); + + constructor(imports: SdsImport[]) { + // Remember the imports and their order + 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; + } + + 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)); + } + + 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 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 }; + } + } + + /** + * Returns descriptions of all imported declarations in the order of the imports. + */ + getDescriptions(): AstNodeDescription[] { + return this.descriptionsByImport.values().toArray(); + } } diff --git a/tests/language/scoping/creator.ts b/tests/language/scoping/creator.ts index 12f6e2295..52f8d79b2 100644 --- a/tests/language/scoping/creator.ts +++ b/tests/language/scoping/creator.ts @@ -10,6 +10,7 @@ import { URI } from 'vscode-uri'; import { getSyntaxErrors, SyntaxErrorsInCodeError } from '../../helpers/diagnostics.js'; import { EmptyFileSystem } from 'langium'; import { createSafeDsServices } from '../../../src/language/safe-ds-module.js'; +import { clearDocuments } from 'langium/test'; const services = createSafeDsServices(EmptyFileSystem).SafeDs; const root = 'scoping'; @@ -46,6 +47,7 @@ const createScopingTest = async ( new SyntaxErrorsInCodeError(syntaxErrors), ); } + await clearDocuments(services); const checksResult = findTestChecks(code, uri, { failIfFewerRangesThanComments: true }); diff --git a/tests/resources/scoping/annotation calls/on annotation/main.sdstest b/tests/resources/scoping/annotation calls/on annotation/main.sdstest index c5e48425c..80a2dca17 100644 --- a/tests/resources/scoping/annotation calls/on annotation/main.sdstest +++ b/tests/resources/scoping/annotation calls/on annotation/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.annotationCalls.onAnnotation +package tests.scoping.annotationCalls.onAnnotation // $TEST$ target before annotation »Before« diff --git a/tests/resources/scoping/annotation calls/on attribute/main.sdstest b/tests/resources/scoping/annotation calls/on attribute/main.sdstest index 6a2de1286..125e7d75c 100644 --- a/tests/resources/scoping/annotation calls/on attribute/main.sdstest +++ b/tests/resources/scoping/annotation calls/on attribute/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.annotationCalls.onAttribute +package tests.scoping.annotationCalls.onAttribute // $TEST$ target before annotation »Before« diff --git a/tests/resources/scoping/annotation calls/on class/main.sdstest b/tests/resources/scoping/annotation calls/on class/main.sdstest index dd1a47dbc..ec43aa3ca 100644 --- a/tests/resources/scoping/annotation calls/on class/main.sdstest +++ b/tests/resources/scoping/annotation calls/on class/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.annotationCalls.onClass +package tests.scoping.annotationCalls.onClass // $TEST$ target before annotation »Before« diff --git a/tests/resources/scoping/annotation calls/on enum variant/main.sdstest b/tests/resources/scoping/annotation calls/on enum variant/main.sdstest index 3e29f8aeb..1253875f6 100644 --- a/tests/resources/scoping/annotation calls/on enum variant/main.sdstest +++ b/tests/resources/scoping/annotation calls/on enum variant/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.annotationCalls.onEnumVariant +package tests.scoping.annotationCalls.onEnumVariant // $TEST$ target before annotation »Before« diff --git a/tests/resources/scoping/annotation calls/on enum/main.sdstest b/tests/resources/scoping/annotation calls/on enum/main.sdstest index b213ee1ed..161aaa078 100644 --- a/tests/resources/scoping/annotation calls/on enum/main.sdstest +++ b/tests/resources/scoping/annotation calls/on enum/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.annotationCalls.onEnum +package tests.scoping.annotationCalls.onEnum // $TEST$ target before annotation »Before« diff --git a/tests/resources/scoping/annotation calls/on function/main.sdstest b/tests/resources/scoping/annotation calls/on function/main.sdstest index 6bfc169dc..81bdfa2d3 100644 --- a/tests/resources/scoping/annotation calls/on function/main.sdstest +++ b/tests/resources/scoping/annotation calls/on function/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.annotationCalls.onFunction +package tests.scoping.annotationCalls.onFunction // $TEST$ target before annotation »Before« diff --git a/tests/resources/scoping/annotation calls/on module/main.sdstest b/tests/resources/scoping/annotation calls/on module/main.sdstest index 17dfcaf16..54d5f865b 100644 --- a/tests/resources/scoping/annotation calls/on module/main.sdstest +++ b/tests/resources/scoping/annotation calls/on module/main.sdstest @@ -5,7 +5,7 @@ // $TEST$ unresolved @»Unresolved« -package test.scoping.annotationCalls.onModule +package tests.scoping.annotationCalls.onModule // $TEST$ target annotation annotation »MyAnnotation« diff --git a/tests/resources/scoping/annotation calls/on parameter/main.sdstest b/tests/resources/scoping/annotation calls/on parameter/main.sdstest index 3cee1fe6d..af33e55bf 100644 --- a/tests/resources/scoping/annotation calls/on parameter/main.sdstest +++ b/tests/resources/scoping/annotation calls/on parameter/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.annotationCalls.onParameter +package tests.scoping.annotationCalls.onParameter // $TEST$ target before annotation »Before« diff --git a/tests/resources/scoping/annotation calls/on pipeline/main.sdstest b/tests/resources/scoping/annotation calls/on pipeline/main.sdstest index 61dfc90ed..c57cae478 100644 --- a/tests/resources/scoping/annotation calls/on pipeline/main.sdstest +++ b/tests/resources/scoping/annotation calls/on pipeline/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.annotationCalls.onPipeline +package tests.scoping.annotationCalls.onPipeline // $TEST$ target before annotation »Before« diff --git a/tests/resources/scoping/annotation calls/on result/main.sdstest b/tests/resources/scoping/annotation calls/on result/main.sdstest index 5e9a9ca3c..c34ac239b 100644 --- a/tests/resources/scoping/annotation calls/on result/main.sdstest +++ b/tests/resources/scoping/annotation calls/on result/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.annotationCalls.onResult +package tests.scoping.annotationCalls.onResult // $TEST$ target before annotation »Before« diff --git a/tests/resources/scoping/annotation calls/on segment/main.sdstest b/tests/resources/scoping/annotation calls/on segment/main.sdstest index b79f45d6a..db7a052a7 100644 --- a/tests/resources/scoping/annotation calls/on segment/main.sdstest +++ b/tests/resources/scoping/annotation calls/on segment/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.annotationCalls.onSegment +package tests.scoping.annotationCalls.onSegment // $TEST$ target before annotation »Before« diff --git a/tests/resources/scoping/annotation calls/on type parameter/main.sdstest b/tests/resources/scoping/annotation calls/on type parameter/main.sdstest index e57c694c3..fe990af15 100644 --- a/tests/resources/scoping/annotation calls/on type parameter/main.sdstest +++ b/tests/resources/scoping/annotation calls/on type parameter/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.annotationCalls.onTypeParameter +package tests.scoping.annotationCalls.onTypeParameter // $TEST$ target before annotation »Before« diff --git a/tests/resources/scoping/member accesses/to class members/instance attributes/main.sdstest b/tests/resources/scoping/member accesses/to class members/instance attributes/main.sdstest index f669b222b..a5f3b8379 100644 --- a/tests/resources/scoping/member accesses/to class members/instance attributes/main.sdstest +++ b/tests/resources/scoping/member accesses/to class members/instance attributes/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.memberAccesses.toClassMembers.instanceAttributes +package tests.scoping.memberAccesses.toClassMembers.instanceAttributes class MyClass { // $TEST$ target myInstanceAttribute diff --git a/tests/resources/scoping/member accesses/to class members/instance methods/main.sdstest b/tests/resources/scoping/member accesses/to class members/instance methods/main.sdstest index 6e68f1c42..695e6ba1e 100644 --- a/tests/resources/scoping/member accesses/to class members/instance methods/main.sdstest +++ b/tests/resources/scoping/member accesses/to class members/instance methods/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.memberAccesses.toClassMembers.instanceMethods +package tests.scoping.memberAccesses.toClassMembers.instanceMethods class MyClass { // $TEST$ target myInstanceMethod diff --git a/tests/resources/scoping/member accesses/to class members/nested classes/main.sdstest b/tests/resources/scoping/member accesses/to class members/nested classes/main.sdstest index 6c47fc098..deba1851e 100644 --- a/tests/resources/scoping/member accesses/to class members/nested classes/main.sdstest +++ b/tests/resources/scoping/member accesses/to class members/nested classes/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.memberAccesses.toClassMembers.nestedClasses +package tests.scoping.memberAccesses.toClassMembers.nestedClasses class MyClass { // $TEST$ target myNestedClass diff --git a/tests/resources/scoping/member accesses/to class members/nested enums/main.sdstest b/tests/resources/scoping/member accesses/to class members/nested enums/main.sdstest index 12ea94663..8829f39c0 100644 --- a/tests/resources/scoping/member accesses/to class members/nested enums/main.sdstest +++ b/tests/resources/scoping/member accesses/to class members/nested enums/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.memberAccesses.toClassMembers.nestedEnums +package tests.scoping.memberAccesses.toClassMembers.nestedEnums class MyClass { // $TEST$ target myNestedEnum diff --git a/tests/resources/scoping/member accesses/to class members/static attributes/main.sdstest b/tests/resources/scoping/member accesses/to class members/static attributes/main.sdstest index f1fbd272f..0c9d77c54 100644 --- a/tests/resources/scoping/member accesses/to class members/static attributes/main.sdstest +++ b/tests/resources/scoping/member accesses/to class members/static attributes/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.memberAccesses.toClassMembers.staticAttributes +package tests.scoping.memberAccesses.toClassMembers.staticAttributes class MyClass() { // $TEST$ target myStaticAttribute diff --git a/tests/resources/scoping/member accesses/to class members/static methods/main.sdstest b/tests/resources/scoping/member accesses/to class members/static methods/main.sdstest index b1b461ccd..7467d7dc8 100644 --- a/tests/resources/scoping/member accesses/to class members/static methods/main.sdstest +++ b/tests/resources/scoping/member accesses/to class members/static methods/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.memberAccesses.toClassMembers.staticMethods +package tests.scoping.memberAccesses.toClassMembers.staticMethods class MyClass { // $TEST$ target myStaticMethod diff --git a/tests/resources/scoping/member accesses/to enum variants/main.sdstest b/tests/resources/scoping/member accesses/to enum variants/main.sdstest index dbf8c4833..3f913c068 100644 --- a/tests/resources/scoping/member accesses/to enum variants/main.sdstest +++ b/tests/resources/scoping/member accesses/to enum variants/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.memberAccesses.toEnumVariants +package tests.scoping.memberAccesses.toEnumVariants enum MyEnum { // $TEST$ target myEnumVariant diff --git a/tests/resources/scoping/named types/to containing named type declaration/main.sdstest b/tests/resources/scoping/named types/to containing named type declaration/main.sdstest index efa19338c..18027fa00 100644 --- a/tests/resources/scoping/named types/to containing named type declaration/main.sdstest +++ b/tests/resources/scoping/named types/to containing named type declaration/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.namedTypes.toContainingNamedTypeDeclaration +package tests.scoping.namedTypes.toContainingNamedTypeDeclaration // $TEST$ target outerClass class »MyClass«( diff --git a/tests/resources/scoping/named types/to enum variant in global enum/main.sdstest b/tests/resources/scoping/named types/to enum variant in global enum/main.sdstest index 9590b1159..8449daa48 100644 --- a/tests/resources/scoping/named types/to enum variant in global enum/main.sdstest +++ b/tests/resources/scoping/named types/to enum variant in global enum/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.namedTypes.toEnumVariantInGlobalEnum +package tests.scoping.namedTypes.toEnumVariantInGlobalEnum enum BeforeEnum { // $TEST$ target before diff --git a/tests/resources/scoping/named types/to enum variant in nested enum/main.sdstest b/tests/resources/scoping/named types/to enum variant in nested enum/main.sdstest index 606fbccdd..988f383e3 100644 --- a/tests/resources/scoping/named types/to enum variant in nested enum/main.sdstest +++ b/tests/resources/scoping/named types/to enum variant in nested enum/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.namedTypes.toEnumVariantInNestedEnum +package tests.scoping.namedTypes.toEnumVariantInNestedEnum class BeforeClass { enum BeforeEnum { diff --git a/tests/resources/scoping/named types/to global class/main.sdstest b/tests/resources/scoping/named types/to global class/main.sdstest index e1461b1a5..8ee426134 100644 --- a/tests/resources/scoping/named types/to global class/main.sdstest +++ b/tests/resources/scoping/named types/to global class/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.namedTypes.toGlobalClass +package tests.scoping.namedTypes.toGlobalClass // $TEST$ target before class »BeforeClass« diff --git a/tests/resources/scoping/named types/to global enum/main.sdstest b/tests/resources/scoping/named types/to global enum/main.sdstest index 894c55e78..f31de39d2 100644 --- a/tests/resources/scoping/named types/to global enum/main.sdstest +++ b/tests/resources/scoping/named types/to global enum/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.namedTypes.toGlobalEnum +package tests.scoping.namedTypes.toGlobalEnum // $TEST$ target before enum »BeforeEnum« diff --git a/tests/resources/scoping/named types/to nested class/main.sdstest b/tests/resources/scoping/named types/to nested class/main.sdstest index 46cbe7bc2..32c724b46 100644 --- a/tests/resources/scoping/named types/to nested class/main.sdstest +++ b/tests/resources/scoping/named types/to nested class/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.namedTypes.toNestedClass +package tests.scoping.namedTypes.toNestedClass class BeforeOuterClass { // $TEST$ target before diff --git a/tests/resources/scoping/named types/to nested enum/main.sdstest b/tests/resources/scoping/named types/to nested enum/main.sdstest index d17e86318..8b94ede4b 100644 --- a/tests/resources/scoping/named types/to nested enum/main.sdstest +++ b/tests/resources/scoping/named types/to nested enum/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.namedTypes.toNestedEnum +package tests.scoping.namedTypes.toNestedEnum class BeforeClass { // $TEST$ target before diff --git a/tests/resources/scoping/named types/to something other than named type declaration/main.sdstest b/tests/resources/scoping/named types/to something other than named type declaration/main.sdstest index d1bc3a5d5..d039c5903 100644 --- a/tests/resources/scoping/named types/to something other than named type declaration/main.sdstest +++ b/tests/resources/scoping/named types/to something other than named type declaration/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.namedTypes.toSomethingOtherThanNamedTypeDeclaration +package tests.scoping.namedTypes.toSomethingOtherThanNamedTypeDeclaration // $TEST$ unresolved segment mySegment(p: »notANamedTypeDeclaration«) {} diff --git a/tests/resources/scoping/named types/to type parameter/in enum variant in global enum/main.sdstest b/tests/resources/scoping/named types/to type parameter/in enum variant in global enum/main.sdstest index 55447373e..eeddca39b 100644 --- a/tests/resources/scoping/named types/to type parameter/in enum variant in global enum/main.sdstest +++ b/tests/resources/scoping/named types/to type parameter/in enum variant in global enum/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.namedTypes.toTypeParameter.inEnumVariantInGlobalEnum +package tests.scoping.namedTypes.toTypeParameter.inEnumVariantInGlobalEnum fun myFunction1() diff --git a/tests/resources/scoping/named types/to type parameter/in enum variant in nested enum/main.sdstest b/tests/resources/scoping/named types/to type parameter/in enum variant in nested enum/main.sdstest index 88e171b23..41799ad28 100644 --- a/tests/resources/scoping/named types/to type parameter/in enum variant in nested enum/main.sdstest +++ b/tests/resources/scoping/named types/to type parameter/in enum variant in nested enum/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.namedTypes.toTypeParameter.inEnumVariantInNestedEnum +package tests.scoping.namedTypes.toTypeParameter.inEnumVariantInNestedEnum fun myFunction1() diff --git a/tests/resources/scoping/named types/to type parameter/in global class/main.sdstest b/tests/resources/scoping/named types/to type parameter/in global class/main.sdstest index 4119c17ed..a9bd632fa 100644 --- a/tests/resources/scoping/named types/to type parameter/in global class/main.sdstest +++ b/tests/resources/scoping/named types/to type parameter/in global class/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.namedTypes.toTypeParameter.inGlobalClass +package tests.scoping.namedTypes.toTypeParameter.inGlobalClass fun myFunction1() diff --git a/tests/resources/scoping/named types/to type parameter/in global function/main.sdstest b/tests/resources/scoping/named types/to type parameter/in global function/main.sdstest index 0f2d62171..c7f12ef13 100644 --- a/tests/resources/scoping/named types/to type parameter/in global function/main.sdstest +++ b/tests/resources/scoping/named types/to type parameter/in global function/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.namedTypes.toTypeParameter.inGlobalFunction +package tests.scoping.namedTypes.toTypeParameter.inGlobalFunction fun myFunction1() diff --git a/tests/resources/scoping/named types/to type parameter/in method/main.sdstest b/tests/resources/scoping/named types/to type parameter/in method/main.sdstest index 66faeaa03..4fbf2bfb8 100644 --- a/tests/resources/scoping/named types/to type parameter/in method/main.sdstest +++ b/tests/resources/scoping/named types/to type parameter/in method/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.namedTypes.toTypeParameter.inMethod +package tests.scoping.namedTypes.toTypeParameter.inMethod fun myFunction1() diff --git a/tests/resources/scoping/named types/to type parameter/in nested class/main.sdstest b/tests/resources/scoping/named types/to type parameter/in nested class/main.sdstest index 79ad0240a..e6f5056e4 100644 --- a/tests/resources/scoping/named types/to type parameter/in nested class/main.sdstest +++ b/tests/resources/scoping/named types/to type parameter/in nested class/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.namedTypes.toTypeParameter.inNestedClass +package tests.scoping.namedTypes.toTypeParameter.inNestedClass fun myFunction1() diff --git a/tests/resources/scoping/references/across files/to annotations/main no imports or own declarations.sdstest b/tests/resources/scoping/references/across files/to annotations/main no imports or own declarations.sdstest new file mode 100644 index 000000000..343ec013f --- /dev/null +++ b/tests/resources/scoping/references/across files/to annotations/main no imports or own declarations.sdstest @@ -0,0 +1,18 @@ +package tests.scoping.references.acrossFiles.toAnnotations + +pipeline myPipeline { + // $TEST$ references same_MyAnnotation + »MyAnnotation«; + + // $TEST$ references same_AnnotationInSamePackage + »AnnotationInSamePackage«; + + // $TEST$ references safeds_AnnotationInSafeDsPackage + »AnnotationInSafeDsPackage«; + + // $TEST$ unresolved + »AnnotationInAnotherPackage«; + + // $TEST$ unresolved + »AnnotationWithoutPackage«; +} 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 new file mode 100644 index 000000000..247c840fa --- /dev/null +++ b/tests/resources/scoping/references/across files/to annotations/main with imports and own declarations.sdstest @@ -0,0 +1,24 @@ +package tests.scoping.references.acrossFiles.toAnnotations + +import safeds.scoping.references.acrossFiles.toAnnotations.MyAnnotation as MyOwnAnnotation +import tests.scoping.references.acrossFiles.toAnnotations.other.AnnotationInAnotherPackage + +// $TEST$ target own_MyOwnAnnotation +annotation »MyOwnAnnotation« + +pipeline myPipeline { + // $TEST$ references own_MyOwnAnnotation + »MyOwnAnnotation«; + + // $TEST$ references same_AnnotationInSamePackage + »AnnotationInSamePackage«; + + // $TEST$ references safeds_AnnotationInSafeDsPackage + »AnnotationInSafeDsPackage«; + + // $TEST$ references other_AnnotationInAnotherPackage + »AnnotationInAnotherPackage«; + + // $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 new file mode 100644 index 000000000..76d0c5310 --- /dev/null +++ b/tests/resources/scoping/references/across files/to annotations/main with multiple imports of same name.sdstest @@ -0,0 +1,10 @@ +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 + +pipeline myPipeline { + // $TEST$ references safeds_MyAnnotation + »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 new file mode 100644 index 000000000..dc830eec3 --- /dev/null +++ b/tests/resources/scoping/references/across files/to annotations/main with qualified import with alias.sdstest @@ -0,0 +1,32 @@ +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 + +pipeline myPipeline { + // $TEST$ references same_MyAnnotation + »MyAnnotation«; + + + // $TEST$ references same_AnnotationInSamePackage + »AnnotationInSamePackage«; + + // $TEST$ references safeds_AnnotationInSafeDsPackage + »AnnotationInSafeDsPackage«; + + // $TEST$ unresolved + »AnnotationInAnotherPackage«; + + // $TEST$ unresolved + »AnnotationWithoutPackage«; + + // $TEST$ references same_MyAnnotation + »MyAnnotationInSamePackage«; + + // $TEST$ references safeds_MyAnnotation + »MyAnnotationInSafeDsPackage«; + + // $TEST$ references other_MyAnnotation + »MyAnnotationInAnotherPackage«; +} 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 new file mode 100644 index 000000000..c9942f5d0 --- /dev/null +++ b/tests/resources/scoping/references/across files/to annotations/main with qualified import.sdstest @@ -0,0 +1,22 @@ +package tests.scoping.references.acrossFiles.toAnnotations + +import safeds.scoping.references.acrossFiles.toAnnotations.MyAnnotation +import tests.scoping.references.acrossFiles.toAnnotations.other.AnnotationInAnotherPackage +import AnnotationWithoutPackage + +pipeline myPipeline { + // $TEST$ references safeds_MyAnnotation + »MyAnnotation«; + + // $TEST$ references same_AnnotationInSamePackage + »AnnotationInSamePackage«; + + // $TEST$ references safeds_AnnotationInSafeDsPackage + »AnnotationInSafeDsPackage«; + + // $TEST$ references other_AnnotationInAnotherPackage + »AnnotationInAnotherPackage«; + + // $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 new file mode 100644 index 000000000..a2efcb382 --- /dev/null +++ b/tests/resources/scoping/references/across files/to annotations/main with wildcard import.sdstest @@ -0,0 +1,20 @@ +package tests.scoping.references.acrossFiles.toAnnotations + +import safeds.scoping.references.acrossFiles.toAnnotations.* + +pipeline myPipeline { + // $TEST$ references safeds_MyAnnotation + »MyAnnotation«; + + // $TEST$ references same_AnnotationInSamePackage + »AnnotationInSamePackage«; + + // $TEST$ references safeds_AnnotationInSafeDsPackage + »AnnotationInSafeDsPackage«; + + // $TEST$ unresolved + »AnnotationInAnotherPackage«; + + // $TEST$ unresolved + »AnnotationWithoutPackage«; +} 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 new file mode 100644 index 000000000..0218c00f5 --- /dev/null +++ b/tests/resources/scoping/references/across files/to annotations/resource other package.sdstest @@ -0,0 +1,7 @@ +package tests.scoping.references.acrossFiles.toAnnotations.other + +// $TEST$ target other_MyAnnotation +annotation »MyAnnotation« + +// $TEST$ target other_AnnotationInAnotherPackage +annotation »AnnotationInAnotherPackage« diff --git a/tests/resources/scoping/references/across files/to annotations/resource safeds package.sdstest b/tests/resources/scoping/references/across files/to annotations/resource safeds package.sdstest new file mode 100644 index 000000000..3febd64f1 --- /dev/null +++ b/tests/resources/scoping/references/across files/to annotations/resource safeds package.sdstest @@ -0,0 +1,7 @@ +package safeds.scoping.references.acrossFiles.toAnnotations + +// $TEST$ target safeds_MyAnnotation +annotation »MyAnnotation« + +// $TEST$ target safeds_AnnotationInSafeDsPackage +annotation »AnnotationInSafeDsPackage« diff --git a/tests/resources/scoping/references/across files/to annotations/resource same package.sdstest b/tests/resources/scoping/references/across files/to annotations/resource same package.sdstest new file mode 100644 index 000000000..03f610110 --- /dev/null +++ b/tests/resources/scoping/references/across files/to annotations/resource same package.sdstest @@ -0,0 +1,7 @@ +package tests.scoping.references.acrossFiles.toAnnotations + +// $TEST$ target same_MyAnnotation +annotation »MyAnnotation« + +// $TEST$ target same_AnnotationInSamePackage +annotation »AnnotationInSamePackage« diff --git a/tests/resources/scoping/references/across files/to annotations/resource without package.sdstest b/tests/resources/scoping/references/across files/to annotations/resource without package.sdstest new file mode 100644 index 000000000..39a33d045 --- /dev/null +++ b/tests/resources/scoping/references/across files/to annotations/resource without package.sdstest @@ -0,0 +1,5 @@ +// $TEST$ target without_MyAnnotation +annotation »MyAnnotation« + +// $TEST$ target without_AnnotationWithoutPackage +annotation »AnnotationWithoutPackage« diff --git a/tests/resources/scoping/references/across files/to global classes/main no imports or own declarations.sdstest b/tests/resources/scoping/references/across files/to global classes/main no imports or own declarations.sdstest new file mode 100644 index 000000000..14832a0ed --- /dev/null +++ b/tests/resources/scoping/references/across files/to global classes/main no imports or own declarations.sdstest @@ -0,0 +1,18 @@ +package tests.scoping.references.acrossFiles.toGlobalClasses + +pipeline myPipeline { + // $TEST$ references same_MyClass + »MyClass«; + + // $TEST$ references same_ClassInSamePackage + »ClassInSamePackage«; + + // $TEST$ references safeds_ClassInSafeDsPackage + »ClassInSafeDsPackage«; + + // $TEST$ unresolved + »ClassInAnotherPackage«; + + // $TEST$ unresolved + »ClassWithoutPackage«; +} 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 new file mode 100644 index 000000000..d6c523d16 --- /dev/null +++ b/tests/resources/scoping/references/across files/to global classes/main with imports and own declarations.sdstest @@ -0,0 +1,24 @@ +package tests.scoping.references.acrossFiles.toGlobalClasses + +import safeds.scoping.references.acrossFiles.toGlobalClasses.MyClass as MyOwnClass +import tests.scoping.references.acrossFiles.toGlobalClasses.other.ClassInAnotherPackage + +// $TEST$ target own_MyOwnClass +class »MyOwnClass« + +pipeline myPipeline { + // $TEST$ references own_MyOwnClass + »MyOwnClass«; + + // $TEST$ references same_ClassInSamePackage + »ClassInSamePackage«; + + // $TEST$ references safeds_ClassInSafeDsPackage + »ClassInSafeDsPackage«; + + // $TEST$ references other_ClassInAnotherPackage + »ClassInAnotherPackage«; + + // $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 new file mode 100644 index 000000000..f4326c124 --- /dev/null +++ b/tests/resources/scoping/references/across files/to global classes/main with multiple imports of same name.sdstest @@ -0,0 +1,10 @@ +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 + +pipeline myPipeline { + // $TEST$ references safeds_MyClass + »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 new file mode 100644 index 000000000..f46bf7b45 --- /dev/null +++ b/tests/resources/scoping/references/across files/to global classes/main with qualified import with alias.sdstest @@ -0,0 +1,32 @@ +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 + +pipeline myPipeline { + // $TEST$ references same_MyClass + »MyClass«; + + + // $TEST$ references same_ClassInSamePackage + »ClassInSamePackage«; + + // $TEST$ references safeds_ClassInSafeDsPackage + »ClassInSafeDsPackage«; + + // $TEST$ unresolved + »ClassInAnotherPackage«; + + // $TEST$ unresolved + »ClassWithoutPackage«; + + // $TEST$ references same_MyClass + »MyClassInSamePackage«; + + // $TEST$ references safeds_MyClass + »MyClassInSafeDsPackage«; + + // $TEST$ references other_MyClass + »MyClassInAnotherPackage«; +} 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 new file mode 100644 index 000000000..1b146cc38 --- /dev/null +++ b/tests/resources/scoping/references/across files/to global classes/main with qualified import.sdstest @@ -0,0 +1,22 @@ +package tests.scoping.references.acrossFiles.toGlobalClasses + +import safeds.scoping.references.acrossFiles.toGlobalClasses.MyClass +import tests.scoping.references.acrossFiles.toGlobalClasses.other.ClassInAnotherPackage +import ClassWithoutPackage + +pipeline myPipeline { + // $TEST$ references safeds_MyClass + »MyClass«; + + // $TEST$ references same_ClassInSamePackage + »ClassInSamePackage«; + + // $TEST$ references safeds_ClassInSafeDsPackage + »ClassInSafeDsPackage«; + + // $TEST$ references other_ClassInAnotherPackage + »ClassInAnotherPackage«; + + // $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 new file mode 100644 index 000000000..f8e3c627b --- /dev/null +++ b/tests/resources/scoping/references/across files/to global classes/main with wildcard import.sdstest @@ -0,0 +1,20 @@ +package tests.scoping.references.acrossFiles.toGlobalClasses + +import safeds.scoping.references.acrossFiles.toGlobalClasses.* + +pipeline myPipeline { + // $TEST$ references safeds_MyClass + »MyClass«; + + // $TEST$ references same_ClassInSamePackage + »ClassInSamePackage«; + + // $TEST$ references safeds_ClassInSafeDsPackage + »ClassInSafeDsPackage«; + + // $TEST$ unresolved + »ClassInAnotherPackage«; + + // $TEST$ unresolved + »ClassWithoutPackage«; +} 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 new file mode 100644 index 000000000..c4ffdc7b0 --- /dev/null +++ b/tests/resources/scoping/references/across files/to global classes/resource other package.sdstest @@ -0,0 +1,7 @@ +package tests.scoping.references.acrossFiles.toGlobalClasses.other + +// $TEST$ target other_MyClass +class »MyClass« + +// $TEST$ target other_ClassInAnotherPackage +class »ClassInAnotherPackage« diff --git a/tests/resources/scoping/references/across files/to global classes/resource safeds package.sdstest b/tests/resources/scoping/references/across files/to global classes/resource safeds package.sdstest new file mode 100644 index 000000000..f9bbc9a9d --- /dev/null +++ b/tests/resources/scoping/references/across files/to global classes/resource safeds package.sdstest @@ -0,0 +1,7 @@ +package safeds.scoping.references.acrossFiles.toGlobalClasses + +// $TEST$ target safeds_MyClass +class »MyClass« + +// $TEST$ target safeds_ClassInSafeDsPackage +class »ClassInSafeDsPackage« diff --git a/tests/resources/scoping/references/across files/to global classes/resource same package.sdstest b/tests/resources/scoping/references/across files/to global classes/resource same package.sdstest new file mode 100644 index 000000000..5f358622a --- /dev/null +++ b/tests/resources/scoping/references/across files/to global classes/resource same package.sdstest @@ -0,0 +1,7 @@ +package tests.scoping.references.acrossFiles.toGlobalClasses + +// $TEST$ target same_MyClass +class »MyClass« + +// $TEST$ target same_ClassInSamePackage +class »ClassInSamePackage« diff --git a/tests/resources/scoping/references/across files/to global classes/resource without package.sdstest b/tests/resources/scoping/references/across files/to global classes/resource without package.sdstest new file mode 100644 index 000000000..bcd074356 --- /dev/null +++ b/tests/resources/scoping/references/across files/to global classes/resource without package.sdstest @@ -0,0 +1,5 @@ +// $TEST$ target without_MyClass +class »MyClass« + +// $TEST$ target without_ClassWithoutPackage +class »ClassWithoutPackage« diff --git a/tests/resources/scoping/references/across files/to global enums/main no imports or own declarations.sdstest b/tests/resources/scoping/references/across files/to global enums/main no imports or own declarations.sdstest new file mode 100644 index 000000000..0271f2e55 --- /dev/null +++ b/tests/resources/scoping/references/across files/to global enums/main no imports or own declarations.sdstest @@ -0,0 +1,18 @@ +package tests.scoping.references.acrossFiles.toGlobalEnums + +pipeline myPipeline { + // $TEST$ references same_MyEnum + »MyEnum«; + + // $TEST$ references same_EnumInSamePackage + »EnumInSamePackage«; + + // $TEST$ references safeds_EnumInSafeDsPackage + »EnumInSafeDsPackage«; + + // $TEST$ unresolved + »EnumInAnotherPackage«; + + // $TEST$ unresolved + »EnumWithoutPackage«; +} 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 new file mode 100644 index 000000000..4f572fee9 --- /dev/null +++ b/tests/resources/scoping/references/across files/to global enums/main with imports and own declarations.sdstest @@ -0,0 +1,24 @@ +package tests.scoping.references.acrossFiles.toGlobalEnums + +import safeds.scoping.references.acrossFiles.toGlobalEnums.MyEnum as MyOwnEnum +import tests.scoping.references.acrossFiles.toGlobalEnums.other.EnumInAnotherPackage + +// $TEST$ target own_MyOwnEnum +enum »MyOwnEnum« + +pipeline myPipeline { + // $TEST$ references own_MyOwnEnum + »MyOwnEnum«; + + // $TEST$ references same_EnumInSamePackage + »EnumInSamePackage«; + + // $TEST$ references safeds_EnumInSafeDsPackage + »EnumInSafeDsPackage«; + + // $TEST$ references other_EnumInAnotherPackage + »EnumInAnotherPackage«; + + // $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 new file mode 100644 index 000000000..904946238 --- /dev/null +++ b/tests/resources/scoping/references/across files/to global enums/main with multiple imports of same name.sdstest @@ -0,0 +1,10 @@ +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 + +pipeline myPipeline { + // $TEST$ references safeds_MyEnum + »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 new file mode 100644 index 000000000..a552b6d6d --- /dev/null +++ b/tests/resources/scoping/references/across files/to global enums/main with qualified import with alias.sdstest @@ -0,0 +1,33 @@ +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 + +pipeline myPipeline { + // $TEST$ references same_MyEnum + »MyEnum«; + + + // $TEST$ references same_EnumInSamePackage + »EnumInSamePackage«; + + // $TEST$ references safeds_EnumInSafeDsPackage + »EnumInSafeDsPackage«; + + // $TEST$ unresolved + »EnumInAnotherPackage«; + + // $TEST$ unresolved + »EnumWithoutPackage«; + + + // $TEST$ references same_MyEnum + »MyEnumInSamePackage«; + + // $TEST$ references safeds_MyEnum + »MyEnumInSafeDsPackage«; + + // $TEST$ references other_MyEnum + »MyEnumInAnotherPackage«; +} 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 new file mode 100644 index 000000000..75ba66f8d --- /dev/null +++ b/tests/resources/scoping/references/across files/to global enums/main with qualified import.sdstest @@ -0,0 +1,22 @@ +package tests.scoping.references.acrossFiles.toGlobalEnums + +import safeds.scoping.references.acrossFiles.toGlobalEnums.MyEnum +import tests.scoping.references.acrossFiles.toGlobalEnums.other.EnumInAnotherPackage +import EnumWithoutPackage + +pipeline myPipeline { + // $TEST$ references safeds_MyEnum + »MyEnum«; + + // $TEST$ references same_EnumInSamePackage + »EnumInSamePackage«; + + // $TEST$ references safeds_EnumInSafeDsPackage + »EnumInSafeDsPackage«; + + // $TEST$ references other_EnumInAnotherPackage + »EnumInAnotherPackage«; + + // $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 new file mode 100644 index 000000000..f42942c0a --- /dev/null +++ b/tests/resources/scoping/references/across files/to global enums/main with wildcard import.sdstest @@ -0,0 +1,20 @@ +package tests.scoping.references.acrossFiles.toGlobalEnums + +import safeds.scoping.references.acrossFiles.toGlobalEnums.* + +pipeline myPipeline { + // $TEST$ references safeds_MyEnum + »MyEnum«; + + // $TEST$ references same_EnumInSamePackage + »EnumInSamePackage«; + + // $TEST$ references safeds_EnumInSafeDsPackage + »EnumInSafeDsPackage«; + + // $TEST$ unresolved + »EnumInAnotherPackage«; + + // $TEST$ unresolved + »EnumWithoutPackage«; +} 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 new file mode 100644 index 000000000..442ce1455 --- /dev/null +++ b/tests/resources/scoping/references/across files/to global enums/resource other package.sdstest @@ -0,0 +1,7 @@ +package tests.scoping.references.acrossFiles.toGlobalEnums.other + +// $TEST$ target other_MyEnum +enum »MyEnum« + +// $TEST$ target other_EnumInAnotherPackage +enum »EnumInAnotherPackage« diff --git a/tests/resources/scoping/references/across files/to global enums/resource safeds package.sdstest b/tests/resources/scoping/references/across files/to global enums/resource safeds package.sdstest new file mode 100644 index 000000000..44e595fc3 --- /dev/null +++ b/tests/resources/scoping/references/across files/to global enums/resource safeds package.sdstest @@ -0,0 +1,7 @@ +package safeds.scoping.references.acrossFiles.toGlobalEnums + +// $TEST$ target safeds_MyEnum +enum »MyEnum« + +// $TEST$ target safeds_EnumInSafeDsPackage +enum »EnumInSafeDsPackage« diff --git a/tests/resources/scoping/references/across files/to global enums/resource same package.sdstest b/tests/resources/scoping/references/across files/to global enums/resource same package.sdstest new file mode 100644 index 000000000..43c20ebcd --- /dev/null +++ b/tests/resources/scoping/references/across files/to global enums/resource same package.sdstest @@ -0,0 +1,7 @@ +package tests.scoping.references.acrossFiles.toGlobalEnums + +// $TEST$ target same_MyEnum +enum »MyEnum« + +// $TEST$ target same_EnumInSamePackage +enum »EnumInSamePackage« diff --git a/tests/resources/scoping/references/across files/to global enums/resource without package.sdstest b/tests/resources/scoping/references/across files/to global enums/resource without package.sdstest new file mode 100644 index 000000000..7587c7e28 --- /dev/null +++ b/tests/resources/scoping/references/across files/to global enums/resource without package.sdstest @@ -0,0 +1,5 @@ +// $TEST$ target without_MyEnum +enum »MyEnum« + +// $TEST$ target without_EnumWithoutPackage +enum »EnumWithoutPackage« diff --git a/tests/resources/scoping/references/across files/to global functions/main no imports or own declarations.sdstest b/tests/resources/scoping/references/across files/to global functions/main no imports or own declarations.sdstest new file mode 100644 index 000000000..aa95d66f8 --- /dev/null +++ b/tests/resources/scoping/references/across files/to global functions/main no imports or own declarations.sdstest @@ -0,0 +1,18 @@ +package tests.scoping.references.acrossFiles.toGlobalFunctions + +pipeline myPipeline { + // $TEST$ references same_myFunction + »myFunction«; + + // $TEST$ references same_functionInSamePackage + »functionInSamePackage«; + + // $TEST$ references safeds_functionInSafeDsPackage + »functionInSafeDsPackage«; + + // $TEST$ unresolved + »functionInAnotherPackage«; + + // $TEST$ unresolved + »functionWithoutPackage«; +} 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 new file mode 100644 index 000000000..356f325f7 --- /dev/null +++ b/tests/resources/scoping/references/across files/to global functions/main with imports and own declarations.sdstest @@ -0,0 +1,24 @@ +package tests.scoping.references.acrossFiles.toGlobalFunctions + +import safeds.scoping.references.acrossFiles.toGlobalFunctions.myFunction as myOwnFunction +import tests.scoping.references.acrossFiles.toGlobalFunctions.other.functionInAnotherPackage + +// $TEST$ target own_myOwnFunction +fun »myOwnFunction«() + +pipeline myPipeline { + // $TEST$ references own_myOwnFunction + »myOwnFunction«; + + // $TEST$ references same_functionInSamePackage + »functionInSamePackage«; + + // $TEST$ references safeds_functionInSafeDsPackage + »functionInSafeDsPackage«; + + // $TEST$ references other_functionInAnotherPackage + »functionInAnotherPackage«; + + // $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 new file mode 100644 index 000000000..761931ccd --- /dev/null +++ b/tests/resources/scoping/references/across files/to global functions/main with multiple imports of same name.sdstest @@ -0,0 +1,10 @@ +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 + +pipeline myPipeline { + // $TEST$ references safeds_myFunction + »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 new file mode 100644 index 000000000..100fa1158 --- /dev/null +++ b/tests/resources/scoping/references/across files/to global functions/main with qualified import with alias.sdstest @@ -0,0 +1,33 @@ +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 + +pipeline myPipeline { + // $TEST$ references same_myFunction + »myFunction«; + + + // $TEST$ references same_functionInSamePackage + »functionInSamePackage«; + + // $TEST$ references safeds_functionInSafeDsPackage + »functionInSafeDsPackage«; + + // $TEST$ unresolved + »functionInAnotherPackage«; + + // $TEST$ unresolved + »functionWithoutPackage«; + + + // $TEST$ references same_myFunction + »myFunctionInSamePackage«; + + // $TEST$ references safeds_myFunction + »myFunctionInSafeDsPackage«; + + // $TEST$ references other_myFunction + »myFunctionInAnotherPackage«; +} 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 new file mode 100644 index 000000000..1b284e43a --- /dev/null +++ b/tests/resources/scoping/references/across files/to global functions/main with qualified import.sdstest @@ -0,0 +1,22 @@ +package tests.scoping.references.acrossFiles.toGlobalFunctions + +import safeds.scoping.references.acrossFiles.toGlobalFunctions.myFunction +import tests.scoping.references.acrossFiles.toGlobalFunctions.other.functionInAnotherPackage +import functionWithoutPackage + +pipeline myPipeline { + // $TEST$ references safeds_myFunction + »myFunction«; + + // $TEST$ references same_functionInSamePackage + »functionInSamePackage«; + + // $TEST$ references safeds_functionInSafeDsPackage + »functionInSafeDsPackage«; + + // $TEST$ references other_functionInAnotherPackage + »functionInAnotherPackage«; + + // $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 new file mode 100644 index 000000000..25a9bec1f --- /dev/null +++ b/tests/resources/scoping/references/across files/to global functions/main with wildcard import.sdstest @@ -0,0 +1,20 @@ +package tests.scoping.references.acrossFiles.toGlobalFunctions + +import safeds.scoping.references.acrossFiles.toGlobalFunctions.* + +pipeline myPipeline { + // $TEST$ references safeds_myFunction + »myFunction«; + + // $TEST$ references same_functionInSamePackage + »functionInSamePackage«; + + // $TEST$ references safeds_functionInSafeDsPackage + »functionInSafeDsPackage«; + + // $TEST$ unresolved + »functionInAnotherPackage«; + + // $TEST$ unresolved + »functionWithoutPackage«; +} 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 new file mode 100644 index 000000000..7bd735c20 --- /dev/null +++ b/tests/resources/scoping/references/across files/to global functions/resource other package.sdstest @@ -0,0 +1,7 @@ +package tests.scoping.references.acrossFiles.toGlobalFunctions.other + +// $TEST$ target other_myFunction +fun »myFunction«() + +// $TEST$ target other_functionInAnotherPackage +fun »functionInAnotherPackage«() diff --git a/tests/resources/scoping/references/across files/to global functions/resource safeds package.sdstest b/tests/resources/scoping/references/across files/to global functions/resource safeds package.sdstest new file mode 100644 index 000000000..42f3f9bdf --- /dev/null +++ b/tests/resources/scoping/references/across files/to global functions/resource safeds package.sdstest @@ -0,0 +1,7 @@ +package safeds.scoping.references.acrossFiles.toGlobalFunctions + +// $TEST$ target safeds_myFunction +fun »myFunction«() + +// $TEST$ target safeds_functionInSafeDsPackage +fun »functionInSafeDsPackage«() diff --git a/tests/resources/scoping/references/across files/to global functions/resource same package.sdstest b/tests/resources/scoping/references/across files/to global functions/resource same package.sdstest new file mode 100644 index 000000000..969c2847d --- /dev/null +++ b/tests/resources/scoping/references/across files/to global functions/resource same package.sdstest @@ -0,0 +1,7 @@ +package tests.scoping.references.acrossFiles.toGlobalFunctions + +// $TEST$ target same_myFunction +fun »myFunction«() + +// $TEST$ target same_functionInSamePackage +fun »functionInSamePackage«() diff --git a/tests/resources/scoping/references/across files/to global functions/resource without package.sdstest b/tests/resources/scoping/references/across files/to global functions/resource without package.sdstest new file mode 100644 index 000000000..fc524811a --- /dev/null +++ b/tests/resources/scoping/references/across files/to global functions/resource without package.sdstest @@ -0,0 +1,5 @@ +// $TEST$ target without_myFunction +fun »myFunction«() + +// $TEST$ target without_functionWithoutPackage +fun »functionWithoutPackage«() diff --git a/tests/resources/scoping/references/across files/to pipelines/main no imports or own declarations.sdstest b/tests/resources/scoping/references/across files/to pipelines/main no imports or own declarations.sdstest new file mode 100644 index 000000000..2a5d91748 --- /dev/null +++ b/tests/resources/scoping/references/across files/to pipelines/main no imports or own declarations.sdstest @@ -0,0 +1,18 @@ +package tests.scoping.references.acrossFiles.toPipelines + +segment mySegment() { + // $TEST$ unresolved + »myPipeline«; + + // $TEST$ unresolved + »pipelineInSamePackage«; + + // $TEST$ unresolved + »pipelineInSafeDsPackage«; + + // $TEST$ unresolved + »pipelineInAnotherPackage«; + + // $TEST$ unresolved + »pipelineWithoutPackage«; +} 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 new file mode 100644 index 000000000..2316d125e --- /dev/null +++ b/tests/resources/scoping/references/across files/to pipelines/main with imports and own declarations.sdstest @@ -0,0 +1,24 @@ +package tests.scoping.references.acrossFiles.toPipelines + +import safeds.scoping.references.acrossFiles.toPipelines.myPipeline as myOwnPipeline +import tests.scoping.references.acrossFiles.toPipelines.other.pipelineInAnotherPackage + +// $TEST$ target own_myOwnPipeline +pipeline »myOwnPipeline« {} + +segment mySegment() { + // $TEST$ references own_myOwnPipeline + »myOwnPipeline«; + + // $TEST$ unresolved + »pipelineInSamePackage«; + + // $TEST$ unresolved + »pipelineInSafeDsPackage«; + + // $TEST$ unresolved + »pipelineInAnotherPackage«; + + // $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 new file mode 100644 index 000000000..5a5d0b776 --- /dev/null +++ b/tests/resources/scoping/references/across files/to pipelines/main with multiple imports of same name.sdstest @@ -0,0 +1,10 @@ +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 + +segment mySegment() { + // $TEST$ unresolved + »myPipeline«; +} 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 new file mode 100644 index 000000000..31df86e91 --- /dev/null +++ b/tests/resources/scoping/references/across files/to pipelines/main with qualified import with alias.sdstest @@ -0,0 +1,33 @@ +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 + +segment mySegment() { + // $TEST$ unresolved + »myPipeline«; + + + // $TEST$ unresolved + »pipelineInSamePackage«; + + // $TEST$ unresolved + »pipelineInSafeDsPackage«; + + // $TEST$ unresolved + »pipelineInAnotherPackage«; + + // $TEST$ unresolved + »pipelineWithoutPackage«; + + + // $TEST$ unresolved + »myPipelineInSamePackage«; + + // $TEST$ unresolved + »myPipelineInSafeDsPackage«; + + // $TEST$ unresolved + »myPipelineInAnotherPackage«; +} 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 new file mode 100644 index 000000000..a7abe3f1c --- /dev/null +++ b/tests/resources/scoping/references/across files/to pipelines/main with qualified import.sdstest @@ -0,0 +1,22 @@ +package tests.scoping.references.acrossFiles.toPipelines + +import safeds.scoping.references.acrossFiles.toPipelines.myPipeline +import tests.scoping.references.acrossFiles.toPipelines.other.pipelineInAnotherPackage +import pipelineWithoutPackage + +segment mySegment() { + // $TEST$ unresolved + »myPipeline«; + + // $TEST$ unresolved + »pipelineInSamePackage«; + + // $TEST$ unresolved + »pipelineInSafeDsPackage«; + + // $TEST$ unresolved + »pipelineInAnotherPackage«; + + // $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 new file mode 100644 index 000000000..b927897c3 --- /dev/null +++ b/tests/resources/scoping/references/across files/to pipelines/main with wildcard import.sdstest @@ -0,0 +1,20 @@ +package tests.scoping.references.acrossFiles.toPipelines + +import safeds.scoping.references.acrossFiles.toPipelines.* + +segment mySegment() { + // $TEST$ unresolved + »myPipeline«; + + // $TEST$ unresolved + »pipelineInSamePackage«; + + // $TEST$ unresolved + »pipelineInSafeDsPackage«; + + // $TEST$ unresolved + »pipelineInAnotherPackage«; + + // $TEST$ unresolved + »pipelineWithoutPackage«; +} 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 new file mode 100644 index 000000000..5b3b1fed0 --- /dev/null +++ b/tests/resources/scoping/references/across files/to pipelines/resource other package.sdstest @@ -0,0 +1,7 @@ +package tests.scoping.references.acrossFiles.toPipelines.other + +// $TEST$ target other_myPipeline +pipeline »myPipeline« {} + +// $TEST$ target other_pipelineInAnotherPackage +pipeline »pipelineInAnotherPackage« {} diff --git a/tests/resources/scoping/references/across files/to pipelines/resource safeds package.sdstest b/tests/resources/scoping/references/across files/to pipelines/resource safeds package.sdstest new file mode 100644 index 000000000..9f66ceb09 --- /dev/null +++ b/tests/resources/scoping/references/across files/to pipelines/resource safeds package.sdstest @@ -0,0 +1,7 @@ +package safeds.scoping.references.acrossFiles.toPipelines + +// $TEST$ target safeds_myPipeline +pipeline »myPipeline« {} + +// $TEST$ target safeds_pipelineInSafeDsPackage +pipeline »pipelineInSafeDsPackage« {} diff --git a/tests/resources/scoping/references/across files/to pipelines/resource same package.sdstest b/tests/resources/scoping/references/across files/to pipelines/resource same package.sdstest new file mode 100644 index 000000000..34cec8cad --- /dev/null +++ b/tests/resources/scoping/references/across files/to pipelines/resource same package.sdstest @@ -0,0 +1,7 @@ +package tests.scoping.references.acrossFiles.toPipelines + +// $TEST$ target same_myPipeline +pipeline »myPipeline« {} + +// $TEST$ target same_pipelineInSamePackage +pipeline »pipelineInSamePackage« {} diff --git a/tests/resources/scoping/references/across files/to pipelines/resource without package.sdstest b/tests/resources/scoping/references/across files/to pipelines/resource without package.sdstest new file mode 100644 index 000000000..da94d86ff --- /dev/null +++ b/tests/resources/scoping/references/across files/to pipelines/resource without package.sdstest @@ -0,0 +1,5 @@ +// $TEST$ target without_myPipeline +pipeline »myPipeline« {} + +// $TEST$ target without_pipelineWithoutPackage +pipeline »pipelineWithoutPackage« {} diff --git a/tests/resources/scoping/references/across files/to schemas/main no imports or own declarations.sdstest b/tests/resources/scoping/references/across files/to schemas/main no imports or own declarations.sdstest new file mode 100644 index 000000000..9d84b9228 --- /dev/null +++ b/tests/resources/scoping/references/across files/to schemas/main no imports or own declarations.sdstest @@ -0,0 +1,18 @@ +package tests.scoping.references.acrossFiles.toSchemas + +pipeline myPipeline { + // $TEST$ references same_MySchema + »MySchema«; + + // $TEST$ references same_SchemaInSamePackage + »SchemaInSamePackage«; + + // $TEST$ references safeds_SchemaInSafeDsPackage + »SchemaInSafeDsPackage«; + + // $TEST$ unresolved + »SchemaInAnotherPackage«; + + // $TEST$ unresolved + »SchemaWithoutPackage«; +} 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 new file mode 100644 index 000000000..f1a352bb6 --- /dev/null +++ b/tests/resources/scoping/references/across files/to schemas/main with imports and own declarations.sdstest @@ -0,0 +1,24 @@ +package tests.scoping.references.acrossFiles.toSchemas + +import safeds.scoping.references.acrossFiles.toSchemas.MySchema as MyOwnSchema +import tests.scoping.references.acrossFiles.toSchemas.other.SchemaInAnotherPackage + +// $TEST$ target own_MyOwnSchema +schema »MyOwnSchema« {} + +pipeline myPipeline { + // $TEST$ references own_MyOwnSchema + »MyOwnSchema«; + + // $TEST$ references same_SchemaInSamePackage + »SchemaInSamePackage«; + + // $TEST$ references safeds_SchemaInSafeDsPackage + »SchemaInSafeDsPackage«; + + // $TEST$ references other_SchemaInAnotherPackage + »SchemaInAnotherPackage«; + + // $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 new file mode 100644 index 000000000..2432bbea7 --- /dev/null +++ b/tests/resources/scoping/references/across files/to schemas/main with multiple imports of same name.sdstest @@ -0,0 +1,10 @@ +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 + +pipeline myPipeline { + // $TEST$ references safeds_MySchema + »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 new file mode 100644 index 000000000..be3848aed --- /dev/null +++ b/tests/resources/scoping/references/across files/to schemas/main with qualified import with alias.sdstest @@ -0,0 +1,33 @@ +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 + +pipeline myPipeline { + // $TEST$ references same_MySchema + »MySchema«; + + + // $TEST$ references same_SchemaInSamePackage + »SchemaInSamePackage«; + + // $TEST$ references safeds_SchemaInSafeDsPackage + »SchemaInSafeDsPackage«; + + // $TEST$ unresolved + »SchemaInAnotherPackage«; + + // $TEST$ unresolved + »SchemaWithoutPackage«; + + + // $TEST$ references same_MySchema + »MySchemaInSamePackage«; + + // $TEST$ references safeds_MySchema + »MySchemaInSafeDsPackage«; + + // $TEST$ references other_MySchema + »MySchemaInAnotherPackage«; +} 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 new file mode 100644 index 000000000..7fa2ba368 --- /dev/null +++ b/tests/resources/scoping/references/across files/to schemas/main with qualified import.sdstest @@ -0,0 +1,22 @@ +package tests.scoping.references.acrossFiles.toSchemas + +import safeds.scoping.references.acrossFiles.toSchemas.MySchema +import tests.scoping.references.acrossFiles.toSchemas.other.SchemaInAnotherPackage +import SchemaWithoutPackage + +pipeline myPipeline { + // $TEST$ references safeds_MySchema + »MySchema«; + + // $TEST$ references same_SchemaInSamePackage + »SchemaInSamePackage«; + + // $TEST$ references safeds_SchemaInSafeDsPackage + »SchemaInSafeDsPackage«; + + // $TEST$ references other_SchemaInAnotherPackage + »SchemaInAnotherPackage«; + + // $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 new file mode 100644 index 000000000..fb588ead9 --- /dev/null +++ b/tests/resources/scoping/references/across files/to schemas/main with wildcard import.sdstest @@ -0,0 +1,20 @@ +package tests.scoping.references.acrossFiles.toSchemas + +import safeds.scoping.references.acrossFiles.toSchemas.* + +pipeline myPipeline { + // $TEST$ references safeds_MySchema + »MySchema«; + + // $TEST$ references same_SchemaInSamePackage + »SchemaInSamePackage«; + + // $TEST$ references safeds_SchemaInSafeDsPackage + »SchemaInSafeDsPackage«; + + // $TEST$ unresolved + »SchemaInAnotherPackage«; + + // $TEST$ unresolved + »SchemaWithoutPackage«; +} 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 new file mode 100644 index 000000000..ec9b6e799 --- /dev/null +++ b/tests/resources/scoping/references/across files/to schemas/resource other package.sdstest @@ -0,0 +1,7 @@ +package tests.scoping.references.acrossFiles.toSchemas.other + +// $TEST$ target other_MySchema +schema »MySchema« {} + +// $TEST$ target other_SchemaInAnotherPackage +schema »SchemaInAnotherPackage« {} diff --git a/tests/resources/scoping/references/across files/to schemas/resource safeds package.sdstest b/tests/resources/scoping/references/across files/to schemas/resource safeds package.sdstest new file mode 100644 index 000000000..f8f5a10c6 --- /dev/null +++ b/tests/resources/scoping/references/across files/to schemas/resource safeds package.sdstest @@ -0,0 +1,7 @@ +package safeds.scoping.references.acrossFiles.toSchemas + +// $TEST$ target safeds_MySchema +schema »MySchema« {} + +// $TEST$ target safeds_SchemaInSafeDsPackage +schema »SchemaInSafeDsPackage« {} diff --git a/tests/resources/scoping/references/across files/to schemas/resource same package.sdstest b/tests/resources/scoping/references/across files/to schemas/resource same package.sdstest new file mode 100644 index 000000000..2fdfc079c --- /dev/null +++ b/tests/resources/scoping/references/across files/to schemas/resource same package.sdstest @@ -0,0 +1,7 @@ +package tests.scoping.references.acrossFiles.toSchemas + +// $TEST$ target same_MySchema +schema »MySchema« {} + +// $TEST$ target same_SchemaInSamePackage +schema »SchemaInSamePackage« {} diff --git a/tests/resources/scoping/references/across files/to schemas/resource without package.sdstest b/tests/resources/scoping/references/across files/to schemas/resource without package.sdstest new file mode 100644 index 000000000..89cd8480b --- /dev/null +++ b/tests/resources/scoping/references/across files/to schemas/resource without package.sdstest @@ -0,0 +1,5 @@ +// $TEST$ target without_MySchema +schema »MySchema« {} + +// $TEST$ target without_SchemaWithoutPackage +schema »SchemaWithoutPackage« {} diff --git a/tests/resources/scoping/references/across files/to segments/main no imports or own declarations.sdstest b/tests/resources/scoping/references/across files/to segments/main no imports or own declarations.sdstest new file mode 100644 index 000000000..97e096edc --- /dev/null +++ b/tests/resources/scoping/references/across files/to segments/main no imports or own declarations.sdstest @@ -0,0 +1,46 @@ +package tests.scoping.references.acrossFiles.toSegments + +pipeline myPipeline { + // $TEST$ references same_mySegment + »mySegment«; + + + // $TEST$ references same_publicSegmentInSamePackage + »publicSegmentInSamePackage«; + + // $TEST$ references same_internalSegmentInSamePackage + »internalSegmentInSamePackage«; + + // $TEST$ unresolved + »privateSegmentInSamePackage«; + + + // $TEST$ references safeds_publicSegmentInSafeDsPackage + »publicSegmentInSafeDsPackage«; + + // $TEST$ unresolved + »internalSegmentInSafeDsPackage«; + + // $TEST$ unresolved + »privateSegmentInSafeDsPackage«; + + + // $TEST$ unresolved + »publicSegmentInAnotherPackage«; + + // $TEST$ unresolved + »internalSegmentInAnotherPackage«; + + // $TEST$ unresolved + »privateSegmentInAnotherPackage«; + + + // $TEST$ unresolved + »publicSegmentWithoutPackage«; + + // $TEST$ unresolved + »internalSegmentWithoutPackage«; + + // $TEST$ unresolved + »privateSegmentWithoutPackage«; +} 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 new file mode 100644 index 000000000..fe7c506b7 --- /dev/null +++ b/tests/resources/scoping/references/across files/to segments/main with imports and own declarations.sdstest @@ -0,0 +1,54 @@ +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 + +// $TEST$ target own_myOwnSegment +segment »myOwnSegment«() {} + +pipeline myPipeline { + // $TEST$ references own_myOwnSegment + »myOwnSegment«; + + + // $TEST$ references same_publicSegmentInSamePackage + »publicSegmentInSamePackage«; + + // $TEST$ references same_internalSegmentInSamePackage + »internalSegmentInSamePackage«; + + // $TEST$ unresolved + »privateSegmentInSamePackage«; + + + // $TEST$ references safeds_publicSegmentInSafeDsPackage + »publicSegmentInSafeDsPackage«; + + // $TEST$ unresolved + »internalSegmentInSafeDsPackage«; + + // $TEST$ unresolved + »privateSegmentInSafeDsPackage«; + + + // $TEST$ references other_publicSegmentInAnotherPackage + »publicSegmentInAnotherPackage«; + + // $TEST$ unresolved + »internalSegmentInAnotherPackage«; + + // $TEST$ unresolved + »privateSegmentInAnotherPackage«; + + + // $TEST$ unresolved + »publicSegmentWithoutPackage«; + + // $TEST$ unresolved + »internalSegmentWithoutPackage«; + + // $TEST$ unresolved + »privateSegmentWithoutPackage«; +} 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 new file mode 100644 index 000000000..acf8a5dbb --- /dev/null +++ b/tests/resources/scoping/references/across files/to segments/main with multiple imports of same name.sdstest @@ -0,0 +1,10 @@ +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 + +pipeline myPipeline { + // $TEST$ references safeds_mySegment + »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 new file mode 100644 index 000000000..31142f1e7 --- /dev/null +++ b/tests/resources/scoping/references/across files/to segments/main with qualified import with alias.sdstest @@ -0,0 +1,60 @@ +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 + +pipeline myPipeline { + // $TEST$ references same_mySegment + »mySegment«; + + + // $TEST$ references same_publicSegmentInSamePackage + »publicSegmentInSamePackage«; + + // $TEST$ references same_internalSegmentInSamePackage + »internalSegmentInSamePackage«; + + // $TEST$ unresolved + »privateSegmentInSamePackage«; + + + // $TEST$ references safeds_publicSegmentInSafeDsPackage + »publicSegmentInSafeDsPackage«; + + // $TEST$ unresolved + »internalSegmentInSafeDsPackage«; + + // $TEST$ unresolved + »privateSegmentInSafeDsPackage«; + + + // $TEST$ unresolved + »publicSegmentInAnotherPackage«; + + // $TEST$ unresolved + »internalSegmentInAnotherPackage«; + + // $TEST$ unresolved + »privateSegmentInAnotherPackage«; + + + // $TEST$ unresolved + »publicSegmentWithoutPackage«; + + // $TEST$ unresolved + »internalSegmentWithoutPackage«; + + // $TEST$ unresolved + »privateSegmentWithoutPackage«; + + + // $TEST$ references same_mySegment + »mySegmentInSamePackage«; + + // $TEST$ references safeds_mySegment + »mySegmentInSafeDsPackage«; + + // $TEST$ references other_mySegment + »mySegmentInAnotherPackage«; +} 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 new file mode 100644 index 000000000..27ac77fa3 --- /dev/null +++ b/tests/resources/scoping/references/across files/to segments/main with qualified import.sdstest @@ -0,0 +1,54 @@ +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 + +pipeline myPipeline { + // $TEST$ references safeds_mySegment + »mySegment«; + + + // $TEST$ references same_publicSegmentInSamePackage + »publicSegmentInSamePackage«; + + // $TEST$ references same_internalSegmentInSamePackage + »internalSegmentInSamePackage«; + + // $TEST$ unresolved + »privateSegmentInSamePackage«; + + + // $TEST$ references safeds_publicSegmentInSafeDsPackage + »publicSegmentInSafeDsPackage«; + + // $TEST$ unresolved + »internalSegmentInSafeDsPackage«; + + // $TEST$ unresolved + »privateSegmentInSafeDsPackage«; + + + // $TEST$ references other_publicSegmentInAnotherPackage + »publicSegmentInAnotherPackage«; + + // $TEST$ unresolved + »internalSegmentInAnotherPackage«; + + // $TEST$ unresolved + »privateSegmentInAnotherPackage«; + + + // $TEST$ unresolved + »publicSegmentWithoutPackage«; + + // $TEST$ unresolved + »internalSegmentWithoutPackage«; + + // $TEST$ unresolved + »privateSegmentWithoutPackage«; +} 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 new file mode 100644 index 000000000..d30873df9 --- /dev/null +++ b/tests/resources/scoping/references/across files/to segments/main with wildcard import.sdstest @@ -0,0 +1,48 @@ +package tests.scoping.references.acrossFiles.toSegments + +import safeds.scoping.references.acrossFiles.toSegments.* + +pipeline myPipeline { + // $TEST$ references safeds_mySegment + »mySegment«; + + + // $TEST$ references same_publicSegmentInSamePackage + »publicSegmentInSamePackage«; + + // $TEST$ references same_internalSegmentInSamePackage + »internalSegmentInSamePackage«; + + // $TEST$ unresolved + »privateSegmentInSamePackage«; + + + // $TEST$ references safeds_publicSegmentInSafeDsPackage + »publicSegmentInSafeDsPackage«; + + // $TEST$ unresolved + »internalSegmentInSafeDsPackage«; + + // $TEST$ unresolved + »privateSegmentInSafeDsPackage«; + + + // $TEST$ unresolved + »publicSegmentInAnotherPackage«; + + // $TEST$ unresolved + »internalSegmentInAnotherPackage«; + + // $TEST$ unresolved + »privateSegmentInAnotherPackage«; + + + // $TEST$ unresolved + »publicSegmentWithoutPackage«; + + // $TEST$ unresolved + »internalSegmentWithoutPackage«; + + // $TEST$ unresolved + »privateSegmentWithoutPackage«; +} 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 new file mode 100644 index 000000000..e444de353 --- /dev/null +++ b/tests/resources/scoping/references/across files/to segments/resource other package.sdstest @@ -0,0 +1,13 @@ +package tests.scoping.references.acrossFiles.toSegments.other + +// $TEST$ target other_mySegment +segment »mySegment«() {} + +// $TEST$ target other_publicSegmentInAnotherPackage +segment »publicSegmentInAnotherPackage«() {} + +// $TEST$ target other_internalSegmentInAnotherPackage +internal segment »internalSegmentInAnotherPackage«() {} + +// $TEST$ target other_privateSegmentInAnotherPackage +private segment »privateSegmentInAnotherPackage«() {} diff --git a/tests/resources/scoping/references/across files/to segments/resource safeds package.sdstest b/tests/resources/scoping/references/across files/to segments/resource safeds package.sdstest new file mode 100644 index 000000000..2f1e577e5 --- /dev/null +++ b/tests/resources/scoping/references/across files/to segments/resource safeds package.sdstest @@ -0,0 +1,13 @@ +package safeds.scoping.references.acrossFiles.toSegments + +// $TEST$ target safeds_mySegment +segment »mySegment«() {} + +// $TEST$ target safeds_publicSegmentInSafeDsPackage +segment »publicSegmentInSafeDsPackage«() {} + +// $TEST$ target safeds_internalSegmentInSafeDsPackage +internal segment »internalSegmentInSafeDsPackage«() {} + +// $TEST$ target safeds_privateSegmentInSafeDsPackage +private segment »privateSegmentInSafeDsPackage«() {} diff --git a/tests/resources/scoping/references/across files/to segments/resource same package.sdstest b/tests/resources/scoping/references/across files/to segments/resource same package.sdstest new file mode 100644 index 000000000..9d1f66b42 --- /dev/null +++ b/tests/resources/scoping/references/across files/to segments/resource same package.sdstest @@ -0,0 +1,13 @@ +package tests.scoping.references.acrossFiles.toSegments + +// $TEST$ target same_mySegment +segment »mySegment«() {} + +// $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/references/across files/to segments/resource without package.sdstest b/tests/resources/scoping/references/across files/to segments/resource without package.sdstest new file mode 100644 index 000000000..6c6e2ca64 --- /dev/null +++ b/tests/resources/scoping/references/across files/to segments/resource without package.sdstest @@ -0,0 +1,11 @@ +// $TEST$ target without_mySegment +segment »mySegment«() {} + +// $TEST$ target without_publicSegmentWithoutPackage +segment »publicSegmentWithoutPackage«() {} + +// $TEST$ target without_internalSegmentWithoutPackage +internal segment »internalSegmentWithoutPackage«() {} + +// $TEST$ target without_privateSegmentWithoutPackage +private segment »privateSegmentWithoutPackage«() {} diff --git a/tests/resources/scoping/references/to annotations/main.sdstest b/tests/resources/scoping/references/in same file/to annotations/main.sdstest similarity index 78% rename from tests/resources/scoping/references/to annotations/main.sdstest rename to tests/resources/scoping/references/in same file/to annotations/main.sdstest index ad95948e2..1564119c5 100644 --- a/tests/resources/scoping/references/to annotations/main.sdstest +++ b/tests/resources/scoping/references/in same file/to annotations/main.sdstest @@ -1,4 +1,4 @@ -package tests.scoping.references.toAnnotations +package tests.scoping.references.inSameFile.toAnnotations // $TEST$ target before annotation »Before« diff --git a/tests/resources/scoping/references/to block lambda results/from outside/main.sdstest b/tests/resources/scoping/references/in same file/to block lambda results/from outside/main.sdstest similarity index 63% rename from tests/resources/scoping/references/to block lambda results/from outside/main.sdstest rename to tests/resources/scoping/references/in same file/to block lambda results/from outside/main.sdstest index ddfe6789c..95875b7d5 100644 --- a/tests/resources/scoping/references/to block lambda results/from outside/main.sdstest +++ b/tests/resources/scoping/references/in same file/to block lambda results/from outside/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.references.toBlockLambdaResults.fromOutside +package tests.scoping.references.inSameFile.toBlockLambdaResults.fromOutside pipeline myPipeline { () { diff --git a/tests/resources/scoping/references/to block lambda results/of containing block lambda/main.sdstest b/tests/resources/scoping/references/in same file/to block lambda results/of containing block lambda/main.sdstest similarity index 58% rename from tests/resources/scoping/references/to block lambda results/of containing block lambda/main.sdstest rename to tests/resources/scoping/references/in same file/to block lambda results/of containing block lambda/main.sdstest index 477856487..4a06f68da 100644 --- a/tests/resources/scoping/references/to block lambda results/of containing block lambda/main.sdstest +++ b/tests/resources/scoping/references/in same file/to block lambda results/of containing block lambda/main.sdstest @@ -1,4 +1,4 @@ -package tests.scoping.references.toBlockLambdaResults.ofContainingBlockLambda +package tests.scoping.references.inSameFile.toBlockLambdaResults.ofContainingBlockLambda pipeline myPipeline { () { diff --git a/tests/resources/scoping/references/to class members/main.sdstest b/tests/resources/scoping/references/in same file/to class members/main.sdstest similarity index 89% rename from tests/resources/scoping/references/to class members/main.sdstest rename to tests/resources/scoping/references/in same file/to class members/main.sdstest index 93bc34f57..373eceea1 100644 --- a/tests/resources/scoping/references/to class members/main.sdstest +++ b/tests/resources/scoping/references/in same file/to class members/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.references.toClassMembers +package tests.scoping.references.inSameFile.toClassMembers class MyClass { static attr staticAttribute: Int diff --git a/tests/resources/scoping/references/to enum variants/main.sdstest b/tests/resources/scoping/references/in same file/to enum variants/main.sdstest similarity index 64% rename from tests/resources/scoping/references/to enum variants/main.sdstest rename to tests/resources/scoping/references/in same file/to enum variants/main.sdstest index 5bd55a442..180d015cc 100644 --- a/tests/resources/scoping/references/to enum variants/main.sdstest +++ b/tests/resources/scoping/references/in same file/to enum variants/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.references.toEnumVariants +package tests.scoping.references.inSameFile.toEnumVariants enum MyEnum { MyEnumVariant diff --git a/tests/resources/scoping/references/to global classes/main.sdstest b/tests/resources/scoping/references/in same file/to global classes/main.sdstest similarity index 77% rename from tests/resources/scoping/references/to global classes/main.sdstest rename to tests/resources/scoping/references/in same file/to global classes/main.sdstest index ba28ba16c..0085cf6ce 100644 --- a/tests/resources/scoping/references/to global classes/main.sdstest +++ b/tests/resources/scoping/references/in same file/to global classes/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.references.toGlobalClasses +package tests.scoping.references.inSameFile.toGlobalClasses // $TEST$ target before class »Before«() diff --git a/tests/resources/scoping/references/to global enums/main.sdstest b/tests/resources/scoping/references/in same file/to global enums/main.sdstest similarity index 77% rename from tests/resources/scoping/references/to global enums/main.sdstest rename to tests/resources/scoping/references/in same file/to global enums/main.sdstest index 34160929d..9ec1275ab 100644 --- a/tests/resources/scoping/references/to global enums/main.sdstest +++ b/tests/resources/scoping/references/in same file/to global enums/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.references.toGlobalEnums +package tests.scoping.references.inSameFile.toGlobalEnums // $TEST$ target before enum »Before« diff --git a/tests/resources/scoping/references/to global functions/main.sdstest b/tests/resources/scoping/references/in same file/to global functions/main.sdstest similarity index 76% rename from tests/resources/scoping/references/to global functions/main.sdstest rename to tests/resources/scoping/references/in same file/to global functions/main.sdstest index 06a825ded..7f07163a3 100644 --- a/tests/resources/scoping/references/to global functions/main.sdstest +++ b/tests/resources/scoping/references/in same file/to global functions/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.references.toGlobalFunctions +package tests.scoping.references.inSameFile.toGlobalFunctions // $TEST$ target before fun »before«() diff --git a/tests/resources/scoping/references/to parameters/from outside/main.sdstest b/tests/resources/scoping/references/in same file/to parameters/from outside/main.sdstest similarity index 92% rename from tests/resources/scoping/references/to parameters/from outside/main.sdstest rename to tests/resources/scoping/references/in same file/to parameters/from outside/main.sdstest index 1986e55c7..d923ca8e4 100644 --- a/tests/resources/scoping/references/to parameters/from outside/main.sdstest +++ b/tests/resources/scoping/references/in same file/to parameters/from outside/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.references.toParameters.fromOutside +package tests.scoping.references.inSameFile.toParameters.fromOutside annotation MyAnnotation(myAnnotationParameter: String) diff --git a/tests/resources/scoping/references/to parameters/of containing block lambda/main.sdstest b/tests/resources/scoping/references/in same file/to parameters/of containing block lambda/main.sdstest similarity index 96% rename from tests/resources/scoping/references/to parameters/of containing block lambda/main.sdstest rename to tests/resources/scoping/references/in same file/to parameters/of containing block lambda/main.sdstest index 14248eaf0..5ca399e94 100644 --- a/tests/resources/scoping/references/to parameters/of containing block lambda/main.sdstest +++ b/tests/resources/scoping/references/in same file/to parameters/of containing block lambda/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.references.toParameters.ofContainingBlockLambda +package tests.scoping.references.inSameFile.toParameters.ofContainingBlockLambda segment mySegment(myShadowedSegmentParameter: Int) { val myShadowedPlaceholder = 0; diff --git a/tests/resources/scoping/references/to parameters/of containing expression lambda/main.sdstest b/tests/resources/scoping/references/in same file/to parameters/of containing expression lambda/main.sdstest similarity index 96% rename from tests/resources/scoping/references/to parameters/of containing expression lambda/main.sdstest rename to tests/resources/scoping/references/in same file/to parameters/of containing expression lambda/main.sdstest index 0bc466ff4..1f5fd6cc7 100644 --- a/tests/resources/scoping/references/to parameters/of containing expression lambda/main.sdstest +++ b/tests/resources/scoping/references/in same file/to parameters/of containing expression lambda/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.references.toParameters.ofContainingExpressionLambda +package tests.scoping.references.inSameFile.toParameters.ofContainingExpressionLambda segment mySegment(myShadowedSegmentParameter: Int) { val myShadowedPlaceholder = 0; diff --git a/tests/resources/scoping/references/to parameters/of containing segment/main.sdstest b/tests/resources/scoping/references/in same file/to parameters/of containing segment/main.sdstest similarity index 92% rename from tests/resources/scoping/references/to parameters/of containing segment/main.sdstest rename to tests/resources/scoping/references/in same file/to parameters/of containing segment/main.sdstest index b557a3422..6d0766b75 100644 --- a/tests/resources/scoping/references/to parameters/of containing segment/main.sdstest +++ b/tests/resources/scoping/references/in same file/to parameters/of containing segment/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.references.toParameters.ofContainingExpressionLambda +package tests.scoping.references.inSameFile.toParameters.ofContainingExpressionLambda segment mySegment( // $TEST$ target parameter diff --git a/tests/resources/scoping/references/to pipelines/main.sdstest b/tests/resources/scoping/references/in same file/to pipelines/main.sdstest similarity index 79% rename from tests/resources/scoping/references/to pipelines/main.sdstest rename to tests/resources/scoping/references/in same file/to pipelines/main.sdstest index d07dfa4e1..6a0fe7a30 100644 --- a/tests/resources/scoping/references/to pipelines/main.sdstest +++ b/tests/resources/scoping/references/in same file/to pipelines/main.sdstest @@ -1,4 +1,4 @@ -package tests.scoping.references.toPipelines +package tests.scoping.references.inSameFile.toPipelines // $TEST$ target before pipeline »before« {} diff --git a/tests/resources/scoping/references/to placeholders/from outside/main.sdstest b/tests/resources/scoping/references/in same file/to placeholders/from outside/main.sdstest similarity index 84% rename from tests/resources/scoping/references/to placeholders/from outside/main.sdstest rename to tests/resources/scoping/references/in same file/to placeholders/from outside/main.sdstest index ce9c76f8c..6c0aa54d4 100644 --- a/tests/resources/scoping/references/to placeholders/from outside/main.sdstest +++ b/tests/resources/scoping/references/in same file/to placeholders/from outside/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.references.toPlaceholders.fromOutside +package tests.scoping.references.inSameFile.toPlaceholders.fromOutside pipeline myPipeline1 { val pipelinePlaceholder = 1; diff --git a/tests/resources/scoping/references/to placeholders/of containing block lambda/main.sdstest b/tests/resources/scoping/references/in same file/to placeholders/of containing block lambda/main.sdstest similarity index 98% rename from tests/resources/scoping/references/to placeholders/of containing block lambda/main.sdstest rename to tests/resources/scoping/references/in same file/to placeholders/of containing block lambda/main.sdstest index accbb0f1e..434bf178b 100644 --- a/tests/resources/scoping/references/to placeholders/of containing block lambda/main.sdstest +++ b/tests/resources/scoping/references/in same file/to placeholders/of containing block lambda/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.references.toPlaceholders.ofContainingBlockLambda +package tests.scoping.references.inSameFile.toPlaceholders.ofContainingBlockLambda segment mySegment(mySegmentParameter: Int) { val mySegmentPlaceholder = 0; diff --git a/tests/resources/scoping/references/to placeholders/of containing pipeline/main.sdstest b/tests/resources/scoping/references/in same file/to placeholders/of containing pipeline/main.sdstest similarity index 93% rename from tests/resources/scoping/references/to placeholders/of containing pipeline/main.sdstest rename to tests/resources/scoping/references/in same file/to placeholders/of containing pipeline/main.sdstest index 2dfaaf2cb..48ceac04f 100644 --- a/tests/resources/scoping/references/to placeholders/of containing pipeline/main.sdstest +++ b/tests/resources/scoping/references/in same file/to placeholders/of containing pipeline/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.references.toPlaceholders.ofContainingPipeline +package tests.scoping.references.inSameFile.toPlaceholders.ofContainingPipeline pipeline myPipeline { // $TEST$ target before diff --git a/tests/resources/scoping/references/to placeholders/of containing segment/main.sdstest b/tests/resources/scoping/references/in same file/to placeholders/of containing segment/main.sdstest similarity index 93% rename from tests/resources/scoping/references/to placeholders/of containing segment/main.sdstest rename to tests/resources/scoping/references/in same file/to placeholders/of containing segment/main.sdstest index ef7ca94db..4105498b4 100644 --- a/tests/resources/scoping/references/to placeholders/of containing segment/main.sdstest +++ b/tests/resources/scoping/references/in same file/to placeholders/of containing segment/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.references.toPlaceholders.ofContainingSegment +package tests.scoping.references.inSameFile.toPlaceholders.ofContainingSegment segment mySegment() { // $TEST$ target before diff --git a/tests/resources/scoping/references/to redeclared module member/main.sdstest b/tests/resources/scoping/references/in same file/to redeclared module member/main.sdstest similarity index 76% rename from tests/resources/scoping/references/to redeclared module member/main.sdstest rename to tests/resources/scoping/references/in same file/to redeclared module member/main.sdstest index da491d143..55939d2fd 100644 --- a/tests/resources/scoping/references/to redeclared module member/main.sdstest +++ b/tests/resources/scoping/references/in same file/to redeclared module member/main.sdstest @@ -1,4 +1,4 @@ -package tests.scoping.references.toRedeclaredModuleMember +package tests.scoping.references.inSameFile.toRedeclaredModuleMember // $TEST$ target before class »Before« diff --git a/tests/resources/scoping/references/to results/from outside/main.sdstest b/tests/resources/scoping/references/in same file/to results/from outside/main.sdstest similarity index 83% rename from tests/resources/scoping/references/to results/from outside/main.sdstest rename to tests/resources/scoping/references/in same file/to results/from outside/main.sdstest index f105dcb1c..4943e09ca 100644 --- a/tests/resources/scoping/references/to results/from outside/main.sdstest +++ b/tests/resources/scoping/references/in same file/to results/from outside/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.references.toResults.fromOutside +package tests.scoping.references.inSameFile.toResults.fromOutside fun myFunction() -> (myFunctionResult: String) diff --git a/tests/resources/scoping/references/to results/of containing segment/main.sdstest b/tests/resources/scoping/references/in same file/to results/of containing segment/main.sdstest similarity index 53% rename from tests/resources/scoping/references/to results/of containing segment/main.sdstest rename to tests/resources/scoping/references/in same file/to results/of containing segment/main.sdstest index 7a51146af..e07270914 100644 --- a/tests/resources/scoping/references/to results/of containing segment/main.sdstest +++ b/tests/resources/scoping/references/in same file/to results/of containing segment/main.sdstest @@ -1,4 +1,4 @@ -package tests.scoping.references.toResults.ofContainingSegment +package tests.scoping.references.inSameFile.toResults.ofContainingSegment segment mySegment() -> myResult: Int { // $TEST$ unresolved diff --git a/tests/resources/scoping/references/to schemas/main.sdstest b/tests/resources/scoping/references/in same file/to schemas/main.sdstest similarity index 79% rename from tests/resources/scoping/references/to schemas/main.sdstest rename to tests/resources/scoping/references/in same file/to schemas/main.sdstest index 27334104f..a38323616 100644 --- a/tests/resources/scoping/references/to schemas/main.sdstest +++ b/tests/resources/scoping/references/in same file/to schemas/main.sdstest @@ -1,4 +1,4 @@ -package tests.scoping.references.toSchemas +package tests.scoping.references.inSameFile.toSchemas // $TEST$ target before schema »Before« {} diff --git a/tests/resources/scoping/references/to segments/main.sdstest b/tests/resources/scoping/references/in same file/to segments/main.sdstest similarity index 93% rename from tests/resources/scoping/references/to segments/main.sdstest rename to tests/resources/scoping/references/in same file/to segments/main.sdstest index f0157a49a..6223ba59e 100644 --- a/tests/resources/scoping/references/to segments/main.sdstest +++ b/tests/resources/scoping/references/in same file/to segments/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.references.toSegments +package tests.scoping.references.inSameFile.toSegments // $TEST$ target privateBefore private segment »privateBefore«() {} diff --git a/tests/resources/scoping/references/to type parameters/main.sdstest b/tests/resources/scoping/references/in same file/to type parameters/main.sdstest similarity index 57% rename from tests/resources/scoping/references/to type parameters/main.sdstest rename to tests/resources/scoping/references/in same file/to type parameters/main.sdstest index f1f65cb5c..8416c9393 100644 --- a/tests/resources/scoping/references/to type parameters/main.sdstest +++ b/tests/resources/scoping/references/in same file/to type parameters/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.references.toTypeParameters +package tests.scoping.references.inSameFile.toTypeParameters class MyClass() diff --git a/tests/resources/scoping/type arguments/to something other than type parameter/main.sdstest b/tests/resources/scoping/type arguments/to something other than type parameter/main.sdstest index 205fd4c29..d0006b66c 100644 --- a/tests/resources/scoping/type arguments/to something other than type parameter/main.sdstest +++ b/tests/resources/scoping/type arguments/to something other than type parameter/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.typeArguments.toSomethingOtherThanTypeParameter +package tests.scoping.typeArguments.toSomethingOtherThanTypeParameter // $TEST$ unresolved segment mySegment(p: MyClass<»notAtypeParameter« = Int>) {} diff --git a/tests/resources/scoping/type arguments/to type parameter in containing named type declaration/main.sdstest b/tests/resources/scoping/type arguments/to type parameter in containing named type declaration/main.sdstest index 18ea7d8d0..4be384729 100644 --- a/tests/resources/scoping/type arguments/to type parameter in containing named type declaration/main.sdstest +++ b/tests/resources/scoping/type arguments/to type parameter in containing named type declaration/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.typeArguments.toTypeParameterInContainingNamedTypeDeclaration +package tests.scoping.typeArguments.toTypeParameterInContainingNamedTypeDeclaration // $TEST$ target outerClass class MyClass<»T«>( diff --git a/tests/resources/scoping/type arguments/to type parameter in enum variant in global enum/main.sdstest b/tests/resources/scoping/type arguments/to type parameter in enum variant in global enum/main.sdstest index 4e5697474..1527b7600 100644 --- a/tests/resources/scoping/type arguments/to type parameter in enum variant in global enum/main.sdstest +++ b/tests/resources/scoping/type arguments/to type parameter in enum variant in global enum/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.typeArguments.toTypeParameterInEnumVariantInGlobalEnum +package tests.scoping.typeArguments.toTypeParameterInEnumVariantInGlobalEnum enum MyEnum { // $TEST$ target t diff --git a/tests/resources/scoping/type arguments/to type parameter in enum variant in nested enum/main.sdstest b/tests/resources/scoping/type arguments/to type parameter in enum variant in nested enum/main.sdstest index abd7c0da2..1ba7d0103 100644 --- a/tests/resources/scoping/type arguments/to type parameter in enum variant in nested enum/main.sdstest +++ b/tests/resources/scoping/type arguments/to type parameter in enum variant in nested enum/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.typeArguments.toTypeParameterInEnumVariantInNestedEnum +package tests.scoping.typeArguments.toTypeParameterInEnumVariantInNestedEnum class MyClass { enum MyEnum { diff --git a/tests/resources/scoping/type arguments/to type parameter in global class/main.sdstest b/tests/resources/scoping/type arguments/to type parameter in global class/main.sdstest index 20fdfa15f..5ac02bf56 100644 --- a/tests/resources/scoping/type arguments/to type parameter in global class/main.sdstest +++ b/tests/resources/scoping/type arguments/to type parameter in global class/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.typeArguments.toTypeParameterInGlobalClass +package tests.scoping.typeArguments.toTypeParameterInGlobalClass // $TEST$ target t class MyClass<»T«> diff --git a/tests/resources/scoping/type arguments/to type parameter in nested class/main.sdstest b/tests/resources/scoping/type arguments/to type parameter in nested class/main.sdstest index b651424e5..5f02c2b8a 100644 --- a/tests/resources/scoping/type arguments/to type parameter in nested class/main.sdstest +++ b/tests/resources/scoping/type arguments/to type parameter in nested class/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.typeArguments.toTypeParameterInNestedClass +package tests.scoping.typeArguments.toTypeParameterInNestedClass class MyClass { // $TEST$ target t diff --git a/tests/resources/scoping/type arguments/to unresolved/main.sdstest b/tests/resources/scoping/type arguments/to unresolved/main.sdstest index 17864b71b..808373e72 100644 --- a/tests/resources/scoping/type arguments/to unresolved/main.sdstest +++ b/tests/resources/scoping/type arguments/to unresolved/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.typeArguments.toUnresolved +package tests.scoping.typeArguments.toUnresolved segment mySegment( // $TEST$ unresolved diff --git a/tests/resources/scoping/type parameter constraints/in annotation/main.sdstest b/tests/resources/scoping/type parameter constraints/in annotation/main.sdstest index 7a01d31aa..15ac9b26d 100644 --- a/tests/resources/scoping/type parameter constraints/in annotation/main.sdstest +++ b/tests/resources/scoping/type parameter constraints/in annotation/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.typeParameterConstraints.inAnnotation +package tests.scoping.typeParameterConstraints.inAnnotation fun myFunction1() diff --git a/tests/resources/scoping/type parameter constraints/in enum variant in global enum/main.sdstest b/tests/resources/scoping/type parameter constraints/in enum variant in global enum/main.sdstest index 000e229f3..64a3d5aff 100644 --- a/tests/resources/scoping/type parameter constraints/in enum variant in global enum/main.sdstest +++ b/tests/resources/scoping/type parameter constraints/in enum variant in global enum/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.typeParameterConstraints.inEnumVariantInGlobalEnum +package tests.scoping.typeParameterConstraints.inEnumVariantInGlobalEnum fun myFunction1() diff --git a/tests/resources/scoping/type parameter constraints/in enum variant in nested enum/main.sdstest b/tests/resources/scoping/type parameter constraints/in enum variant in nested enum/main.sdstest index 237f3d63f..480af9a95 100644 --- a/tests/resources/scoping/type parameter constraints/in enum variant in nested enum/main.sdstest +++ b/tests/resources/scoping/type parameter constraints/in enum variant in nested enum/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.typeParameterConstraints.inEnumVariantInNestedEnum +package tests.scoping.typeParameterConstraints.inEnumVariantInNestedEnum fun myFunction1() diff --git a/tests/resources/scoping/type parameter constraints/in global class/main.sdstest b/tests/resources/scoping/type parameter constraints/in global class/main.sdstest index 0928121c1..72ee12b1f 100644 --- a/tests/resources/scoping/type parameter constraints/in global class/main.sdstest +++ b/tests/resources/scoping/type parameter constraints/in global class/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.typeParameterConstraints.inGlobalClass +package tests.scoping.typeParameterConstraints.inGlobalClass fun myFunction1() diff --git a/tests/resources/scoping/type parameter constraints/in global function/main.sdstest b/tests/resources/scoping/type parameter constraints/in global function/main.sdstest index cbb53091b..0eaee9277 100644 --- a/tests/resources/scoping/type parameter constraints/in global function/main.sdstest +++ b/tests/resources/scoping/type parameter constraints/in global function/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.typeParameterConstraints.inGlobalFunction +package tests.scoping.typeParameterConstraints.inGlobalFunction fun myFunction1() diff --git a/tests/resources/scoping/type parameter constraints/in method/main.sdstest b/tests/resources/scoping/type parameter constraints/in method/main.sdstest index 057b0a3c4..98b143c00 100644 --- a/tests/resources/scoping/type parameter constraints/in method/main.sdstest +++ b/tests/resources/scoping/type parameter constraints/in method/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.typeParameterConstraints.inMethod +package tests.scoping.typeParameterConstraints.inMethod fun myFunction1() diff --git a/tests/resources/scoping/type parameter constraints/in nested class/main.sdstest b/tests/resources/scoping/type parameter constraints/in nested class/main.sdstest index ec0d152fd..7807ab6e8 100644 --- a/tests/resources/scoping/type parameter constraints/in nested class/main.sdstest +++ b/tests/resources/scoping/type parameter constraints/in nested class/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.typeParameterConstraints.inNestedClass +package tests.scoping.typeParameterConstraints.inNestedClass fun myFunction1() diff --git a/tests/resources/scoping/yields/in pipeline/main.sdstest b/tests/resources/scoping/yields/in pipeline/main.sdstest index 7de32cb4b..c43abe9d8 100644 --- a/tests/resources/scoping/yields/in pipeline/main.sdstest +++ b/tests/resources/scoping/yields/in pipeline/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.yields.inPipeline +package tests.scoping.yields.inPipeline segment mySegment1() -> before: Int {} diff --git a/tests/resources/scoping/yields/in segment/main.sdstest b/tests/resources/scoping/yields/in segment/main.sdstest index bafe0a4ea..56b29de97 100644 --- a/tests/resources/scoping/yields/in segment/main.sdstest +++ b/tests/resources/scoping/yields/in segment/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.yields.inSegment +package tests.scoping.yields.inSegment segment mySegment1() -> before: Int {} diff --git a/tsconfig.json b/tsconfig.json index 0a01d76a8..24bbd82e2 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,9 +6,9 @@ "sourceMap": true, "outDir": "out", "strict": true, - "noUnusedLocals": true, "noImplicitReturns": true, "noImplicitOverride": true, + "noUnusedLocals": false, "moduleResolution": "Node16", "esModuleInterop": true, "skipLibCheck": true,