diff --git a/src/language/ast/checks.ts b/src/language/ast/checks.ts deleted file mode 100644 index 53aeb3e79..000000000 --- a/src/language/ast/checks.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { SdsImport } from '../generated/ast.js'; - -export const isWildcardImport = function (node: SdsImport): boolean { - const importedNamespace = node.importedNamespace ?? ''; - return importedNamespace.endsWith('*'); -}; diff --git a/src/language/builtins/safe-ds-workspace-manager.ts b/src/language/builtins/safe-ds-workspace-manager.ts index a0bcfc4af..7826867cd 100644 --- a/src/language/builtins/safe-ds-workspace-manager.ts +++ b/src/language/builtins/safe-ds-workspace-manager.ts @@ -1,6 +1,6 @@ import { DefaultWorkspaceManager, LangiumDocument, LangiumDocumentFactory, LangiumSharedServices, URI } from 'langium'; import { WorkspaceFolder } from 'vscode-languageserver'; -import { SAFE_DS_FILE_EXTENSIONS } from '../constants/fileExtensions.js'; +import { SAFE_DS_FILE_EXTENSIONS } from '../helpers/fileExtensions.js'; import { globSync } from 'glob'; import path from 'path'; diff --git a/src/language/formatting/safe-ds-formatter.ts b/src/language/formatting/safe-ds-formatter.ts index e016302a9..0bc79f79b 100644 --- a/src/language/formatting/safe-ds-formatter.ts +++ b/src/language/formatting/safe-ds-formatter.ts @@ -10,7 +10,7 @@ import { } from 'langium'; import * as ast from '../generated/ast.js'; import { SdsImport, SdsImportAlias, SdsModule } from '../generated/ast.js'; -import { annotationCallsOrEmpty, literalsOrEmpty, typeArgumentsOrEmpty } from '../ast/shortcuts.js'; +import { annotationCallsOrEmpty, literalsOrEmpty, typeArgumentsOrEmpty } from '../helpers/shortcuts.js'; import noSpace = Formatting.noSpace; import newLine = Formatting.newLine; import newLines = Formatting.newLines; diff --git a/src/language/grammar/safe-ds.langium b/src/language/grammar/safe-ds.langium index c3185e1f1..abec7dc37 100644 --- a/src/language/grammar/safe-ds.langium +++ b/src/language/grammar/safe-ds.langium @@ -754,7 +754,7 @@ SdsString returns SdsString: ; interface SdsReference extends SdsExpression { - target?: @SdsDeclaration + target: @SdsDeclaration } SdsReference returns SdsReference: diff --git a/src/language/ast/utils.ts b/src/language/helpers/ast.ts similarity index 100% rename from src/language/ast/utils.ts rename to src/language/helpers/ast.ts diff --git a/src/language/helpers/checks.ts b/src/language/helpers/checks.ts new file mode 100644 index 000000000..d21b6da87 --- /dev/null +++ b/src/language/helpers/checks.ts @@ -0,0 +1,19 @@ +import { isSdsAttribute, isSdsClass, isSdsEnum, isSdsFunction, SdsClassMember, SdsImport } from '../generated/ast.js'; + +export const isStatic = (node: SdsClassMember): boolean => { + if (isSdsClass(node) || isSdsEnum(node)) { + return true; + } else if (isSdsAttribute(node)) { + return node.static; + } else if (isSdsFunction(node)) { + return node.static; + } else { + /* c8 ignore next 2 */ + return false; + } +}; + +export const isWildcardImport = function (node: SdsImport): boolean { + const importedNamespace = node.importedNamespace ?? ''; + return importedNamespace.endsWith('*'); +}; diff --git a/src/language/constants/fileExtensions.ts b/src/language/helpers/fileExtensions.ts similarity index 100% rename from src/language/constants/fileExtensions.ts rename to src/language/helpers/fileExtensions.ts diff --git a/src/language/ast/shortcuts.ts b/src/language/helpers/shortcuts.ts similarity index 92% rename from src/language/ast/shortcuts.ts rename to src/language/helpers/shortcuts.ts index 25f318313..8a28a2f80 100644 --- a/src/language/ast/shortcuts.ts +++ b/src/language/helpers/shortcuts.ts @@ -59,8 +59,11 @@ export const literalsOrEmpty = function (node: SdsLiteralType | undefined): SdsL return node?.literalList?.literals ?? []; }; -export const classMembersOrEmpty = function (node: SdsClass | undefined): SdsClassMember[] { - return node?.body?.members ?? []; +export const classMembersOrEmpty = function ( + node: SdsClass | undefined, + filterFunction: (member: SdsClassMember) => boolean = () => true, +): SdsClassMember[] { + return node?.body?.members?.filter(filterFunction) ?? []; }; export const enumVariantsOrEmpty = function (node: SdsEnum | undefined): SdsEnumVariant[] { diff --git a/src/language/scoping/safe-ds-scope-provider.ts b/src/language/scoping/safe-ds-scope-provider.ts index 0ebf4be55..3b6632fac 100644 --- a/src/language/scoping/safe-ds-scope-provider.ts +++ b/src/language/scoping/safe-ds-scope-provider.ts @@ -24,6 +24,8 @@ import { isSdsSegment, isSdsStatement, isSdsYield, + SdsDeclaration, + SdsExpression, SdsMemberAccess, SdsMemberType, SdsNamedTypeDeclaration, @@ -33,8 +35,16 @@ import { SdsType, SdsYield, } from '../generated/ast.js'; -import { assigneesOrEmpty, parametersOrEmpty, resultsOrEmpty, statementsOrEmpty } from '../ast/shortcuts.js'; -import { isContainedIn } from '../ast/utils.js'; +import { + assigneesOrEmpty, + classMembersOrEmpty, + enumVariantsOrEmpty, + parametersOrEmpty, + resultsOrEmpty, + statementsOrEmpty, +} from '../helpers/shortcuts.js'; +import { isContainedIn } from '../helpers/ast.js'; +import { isStatic } from '../helpers/checks.js'; export class SafeDsScopeProvider extends DefaultScopeProvider { override getScope(context: ReferenceInfo): Scope { @@ -80,31 +90,145 @@ export class SafeDsScopeProvider extends DefaultScopeProvider { * Returns the unique declaration that is referenced by this type. If the type references none or multiple * declarations, undefined is returned. * - * @param type The type to get the referenced declaration for. + * @param node The type to get the referenced declaration for. * @returns The referenced declaration or undefined. */ - private getUniqueReferencedDeclarationForType(type: SdsType): SdsNamedTypeDeclaration | undefined { - if (isSdsNamedType(type)) { - return type.declaration.ref; - } else if (isSdsMemberType(type)) { - return type.member.declaration.ref; + private getUniqueReferencedDeclarationForType(node: SdsType): SdsNamedTypeDeclaration | undefined { + if (isSdsNamedType(node)) { + return node.declaration.ref; + } else if (isSdsMemberType(node)) { + return node.member.declaration.ref; } else { return undefined; } } - private getScopeForMemberAccessMember(_node: SdsMemberAccess): Scope { - return EMPTY_SCOPE; + private getScopeForMemberAccessMember(node: SdsMemberAccess): Scope { + let currentScope = EMPTY_SCOPE; + + // Static access + const declaration = this.getUniqueReferencedDeclarationForExpression(node.receiver); + if (isSdsClass(declaration)) { + currentScope = this.createScopeForNodes(classMembersOrEmpty(declaration, isStatic)); + + // val superTypeMembers = receiverDeclaration.superClassMembers() + // .filter { it.isStatic() } + // .toList() + // + // return Scopes.scopeFor(members, Scopes.scopeFor(superTypeMembers)) + } else if (isSdsEnum(declaration)) { + currentScope = this.createScopeForNodes(enumVariantsOrEmpty(declaration)); + } + + // // Call results + // var resultScope = IScope.NULLSCOPE + // if (receiver is SdsCall) { + // val results = receiver.resultsOrNull() + // when { + // results == null -> return IScope.NULLSCOPE + // results.size > 1 -> return Scopes.scopeFor(results) + // results.size == 1 -> resultScope = Scopes.scopeFor(results) + // } + // } + // + // // Members + // val type = (receiver.type() as? NamedType) ?: return resultScope + // + // return when { + // type.isNullable && !context.isNullSafe -> resultScope + // type is ClassType -> { + // val members = type.sdsClass.classMembersOrEmpty().filter { !it.isStatic() } + // val superTypeMembers = type.sdsClass.superClassMembers() + // .filter { !it.isStatic() } + // .toList() + // + // Scopes.scopeFor(members, Scopes.scopeFor(superTypeMembers, resultScope)) + // } + // type is EnumVariantType -> Scopes.scopeFor(type.sdsEnumVariant.parametersOrEmpty()) + // else -> resultScope + // } + + return currentScope; + } + + /** + * Returns the unique declaration that is referenced by this expression. If the expression references none or + * multiple declarations, undefined is returned. + * + * @param node The expression to get the referenced declaration for. + * @returns The referenced declaration or undefined. + */ + private getUniqueReferencedDeclarationForExpression(node: SdsExpression): SdsDeclaration | undefined { + if (isSdsReference(node)) { + return node.target.ref; + } else if (isSdsMemberAccess(node)) { + return node.member.target.ref; + } else { + return undefined; + } } 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) + // } + // Declarations in this file const currentScope = this.globalDeclarationsInSameFile(node, EMPTY_SCOPE); + // // Declarations in containing classes + // context.containingClassOrNull()?.let { + // result = classMembers(it, result) + // } + // + // Declarations in containing blocks return this.localDeclarations(node, currentScope); } + // private fun classMembers(context: SdsClass, parentScope: IScope): IScope { + // return when (val containingClassOrNull = context.containingClassOrNull()) { + // is SdsClass -> Scopes.scopeFor( + // context.classMembersOrEmpty(), + // classMembers(containingClassOrNull, parentScope), + // ) + // else -> Scopes.scopeFor(context.classMembersOrEmpty(), parentScope) + // } + // } + + // /** + // * 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) { @@ -167,122 +291,6 @@ export class SafeDsScopeProvider extends DefaultScopeProvider { } } - // private fun scopeForReferenceDeclaration(context: SdsReference): IScope { - // 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) - // } - // - // // Declarations in this file - // result = declarationsInSameFile(resource, result) - // - // // Declarations in containing classes - // context.containingClassOrNull()?.let { - // result = classMembers(it, result) - // } - // - // // Declarations in containing blocks - // localDeclarations(context, result) - // } - // } - // } - // - // /** - // * 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 fun scopeForMemberAccessDeclaration(context: SdsMemberAccess): IScope { - // val receiver = context.receiver - // - // // Static access - // val receiverDeclaration = when (receiver) { - // is SdsReference -> receiver.declaration - // is SdsMemberAccess -> receiver.member.declaration - // else -> null - // } - // if (receiverDeclaration != null) { - // when (receiverDeclaration) { - // is SdsClass -> { - // val members = receiverDeclaration.classMembersOrEmpty().filter { it.isStatic() } - // val superTypeMembers = receiverDeclaration.superClassMembers() - // .filter { it.isStatic() } - // .toList() - // - // return Scopes.scopeFor(members, Scopes.scopeFor(superTypeMembers)) - // } - // is SdsEnum -> { - // return Scopes.scopeFor(receiverDeclaration.variantsOrEmpty()) - // } - // } - // } - // - // // Call results - // var resultScope = IScope.NULLSCOPE - // if (receiver is SdsCall) { - // val results = receiver.resultsOrNull() - // when { - // results == null -> return IScope.NULLSCOPE - // results.size > 1 -> return Scopes.scopeFor(results) - // results.size == 1 -> resultScope = Scopes.scopeFor(results) - // } - // } - // - // // Members - // val type = (receiver.type() as? NamedType) ?: return resultScope - // - // return when { - // type.isNullable && !context.isNullSafe -> resultScope - // type is ClassType -> { - // val members = type.sdsClass.classMembersOrEmpty().filter { !it.isStatic() } - // val superTypeMembers = type.sdsClass.superClassMembers() - // .filter { !it.isStatic() } - // .toList() - // - // Scopes.scopeFor(members, Scopes.scopeFor(superTypeMembers, resultScope)) - // } - // type is EnumVariantType -> Scopes.scopeFor(type.sdsEnumVariant.parametersOrEmpty()) - // else -> resultScope - // } - // } - // - // private fun classMembers(context: SdsClass, parentScope: IScope): IScope { - // return when (val containingClassOrNull = context.containingClassOrNull()) { - // is SdsClass -> Scopes.scopeFor( - // context.classMembersOrEmpty(), - // classMembers(containingClassOrNull, parentScope), - // ) - // else -> Scopes.scopeFor(context.classMembersOrEmpty(), parentScope) - // } - // } - private getScopeForYieldResult(node: SdsYield): Scope { const containingSegment = getContainerOfType(node, isSdsSegment); if (!containingSegment) { diff --git a/src/language/validation/names.ts b/src/language/validation/names.ts index 1295d5153..eeed27201 100644 --- a/src/language/validation/names.ts +++ b/src/language/validation/names.ts @@ -20,7 +20,7 @@ import { resultsOrEmpty, typeParametersOrEmpty, enumVariantsOrEmpty, -} from '../ast/shortcuts.js'; +} from '../helpers/shortcuts.js'; export const CODE_NAME_BLOCK_LAMBDA_PREFIX = 'name/block-lambda-prefix'; export const CODE_NAME_CASING = 'name/casing'; diff --git a/src/language/validation/other/imports.ts b/src/language/validation/other/imports.ts index 99210eba1..fbe523126 100644 --- a/src/language/validation/other/imports.ts +++ b/src/language/validation/other/imports.ts @@ -1,6 +1,6 @@ import { ValidationAcceptor } from 'langium'; import { SdsImportAlias } from '../../generated/ast.js'; -import { isWildcardImport } from '../../ast/checks.js'; +import { isWildcardImport } from '../../helpers/checks.js'; export const CODE_IMPORT_WILDCARD_IMPORT_WITH_ALIAS = 'import/wildcard-import-with-alias'; diff --git a/src/language/validation/other/modules.ts b/src/language/validation/other/modules.ts index 5975e305f..19f03143f 100644 --- a/src/language/validation/other/modules.ts +++ b/src/language/validation/other/modules.ts @@ -1,6 +1,6 @@ import { ValidationAcceptor } from 'langium'; import { isSdsDeclaration, isSdsPipeline, isSdsSegment, SdsModule } from '../../generated/ast.js'; -import { isInPipelineFile, isInStubFile } from '../../constants/fileExtensions.js'; +import { isInPipelineFile, isInStubFile } from '../../helpers/fileExtensions.js'; export const CODE_MODULE_MISSING_PACKAGE = 'module/missing-package'; diff --git a/src/language/validation/other/types/callableTypes.ts b/src/language/validation/other/types/callableTypes.ts index 4a27db433..28058acde 100644 --- a/src/language/validation/other/types/callableTypes.ts +++ b/src/language/validation/other/types/callableTypes.ts @@ -1,6 +1,6 @@ import { SdsCallableType } from '../../../generated/ast.js'; import { ValidationAcceptor } from 'langium'; -import { parametersOrEmpty } from '../../../ast/shortcuts.js'; +import { parametersOrEmpty } from '../../../helpers/shortcuts.js'; export const CODE_CALLABLE_TYPE_NO_OPTIONAL_PARAMETERS = 'callable-type/no-optional-parameters'; diff --git a/src/language/validation/other/types/unionTypes.ts b/src/language/validation/other/types/unionTypes.ts index 5056ee0d7..ac3a059d3 100644 --- a/src/language/validation/other/types/unionTypes.ts +++ b/src/language/validation/other/types/unionTypes.ts @@ -1,6 +1,6 @@ import { SdsUnionType } from '../../../generated/ast.js'; import { ValidationAcceptor } from 'langium'; -import { typeArgumentsOrEmpty } from '../../../ast/shortcuts.js'; +import { typeArgumentsOrEmpty } from '../../../helpers/shortcuts.js'; import { isEmpty } from 'radash'; export const CODE_UNION_TYPE_MISSING_TYPE_ARGUMENTS = 'union-type/missing-type-arguments'; diff --git a/tests/helpers/testResources.ts b/tests/helpers/testResources.ts index 82c5011f5..831b877df 100644 --- a/tests/helpers/testResources.ts +++ b/tests/helpers/testResources.ts @@ -1,6 +1,6 @@ import path from 'path'; import { globSync } from 'glob'; -import { SAFE_DS_FILE_EXTENSIONS } from '../../src/language/constants/fileExtensions.js'; +import { SAFE_DS_FILE_EXTENSIONS } from '../../src/language/helpers/fileExtensions'; import { group } from 'radash'; const resourcesPath = path.join(__dirname, '..', 'resources'); diff --git a/tests/resources/scoping/references/skip-main.sdstest b/tests/resources/scoping/member accesses/skip-main.sdstest similarity index 99% rename from tests/resources/scoping/references/skip-main.sdstest rename to tests/resources/scoping/member accesses/skip-main.sdstest index 4538a0c61..d48b0881b 100644 --- a/tests/resources/scoping/references/skip-main.sdstest +++ b/tests/resources/scoping/member accesses/skip-main.sdstest @@ -825,18 +825,3 @@ step referencesToStepResults() { stepWithOneResultWithIdenticalMember().result; stepWithTwoResults().result1; } - -// Access to locals from outside ----------------------------------------------- - -step referencesToLambdaLocals() { - val f = (lambdaParameter) { - val lambdaPlaceholder = 1; - yield lambdaYield = 1; - }; - - lambdaPlaceholder; -} - -step referencesToStepLocals() { - placeholderInSameFile; -} 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 new file mode 100644 index 000000000..f669b222b --- /dev/null +++ b/tests/resources/scoping/member accesses/to class members/instance attributes/main.sdstest @@ -0,0 +1,64 @@ +package test.scoping.memberAccesses.toClassMembers.instanceAttributes + +class MyClass { + // $TEST$ target myInstanceAttribute + attr »myInstanceAttribute«: Int + + + // $TEST$ target redeclaredAsInstanceAttribute + attr »redeclaredAsInstanceAttribute«: Int + attr redeclaredAsInstanceAttribute: Int + + // $TEST$ target redeclaredAsStaticAttribute + attr »redeclaredAsStaticAttribute«: Int + static attr redeclaredAsStaticAttribute: Int + + // $TEST$ target redeclaredAsNestedClass + attr »redeclaredAsNestedClass«: Int + class redeclaredAsNestedClass + + // $TEST$ target redeclaredAsNestedEnum + attr »redeclaredAsNestedEnum«: Int + enum redeclaredAsNestedEnum + + // $TEST$ target redeclaredAsInstanceMethod + attr »redeclaredAsInstanceMethod«: Int + fun redeclaredAsInstanceMethod() + + // $TEST$ target redeclaredAsStaticMethod + attr »redeclaredAsStaticMethod«: Int + static fun redeclaredAsStaticMethod() + + + // $TEST$ target declaredPreviouslyAsStaticAttribute + static attr declaredPreviouslyAsStaticAttribute: Int + attr »declaredPreviouslyAsStaticAttribute«: Int + + // $TEST$ target declaredPreviouslyAsNestedClass + class declaredPreviouslyAsNestedClass + attr »declaredPreviouslyAsNestedClass«: Int + + // $TEST$ target declaredPreviouslyAsNestedEnum + class declaredPreviouslyAsNestedEnum + attr »declaredPreviouslyAsNestedEnum«: Int + + // $TEST$ target declaredPreviouslyAsStaticMethod + static fun declaredPreviouslyAsStaticMethod() + attr »declaredPreviouslyAsStaticMethod«: Int +} + +class AnotherClass + +pipeline myPipeline { + // $TEST$ unresolved + MyClass.»myInstanceAttribute«; + + // $TEST$ unresolved + AnotherClass().»myInstanceAttribute«; + + // $TEST$ unresolved + unresolved.»myInstanceAttribute«; + + // $TEST$ unresolved + MyClass.»unresolved«; +} 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 new file mode 100644 index 000000000..6e68f1c42 --- /dev/null +++ b/tests/resources/scoping/member accesses/to class members/instance methods/main.sdstest @@ -0,0 +1,64 @@ +package test.scoping.memberAccesses.toClassMembers.instanceMethods + +class MyClass { + // $TEST$ target myInstanceMethod + fun »myInstanceMethod«() + + + // $TEST$ target redeclaredAsInstanceAttribute + fun »redeclaredAsInstanceAttribute«() + attr redeclaredAsInstanceAttribute: Int + + // $TEST$ target redeclaredAsStaticAttribute + fun »redeclaredAsStaticAttribute«() + static attr redeclaredAsStaticAttribute: Int + + // $TEST$ target redeclaredAsNestedClass + fun »redeclaredAsNestedClass«() + class redeclaredAsNestedClass + + // $TEST$ target redeclaredAsNestedEnum + fun »redeclaredAsNestedEnum«() + enum redeclaredAsNestedEnum + + // $TEST$ target redeclaredAsInstanceMethod + fun »redeclaredAsInstanceMethod«() + fun redeclaredAsInstanceMethod() + + // $TEST$ target redeclaredAsStaticMethod + fun »redeclaredAsStaticMethod«() + static fun redeclaredAsStaticMethod() + + + // $TEST$ target declaredPreviouslyAsStaticAttribute + static attr declaredPreviouslyAsStaticAttribute: Int + fun »declaredPreviouslyAsStaticAttribute«() + + // $TEST$ target declaredPreviouslyAsNestedClass + class declaredPreviouslyAsNestedClass + fun »declaredPreviouslyAsNestedClass«() + + // $TEST$ target declaredPreviouslyAsNestedEnum + class declaredPreviouslyAsNestedEnum + fun »declaredPreviouslyAsNestedEnum«() + + // $TEST$ target declaredPreviouslyAsStaticMethod + static fun declaredPreviouslyAsStaticMethod() + fun »declaredPreviouslyAsStaticMethod«() +} + +class AnotherClass + +pipeline myPipeline { + // $TEST$ unresolved + MyClass.»myInstanceMethod«; + + // $TEST$ unresolved + AnotherClass().»myInstanceMethod«; + + // $TEST$ unresolved + unresolved.»myInstanceMethod«; + + // $TEST$ unresolved + MyClass.»unresolved«; +} 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 new file mode 100644 index 000000000..6c47fc098 --- /dev/null +++ b/tests/resources/scoping/member accesses/to class members/nested classes/main.sdstest @@ -0,0 +1,89 @@ +package test.scoping.memberAccesses.toClassMembers.nestedClasses + +class MyClass { + // $TEST$ target myNestedClass + class »MyNestedClass« + + + // $TEST$ target redeclaredAsInstanceAttribute + class »RedeclaredAsInstanceAttribute« + attr RedeclaredAsInstanceAttribute: Int + + // $TEST$ target redeclaredAsStaticAttribute + class »RedeclaredAsStaticAttribute« + static attr RedeclaredAsStaticAttribute: Int + + // $TEST$ target redeclaredAsNestedClass + class »RedeclaredAsNestedClass« + class RedeclaredAsNestedClass + + // $TEST$ target redeclaredAsNestedEnum + class »RedeclaredAsNestedEnum« + enum RedeclaredAsNestedEnum + + // $TEST$ target redeclaredAsInstanceMethod + class »RedeclaredAsInstanceMethod« + fun RedeclaredAsInstanceMethod() + + // $TEST$ target redeclaredAsStaticMethod + class »RedeclaredAsStaticMethod« + static fun RedeclaredAsStaticMethod() + + + // $TEST$ target declaredPreviouslyAsInstanceAttribute + attr DeclaredPreviouslyAsInstanceAttribute: Int + class »DeclaredPreviouslyAsInstanceAttribute« + + // $TEST$ target declaredPreviouslyAsInstanceMethod + fun DeclaredPreviouslyAsInstanceMethod() + class »DeclaredPreviouslyAsInstanceMethod« +} + +class MyNestedClass +class AnotherClass + +pipeline myPipeline { + // $TEST$ references myNestedClass + MyClass.»MyNestedClass«; + + + // $TEST$ references redeclaredAsInstanceAttribute + MyClass.»RedeclaredAsInstanceAttribute«; + + // $TEST$ references redeclaredAsStaticAttribute + MyClass.»RedeclaredAsStaticAttribute«; + + // $TEST$ references redeclaredAsNestedClass + MyClass.»RedeclaredAsNestedClass«; + + // $TEST$ references redeclaredAsNestedEnum + MyClass.»RedeclaredAsNestedEnum«; + + // $TEST$ references redeclaredAsInstanceMethod + MyClass.»RedeclaredAsInstanceMethod«; + + // $TEST$ references redeclaredAsStaticMethod + MyClass.»RedeclaredAsStaticMethod«; + + // $TEST$ references declaredPreviouslyAsInstanceAttribute + MyClass.»DeclaredPreviouslyAsInstanceAttribute«; + + // $TEST$ references declaredPreviouslyAsInstanceMethod + MyClass.»DeclaredPreviouslyAsInstanceMethod«; + + + // $TEST$ unresolved + MyClass().»MyNestedClass«; + + // $TEST$ unresolved + MyClass.»AnotherClass«; + + // $TEST$ unresolved + AnotherClass.»MyNestedClass«; + + // $TEST$ unresolved + unresolved.»MyNestedClass«; + + // $TEST$ unresolved + MyClass.»unresolved«; +} 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 new file mode 100644 index 000000000..12ea94663 --- /dev/null +++ b/tests/resources/scoping/member accesses/to class members/nested enums/main.sdstest @@ -0,0 +1,90 @@ +package test.scoping.memberAccesses.toClassMembers.nestedEnums + +class MyClass { + // $TEST$ target myNestedEnum + enum »MyNestedEnum« + + + // $TEST$ target redeclaredAsInstanceAttribute + enum »RedeclaredAsInstanceAttribute« + attr RedeclaredAsInstanceAttribute: Int + + // $TEST$ target redeclaredAsStaticAttribute + enum »RedeclaredAsStaticAttribute« + static attr RedeclaredAsStaticAttribute: Int + + // $TEST$ target redeclaredAsNestedClass + enum »RedeclaredAsNestedClass« + class RedeclaredAsNestedClass + + // $TEST$ target redeclaredAsNestedEnum + enum »RedeclaredAsNestedEnum« + enum RedeclaredAsNestedEnum + + // $TEST$ target redeclaredAsInstanceMethod + enum »RedeclaredAsInstanceMethod« + fun RedeclaredAsInstanceMethod() + + // $TEST$ target redeclaredAsStaticMethod + enum »RedeclaredAsStaticMethod« + static fun RedeclaredAsStaticMethod() + + + // $TEST$ target declaredPreviouslyAsInstanceAttribute + attr DeclaredPreviouslyAsInstanceAttribute: Int + enum »DeclaredPreviouslyAsInstanceAttribute« + + // $TEST$ target declaredPreviouslyAsInstanceMethod + fun DeclaredPreviouslyAsInstanceMethod() + enum »DeclaredPreviouslyAsInstanceMethod« +} + +enum MyNestedEnum +class AnotherClass +enum AnotherEnum + +pipeline myPipeline { + // $TEST$ references myNestedEnum + MyClass.»MyNestedEnum«; + + + // $TEST$ references redeclaredAsInstanceAttribute + MyClass.»RedeclaredAsInstanceAttribute«; + + // $TEST$ references redeclaredAsStaticAttribute + MyClass.»RedeclaredAsStaticAttribute«; + + // $TEST$ references redeclaredAsNestedClass + MyClass.»RedeclaredAsNestedClass«; + + // $TEST$ references redeclaredAsNestedEnum + MyClass.»RedeclaredAsNestedEnum«; + + // $TEST$ references redeclaredAsInstanceMethod + MyClass.»RedeclaredAsInstanceMethod«; + + // $TEST$ references redeclaredAsStaticMethod + MyClass.»RedeclaredAsStaticMethod«; + + // $TEST$ references declaredPreviouslyAsInstanceAttribute + MyClass.»DeclaredPreviouslyAsInstanceAttribute«; + + // $TEST$ references declaredPreviouslyAsInstanceMethod + MyClass.»DeclaredPreviouslyAsInstanceMethod«; + + + // $TEST$ unresolved + MyClass().»MyNestedEnum«; + + // $TEST$ unresolved + MyClass.»AnotherEnum«; + + // $TEST$ unresolved + AnotherClass.»MyNestedEnum«; + + // $TEST$ unresolved + unresolved.»MyNestedEnum«; + + // $TEST$ unresolved + MyClass.»unresolved«; +} 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 new file mode 100644 index 000000000..f1fbd272f --- /dev/null +++ b/tests/resources/scoping/member accesses/to class members/static attributes/main.sdstest @@ -0,0 +1,85 @@ +package test.scoping.memberAccesses.toClassMembers.staticAttributes + +class MyClass() { + // $TEST$ target myStaticAttribute + static attr »myStaticAttribute«: Int + + + // $TEST$ target redeclaredAsInstanceAttribute + static attr »redeclaredAsInstanceAttribute«: Int + attr redeclaredAsInstanceAttribute: Int + + // $TEST$ target redeclaredAsStaticAttribute + static attr »redeclaredAsStaticAttribute«: Int + static attr redeclaredAsStaticAttribute: Int + + // $TEST$ target redeclaredAsNestedClass + static attr »redeclaredAsNestedClass«: Int + class redeclaredAsNestedClass + + // $TEST$ target redeclaredAsNestedEnum + static attr »redeclaredAsNestedEnum«: Int + enum redeclaredAsNestedEnum + + // $TEST$ target redeclaredAsInstanceMethod + static attr »redeclaredAsInstanceMethod«: Int + fun redeclaredAsInstanceMethod() + + // $TEST$ target redeclaredAsStaticMethod + static attr »redeclaredAsStaticMethod«: Int + static fun redeclaredAsStaticMethod() + + + // $TEST$ target declaredPreviouslyAsInstanceAttribute + attr declaredPreviouslyAsInstanceAttribute: Int + static attr »declaredPreviouslyAsInstanceAttribute«: Int + + // $TEST$ target declaredPreviouslyAsInstanceMethod + fun declaredPreviouslyAsInstanceMethod() + static attr »declaredPreviouslyAsInstanceMethod«: Int +} + +class AnotherClass + +pipeline myPipeline { + // $TEST$ references myStaticAttribute + MyClass.»myStaticAttribute«; + + + // $TEST$ references redeclaredAsInstanceAttribute + MyClass.»redeclaredAsInstanceAttribute«; + + // $TEST$ references redeclaredAsStaticAttribute + MyClass.»redeclaredAsStaticAttribute«; + + // $TEST$ references redeclaredAsNestedClass + MyClass.»redeclaredAsNestedClass«; + + // $TEST$ references redeclaredAsNestedEnum + MyClass.»redeclaredAsNestedEnum«; + + // $TEST$ references redeclaredAsInstanceMethod + MyClass.»redeclaredAsInstanceMethod«; + + // $TEST$ references redeclaredAsStaticMethod + MyClass.»redeclaredAsStaticMethod«; + + // $TEST$ references declaredPreviouslyAsInstanceAttribute + MyClass.»declaredPreviouslyAsInstanceAttribute«; + + // $TEST$ references declaredPreviouslyAsInstanceMethod + MyClass.»declaredPreviouslyAsInstanceMethod«; + + + // $TEST$ unresolved + MyClass().»myStaticAttribute«; + + // $TEST$ unresolved + AnotherClass.»myStaticAttribute«; + + // $TEST$ unresolved + unresolved.»myStaticAttribute«; + + // $TEST$ unresolved + MyClass.»unresolved«; +} 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 new file mode 100644 index 000000000..b1b461ccd --- /dev/null +++ b/tests/resources/scoping/member accesses/to class members/static methods/main.sdstest @@ -0,0 +1,89 @@ +package test.scoping.memberAccesses.toClassMembers.staticMethods + +class MyClass { + // $TEST$ target myStaticMethod + static fun »myStaticMethod«() + + + // $TEST$ target redeclaredAsInstanceAttribute + static fun »redeclaredAsInstanceAttribute«() + attr redeclaredAsInstanceAttribute: Int + + // $TEST$ target redeclaredAsStaticAttribute + static fun »redeclaredAsStaticAttribute«() + static attr redeclaredAsStaticAttribute: Int + + // $TEST$ target redeclaredAsNestedClass + static fun »redeclaredAsNestedClass«() + class redeclaredAsNestedClass + + // $TEST$ target redeclaredAsNestedEnum + static fun »redeclaredAsNestedEnum«() + enum redeclaredAsNestedEnum + + // $TEST$ target redeclaredAsInstanceMethod + static fun »redeclaredAsInstanceMethod«() + fun redeclaredAsInstanceMethod() + + // $TEST$ target redeclaredAsStaticMethod + static fun »redeclaredAsStaticMethod«() + static fun redeclaredAsStaticMethod() + + + // $TEST$ target declaredPreviouslyAsInstanceAttribute + attr declaredPreviouslyAsInstanceAttribute: Int + static fun »declaredPreviouslyAsInstanceAttribute«() + + // $TEST$ target declaredPreviouslyAsInstanceMethod + fun declaredPreviouslyAsInstanceMethod() + static fun »declaredPreviouslyAsInstanceMethod«() +} + +class AnotherClass +fun anotherFunction() + +pipeline myPipeline { + // $TEST$ references myStaticMethod + MyClass.»myStaticMethod«; + + + // $TEST$ references redeclaredAsInstanceAttribute + MyClass.»redeclaredAsInstanceAttribute«; + + // $TEST$ references redeclaredAsStaticAttribute + MyClass.»redeclaredAsStaticAttribute«; + + // $TEST$ references redeclaredAsNestedClass + MyClass.»redeclaredAsNestedClass«; + + // $TEST$ references redeclaredAsNestedEnum + MyClass.»redeclaredAsNestedEnum«; + + // $TEST$ references redeclaredAsInstanceMethod + MyClass.»redeclaredAsInstanceMethod«; + + // $TEST$ references redeclaredAsStaticMethod + MyClass.»redeclaredAsStaticMethod«; + + // $TEST$ references declaredPreviouslyAsInstanceAttribute + MyClass.»declaredPreviouslyAsInstanceAttribute«; + + // $TEST$ references declaredPreviouslyAsInstanceMethod + MyClass.»declaredPreviouslyAsInstanceMethod«; + + + // $TEST$ unresolved + MyClass().»myStaticMethod«; + + // $TEST$ unresolved + MyClass.»anotherFunction«; + + // $TEST$ unresolved + AnotherClass.»myStaticMethod«; + + // $TEST$ unresolved + unresolved.»myStaticMethod«; + + // $TEST$ unresolved + MyClass.»unresolved«; +} diff --git a/tests/resources/scoping/member accesses/to enum variants/main.sdstest b/tests/resources/scoping/member accesses/to enum variants/main.sdstest new file mode 100644 index 000000000..dbf8c4833 --- /dev/null +++ b/tests/resources/scoping/member accesses/to enum variants/main.sdstest @@ -0,0 +1,33 @@ +package test.scoping.memberAccesses.toEnumVariants + +enum MyEnum { + // $TEST$ target myEnumVariant + »MyEnumVariant« + + // $TEST$ target redeclaredEnumVariant + »RedeclaredEnumVariant« + RedeclaredEnumVariant +} + +enum AnotherEnum + +pipeline myPipeline { + // $TEST$ references myEnumVariant + MyEnum.»MyEnumVariant«; + + // $TEST$ references redeclaredEnumVariant + MyEnum.»RedeclaredEnumVariant«; + + + // $TEST$ unresolved + AnotherEnum().»MyEnumVariant«; + + // $TEST$ unresolved + AnotherEnum.»MyEnumVariant«; + + // $TEST$ unresolved + unresolved.»MyEnumVariant«; + + // $TEST$ unresolved + MyEnum.»unresolved«; +} diff --git a/tests/resources/scoping/references/direct/to annotations/main.sdstest b/tests/resources/scoping/references/to annotations/main.sdstest similarity index 79% rename from tests/resources/scoping/references/direct/to annotations/main.sdstest rename to tests/resources/scoping/references/to annotations/main.sdstest index 2a84b526a..ad95948e2 100644 --- a/tests/resources/scoping/references/direct/to annotations/main.sdstest +++ b/tests/resources/scoping/references/to annotations/main.sdstest @@ -1,4 +1,4 @@ -package tests.scoping.references.direct.toAnnotations +package tests.scoping.references.toAnnotations // $TEST$ target before annotation »Before« diff --git a/tests/resources/scoping/references/direct/to block lambda results/from outside/main.sdstest b/tests/resources/scoping/references/to block lambda results/from outside/main.sdstest similarity index 65% rename from tests/resources/scoping/references/direct/to block lambda results/from outside/main.sdstest rename to tests/resources/scoping/references/to block lambda results/from outside/main.sdstest index bd29bbb5e..ddfe6789c 100644 --- a/tests/resources/scoping/references/direct/to block lambda results/from outside/main.sdstest +++ b/tests/resources/scoping/references/to block lambda results/from outside/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.references.direct.toBlockLambdaResults.fromOutside +package test.scoping.references.toBlockLambdaResults.fromOutside pipeline myPipeline { () { diff --git a/tests/resources/scoping/references/direct/to block lambda results/of containing block lambda/main.sdstest b/tests/resources/scoping/references/to block lambda results/of containing block lambda/main.sdstest similarity index 60% rename from tests/resources/scoping/references/direct/to block lambda results/of containing block lambda/main.sdstest rename to tests/resources/scoping/references/to block lambda results/of containing block lambda/main.sdstest index 04943a836..477856487 100644 --- a/tests/resources/scoping/references/direct/to block lambda results/of containing block lambda/main.sdstest +++ b/tests/resources/scoping/references/to block lambda results/of containing block lambda/main.sdstest @@ -1,4 +1,4 @@ -package tests.scoping.references.direct.toBlockLambdaResults.ofContainingBlockLambda +package tests.scoping.references.toBlockLambdaResults.ofContainingBlockLambda pipeline myPipeline { () { diff --git a/tests/resources/scoping/references/direct/to class members/main.sdstest b/tests/resources/scoping/references/to class members/main.sdstest similarity index 90% rename from tests/resources/scoping/references/direct/to class members/main.sdstest rename to tests/resources/scoping/references/to class members/main.sdstest index 9cc185a1a..93bc34f57 100644 --- a/tests/resources/scoping/references/direct/to class members/main.sdstest +++ b/tests/resources/scoping/references/to class members/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.references.direct.toClassMembers +package test.scoping.references.toClassMembers class MyClass { static attr staticAttribute: Int diff --git a/tests/resources/scoping/references/direct/to enum variants/main.sdstest b/tests/resources/scoping/references/to enum variants/main.sdstest similarity index 66% rename from tests/resources/scoping/references/direct/to enum variants/main.sdstest rename to tests/resources/scoping/references/to enum variants/main.sdstest index ca0a54d2e..5bd55a442 100644 --- a/tests/resources/scoping/references/direct/to enum variants/main.sdstest +++ b/tests/resources/scoping/references/to enum variants/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.references.direct.toEnumVariants +package test.scoping.references.toEnumVariants enum MyEnum { MyEnumVariant diff --git a/tests/resources/scoping/references/direct/to global classes/main.sdstest b/tests/resources/scoping/references/to global classes/main.sdstest similarity index 78% rename from tests/resources/scoping/references/direct/to global classes/main.sdstest rename to tests/resources/scoping/references/to global classes/main.sdstest index 03d62b0a0..ba28ba16c 100644 --- a/tests/resources/scoping/references/direct/to global classes/main.sdstest +++ b/tests/resources/scoping/references/to global classes/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.references.direct.toGlobalClasses +package test.scoping.references.toGlobalClasses // $TEST$ target before class »Before«() diff --git a/tests/resources/scoping/references/direct/to global enums/main.sdstest b/tests/resources/scoping/references/to global enums/main.sdstest similarity index 79% rename from tests/resources/scoping/references/direct/to global enums/main.sdstest rename to tests/resources/scoping/references/to global enums/main.sdstest index c627bd5a8..34160929d 100644 --- a/tests/resources/scoping/references/direct/to global enums/main.sdstest +++ b/tests/resources/scoping/references/to global enums/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.references.direct.toGlobalEnums +package test.scoping.references.toGlobalEnums // $TEST$ target before enum »Before« diff --git a/tests/resources/scoping/references/direct/to global functions/main.sdstest b/tests/resources/scoping/references/to global functions/main.sdstest similarity index 78% rename from tests/resources/scoping/references/direct/to global functions/main.sdstest rename to tests/resources/scoping/references/to global functions/main.sdstest index 412f0f6d1..06a825ded 100644 --- a/tests/resources/scoping/references/direct/to global functions/main.sdstest +++ b/tests/resources/scoping/references/to global functions/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.references.direct.toGlobalFunctions +package test.scoping.references.toGlobalFunctions // $TEST$ target before fun »before«() diff --git a/tests/resources/scoping/references/direct/to parameters/from outside/main.sdstest b/tests/resources/scoping/references/to parameters/from outside/main.sdstest similarity index 93% rename from tests/resources/scoping/references/direct/to parameters/from outside/main.sdstest rename to tests/resources/scoping/references/to parameters/from outside/main.sdstest index e925c55e2..1986e55c7 100644 --- a/tests/resources/scoping/references/direct/to parameters/from outside/main.sdstest +++ b/tests/resources/scoping/references/to parameters/from outside/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.references.direct.toParameters.fromOutside +package test.scoping.references.toParameters.fromOutside annotation MyAnnotation(myAnnotationParameter: String) diff --git a/tests/resources/scoping/references/direct/to parameters/of containing block lambda/main.sdstest b/tests/resources/scoping/references/to parameters/of containing block lambda/main.sdstest similarity index 97% rename from tests/resources/scoping/references/direct/to parameters/of containing block lambda/main.sdstest rename to tests/resources/scoping/references/to parameters/of containing block lambda/main.sdstest index b3e01b85b..14248eaf0 100644 --- a/tests/resources/scoping/references/direct/to parameters/of containing block lambda/main.sdstest +++ b/tests/resources/scoping/references/to parameters/of containing block lambda/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.references.direct.toParameters.ofContainingBlockLambda +package test.scoping.references.toParameters.ofContainingBlockLambda segment mySegment(myShadowedSegmentParameter: Int) { val myShadowedPlaceholder = 0; diff --git a/tests/resources/scoping/references/direct/to parameters/of containing expression lambda/main.sdstest b/tests/resources/scoping/references/to parameters/of containing expression lambda/main.sdstest similarity index 96% rename from tests/resources/scoping/references/direct/to parameters/of containing expression lambda/main.sdstest rename to tests/resources/scoping/references/to parameters/of containing expression lambda/main.sdstest index d5ac1180f..0bc466ff4 100644 --- a/tests/resources/scoping/references/direct/to parameters/of containing expression lambda/main.sdstest +++ b/tests/resources/scoping/references/to parameters/of containing expression lambda/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.references.direct.toParameters.ofContainingExpressionLambda +package test.scoping.references.toParameters.ofContainingExpressionLambda segment mySegment(myShadowedSegmentParameter: Int) { val myShadowedPlaceholder = 0; diff --git a/tests/resources/scoping/references/direct/to parameters/of containing segment/main.sdstest b/tests/resources/scoping/references/to parameters/of containing segment/main.sdstest similarity index 93% rename from tests/resources/scoping/references/direct/to parameters/of containing segment/main.sdstest rename to tests/resources/scoping/references/to parameters/of containing segment/main.sdstest index 71039c787..b557a3422 100644 --- a/tests/resources/scoping/references/direct/to parameters/of containing segment/main.sdstest +++ b/tests/resources/scoping/references/to parameters/of containing segment/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.references.direct.toParameters.ofContainingExpressionLambda +package test.scoping.references.toParameters.ofContainingExpressionLambda segment mySegment( // $TEST$ target parameter diff --git a/tests/resources/scoping/references/direct/to pipelines/main.sdstest b/tests/resources/scoping/references/to pipelines/main.sdstest similarity index 80% rename from tests/resources/scoping/references/direct/to pipelines/main.sdstest rename to tests/resources/scoping/references/to pipelines/main.sdstest index 3c900d1d1..d07dfa4e1 100644 --- a/tests/resources/scoping/references/direct/to pipelines/main.sdstest +++ b/tests/resources/scoping/references/to pipelines/main.sdstest @@ -1,4 +1,4 @@ -package tests.scoping.references.direct.toPipelines +package tests.scoping.references.toPipelines // $TEST$ target before pipeline »before« {} diff --git a/tests/resources/scoping/references/direct/to placeholders/from outside/main.sdstest b/tests/resources/scoping/references/to placeholders/from outside/main.sdstest similarity index 85% rename from tests/resources/scoping/references/direct/to placeholders/from outside/main.sdstest rename to tests/resources/scoping/references/to placeholders/from outside/main.sdstest index 334bf8704..ce9c76f8c 100644 --- a/tests/resources/scoping/references/direct/to placeholders/from outside/main.sdstest +++ b/tests/resources/scoping/references/to placeholders/from outside/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.references.direct.toPlaceholders.fromOutside +package test.scoping.references.toPlaceholders.fromOutside pipeline myPipeline1 { val pipelinePlaceholder = 1; diff --git a/tests/resources/scoping/references/direct/to placeholders/of containing block lambda/main.sdstest b/tests/resources/scoping/references/to placeholders/of containing block lambda/main.sdstest similarity index 98% rename from tests/resources/scoping/references/direct/to placeholders/of containing block lambda/main.sdstest rename to tests/resources/scoping/references/to placeholders/of containing block lambda/main.sdstest index 53311ab8f..accbb0f1e 100644 --- a/tests/resources/scoping/references/direct/to placeholders/of containing block lambda/main.sdstest +++ b/tests/resources/scoping/references/to placeholders/of containing block lambda/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.references.direct.toPlaceholders.ofContainingBlockLambda +package test.scoping.references.toPlaceholders.ofContainingBlockLambda segment mySegment(mySegmentParameter: Int) { val mySegmentPlaceholder = 0; diff --git a/tests/resources/scoping/references/direct/to placeholders/of containing pipeline/main.sdstest b/tests/resources/scoping/references/to placeholders/of containing pipeline/main.sdstest similarity index 93% rename from tests/resources/scoping/references/direct/to placeholders/of containing pipeline/main.sdstest rename to tests/resources/scoping/references/to placeholders/of containing pipeline/main.sdstest index 96899d56b..2dfaaf2cb 100644 --- a/tests/resources/scoping/references/direct/to placeholders/of containing pipeline/main.sdstest +++ b/tests/resources/scoping/references/to placeholders/of containing pipeline/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.references.direct.toPlaceholders.ofContainingPipeline +package test.scoping.references.toPlaceholders.ofContainingPipeline pipeline myPipeline { // $TEST$ target before diff --git a/tests/resources/scoping/references/direct/to placeholders/of containing segment/main.sdstest b/tests/resources/scoping/references/to placeholders/of containing segment/main.sdstest similarity index 93% rename from tests/resources/scoping/references/direct/to placeholders/of containing segment/main.sdstest rename to tests/resources/scoping/references/to placeholders/of containing segment/main.sdstest index 82e1ce365..ef7ca94db 100644 --- a/tests/resources/scoping/references/direct/to placeholders/of containing segment/main.sdstest +++ b/tests/resources/scoping/references/to placeholders/of containing segment/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.references.direct.toPlaceholders.ofContainingSegment +package test.scoping.references.toPlaceholders.ofContainingSegment segment mySegment() { // $TEST$ target before diff --git a/tests/resources/scoping/references/direct/to redeclared module member/main.sdstest b/tests/resources/scoping/references/to redeclared module member/main.sdstest similarity index 77% rename from tests/resources/scoping/references/direct/to redeclared module member/main.sdstest rename to tests/resources/scoping/references/to redeclared module member/main.sdstest index e9c37ae45..da491d143 100644 --- a/tests/resources/scoping/references/direct/to redeclared module member/main.sdstest +++ b/tests/resources/scoping/references/to redeclared module member/main.sdstest @@ -1,4 +1,4 @@ -package tests.scoping.references.direct.toRedeclaredModuleMember +package tests.scoping.references.toRedeclaredModuleMember // $TEST$ target before class »Before« diff --git a/tests/resources/scoping/references/direct/to results/from outside/main.sdstest b/tests/resources/scoping/references/to results/from outside/main.sdstest similarity index 84% rename from tests/resources/scoping/references/direct/to results/from outside/main.sdstest rename to tests/resources/scoping/references/to results/from outside/main.sdstest index 55c1927f8..f105dcb1c 100644 --- a/tests/resources/scoping/references/direct/to results/from outside/main.sdstest +++ b/tests/resources/scoping/references/to results/from outside/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.references.direct.toResults.fromOutside +package test.scoping.references.toResults.fromOutside fun myFunction() -> (myFunctionResult: String) diff --git a/tests/resources/scoping/references/direct/to results/of containing segment/main.sdstest b/tests/resources/scoping/references/to results/of containing segment/main.sdstest similarity index 54% rename from tests/resources/scoping/references/direct/to results/of containing segment/main.sdstest rename to tests/resources/scoping/references/to results/of containing segment/main.sdstest index 14fdb2bd9..7a51146af 100644 --- a/tests/resources/scoping/references/direct/to results/of containing segment/main.sdstest +++ b/tests/resources/scoping/references/to results/of containing segment/main.sdstest @@ -1,4 +1,4 @@ -package tests.scoping.references.direct.toResults.ofContainingSegment +package tests.scoping.references.toResults.ofContainingSegment segment mySegment() -> myResult: Int { // $TEST$ unresolved diff --git a/tests/resources/scoping/references/direct/to schemas/main.sdstest b/tests/resources/scoping/references/to schemas/main.sdstest similarity index 80% rename from tests/resources/scoping/references/direct/to schemas/main.sdstest rename to tests/resources/scoping/references/to schemas/main.sdstest index 440b03af1..27334104f 100644 --- a/tests/resources/scoping/references/direct/to schemas/main.sdstest +++ b/tests/resources/scoping/references/to schemas/main.sdstest @@ -1,4 +1,4 @@ -package tests.scoping.references.direct.toSchemas +package tests.scoping.references.toSchemas // $TEST$ target before schema »Before« {} diff --git a/tests/resources/scoping/references/direct/to segments/main.sdstest b/tests/resources/scoping/references/to segments/main.sdstest similarity index 93% rename from tests/resources/scoping/references/direct/to segments/main.sdstest rename to tests/resources/scoping/references/to segments/main.sdstest index f27c97bfc..f0157a49a 100644 --- a/tests/resources/scoping/references/direct/to segments/main.sdstest +++ b/tests/resources/scoping/references/to segments/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.references.direct.toSegments +package test.scoping.references.toSegments // $TEST$ target privateBefore private segment »privateBefore«() {} diff --git a/tests/resources/scoping/references/direct/to type parameters/main.sdstest b/tests/resources/scoping/references/to type parameters/main.sdstest similarity index 59% rename from tests/resources/scoping/references/direct/to type parameters/main.sdstest rename to tests/resources/scoping/references/to type parameters/main.sdstest index 97b7997b2..f1f65cb5c 100644 --- a/tests/resources/scoping/references/direct/to type parameters/main.sdstest +++ b/tests/resources/scoping/references/to type parameters/main.sdstest @@ -1,4 +1,4 @@ -package test.scoping.references.direct.toTypeParameters +package test.scoping.references.toTypeParameters class MyClass() diff --git a/tests/resources/scoping/references/direct/unresolved/main.sdstest b/tests/resources/scoping/references/unresolved/main.sdstest similarity index 57% rename from tests/resources/scoping/references/direct/unresolved/main.sdstest rename to tests/resources/scoping/references/unresolved/main.sdstest index 14c213971..6bb2abd36 100644 --- a/tests/resources/scoping/references/direct/unresolved/main.sdstest +++ b/tests/resources/scoping/references/unresolved/main.sdstest @@ -1,4 +1,4 @@ -package tests.scoping.references.direct.unresolved +package tests.scoping.references.unresolved segment mySegment() { // $TEST$ unresolved