diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 623bdbc22..5ac36e8eb 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -17,16 +17,18 @@ updates: prefix: 'build' include: scope groups: - dev-patches: + development: applies-to: version-updates dependency-type: development update-types: - patch - prod-patches: + - minor + production: applies-to: version-updates dependency-type: production update-types: - patch + - minor - package-ecosystem: pip directory: '/docs' diff --git a/package-lock.json b/package-lock.json index bb509ee29..b43b2aff6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7597,9 +7597,9 @@ "license": "MIT" }, "node_modules/langium": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/langium/-/langium-3.0.0.tgz", - "integrity": "sha512-+Ez9EoiByeoTu/2BXmEaZ06iPNXM6thWJp02KfBO/raSMyCJ4jw7AkWWa+zBCTm0+Tw1Fj9FOxdqSskyN5nAwg==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/langium/-/langium-3.3.0.tgz", + "integrity": "sha512-y1n1MxeHtXvE0Ksi/HjLCvesHm3/Vr0pyyuA1fn+vmGSYR81NkxnC3bU4kd2o0CrZaz8xekz9rhm+lGfRgNFzw==", "dependencies": { "chevrotain": "~11.0.3", "chevrotain-allstar": "~0.3.0", @@ -7612,17 +7612,18 @@ } }, "node_modules/langium-cli": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/langium-cli/-/langium-cli-3.0.3.tgz", - "integrity": "sha512-g6PdhEq5IiYWK/oiySILglPvFdK6ofQdzC+U7PJmFH++bDKu0DGdxjWzDauUN5WUDyVQETWKgtYDmmbcxPzN0w==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/langium-cli/-/langium-cli-3.3.0.tgz", + "integrity": "sha512-QWvlOYdLbso8/lv6Ma+SBtvMN9k70JrplLx6VSIcV7gJNDTXeS+tjwC/f6T0aco1fg8uLL8GiAcaMovd1FnneA==", "dev": true, + "license": "MIT", "dependencies": { "chalk": "~5.3.0", "commander": "~11.0.0", "fs-extra": "~11.1.1", "jsonschema": "~1.4.1", - "langium": "~3.0.0", - "langium-railroad": "~3.0.0", + "langium": "~3.3.0", + "langium-railroad": "~3.3.0", "lodash": "~4.17.21" }, "bin": { @@ -7668,12 +7669,13 @@ } }, "node_modules/langium-railroad": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/langium-railroad/-/langium-railroad-3.0.0.tgz", - "integrity": "sha512-GQOnQBGl5gJqzgK/4bKvJO5QhJGNnprpYH6Fghbl4FviVLHwP6yzyqiouDelLSoCadChCr2JqKaBp5HXv7CgWw==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/langium-railroad/-/langium-railroad-3.3.0.tgz", + "integrity": "sha512-x56CU0KnLoqYLkHEPDJjFoekFoCVbbZbmHduldiXjKD8owt6t5aqgWfg31OeMeR+7XgONZTtmsO76yl6GvEkzQ==", "dev": true, + "license": "MIT", "dependencies": { - "langium": "~3.0.0", + "langium": "~3.3.0", "railroad-diagrams": "~1.0.0" } }, @@ -11758,7 +11760,8 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/railroad-diagrams/-/railroad-diagrams-1.0.0.tgz", "integrity": "sha512-cz93DjNeLY0idrCNOH6PviZGRN9GJhsdm9hpn1YCS879fj4W+x5IFJhhkRZcwVgMmFF7R82UA/7Oh+R8lLZg6A==", - "dev": true + "dev": true, + "license": "CC0-1.0" }, "node_modules/rc": { "version": "1.2.8", @@ -14970,7 +14973,7 @@ "chalk": "^5.4.1", "commander": "^13.0.0", "glob": "^11.0.0", - "langium": "^3.0.0", + "langium": "^3.3.0", "true-myth": "^8.2.0" }, "bin": { @@ -15083,7 +15086,7 @@ "dependencies": { "chevrotain": "^11.0.3", "glob": "^11.0.0", - "langium": "^3.0.0", + "langium": "^3.3.0", "semver": "^7.6.3", "source-map-js": "^1.2.0", "tree-kill": "^1.2.2", @@ -15094,7 +15097,7 @@ "devDependencies": { "@types/node": "^18.19.62", "@types/ws": "^8.5.13", - "langium-cli": "^3.0.3", + "langium-cli": "^3.3.0", "true-myth": "^8.2.0" }, "engines": { diff --git a/packages/safe-ds-cli/package.json b/packages/safe-ds-cli/package.json index a2d87d8de..43ff5af3f 100644 --- a/packages/safe-ds-cli/package.json +++ b/packages/safe-ds-cli/package.json @@ -44,7 +44,7 @@ "chalk": "^5.4.1", "commander": "^13.0.0", "glob": "^11.0.0", - "langium": "^3.0.0", + "langium": "^3.3.0", "true-myth": "^8.2.0" }, "devDependencies": { diff --git a/packages/safe-ds-lang/package.json b/packages/safe-ds-lang/package.json index ac936978b..665129f4e 100644 --- a/packages/safe-ds-lang/package.json +++ b/packages/safe-ds-lang/package.json @@ -45,7 +45,7 @@ "dependencies": { "chevrotain": "^11.0.3", "glob": "^11.0.0", - "langium": "^3.0.0", + "langium": "^3.3.0", "semver": "^7.6.3", "source-map-js": "^1.2.0", "tree-kill": "^1.2.2", @@ -56,7 +56,7 @@ "devDependencies": { "@types/node": "^18.19.62", "@types/ws": "^8.5.13", - "langium-cli": "^3.0.3", + "langium-cli": "^3.3.0", "true-myth": "^8.2.0" }, "engines": { diff --git a/packages/safe-ds-lang/src/language/lsp/safe-ds-completion-provider.ts b/packages/safe-ds-lang/src/language/lsp/safe-ds-completion-provider.ts index 2172f07aa..8ba3754a8 100644 --- a/packages/safe-ds-lang/src/language/lsp/safe-ds-completion-provider.ts +++ b/packages/safe-ds-lang/src/language/lsp/safe-ds-completion-provider.ts @@ -23,9 +23,9 @@ import { classTypeParameterIsUsedInCorrectPosition } from '../validation/other/d export class SafeDsCompletionProvider extends DefaultCompletionProvider { private readonly builtinAnnotations: SafeDsAnnotations; - private readonly documentationProvider: SafeDsDocumentationProvider; + protected override readonly documentationProvider: SafeDsDocumentationProvider; - readonly completionOptions = { + override readonly completionOptions = { triggerCharacters: ['.', '@'], }; diff --git a/packages/safe-ds-lang/src/language/lsp/safe-ds-formatter.ts b/packages/safe-ds-lang/src/language/lsp/safe-ds-formatter.ts index 601206859..cb257aa28 100644 --- a/packages/safe-ds-lang/src/language/lsp/safe-ds-formatter.ts +++ b/packages/safe-ds-lang/src/language/lsp/safe-ds-formatter.ts @@ -1,5 +1,5 @@ import { AstNode, CstNode, CstUtils, isAstNode } from 'langium'; -import { last } from '../../helpers/collections.js'; +import { isEmpty } from '../../helpers/collections.js'; import * as ast from '../generated/ast.js'; import { getAnnotationCalls, getLiterals, getTypeArguments } from '../helpers/nodeProperties.js'; import { AbstractFormatter, Formatting, FormattingAction, FormattingActionOptions, NodeFormatter } from 'langium/lsp'; @@ -27,158 +27,158 @@ export class SafeDsFormatter extends AbstractFormatter { // Module // ----------------------------------------------------------------------------- if (ast.isSdsModule(node)) { - this.formatSdsModule(node); + this.formatModule(node); } else if (ast.isSdsImport(node)) { - this.formatSdsImport(node); + this.formatImport(node); } else if (ast.isSdsImportedDeclarationList(node)) { - this.formatSdsImportedDeclarationList(node); + this.formatImportedDeclarationList(node); } else if (ast.isSdsImportedDeclaration(node)) { - this.formatSdsImportedDeclaration(node); + this.formatImportedDeclaration(node); } else if (ast.isSdsImportedDeclarationAlias(node)) { - this.formatSdsImportedDeclarationAlias(node); + this.formatImportedDeclarationAlias(node); } // ----------------------------------------------------------------------------- // Declarations // ----------------------------------------------------------------------------- else if (ast.isSdsAnnotation(node)) { - this.formatSdsAnnotation(node); + this.formatAnnotation(node); } else if (ast.isSdsAttribute(node)) { - this.formatSdsAttribute(node); + this.formatAttribute(node); } else if (ast.isSdsClass(node)) { - this.formatSdsClass(node); + this.formatClass(node); } else if (ast.isSdsParentTypeList(node)) { - this.formatSdsParentTypeList(node); + this.formatParentTypeList(node); } else if (ast.isSdsClassBody(node)) { - this.formatSdsClassBody(node); + this.formatClassBody(node); } else if (ast.isSdsEnum(node)) { - this.formatSdsEnum(node); + this.formatEnum(node); } else if (ast.isSdsEnumBody(node)) { - this.formatSdsEnumBody(node); + this.formatEnumBody(node); } else if (ast.isSdsEnumVariant(node)) { - this.formatSdsEnumVariant(node); + this.formatEnumVariant(node); } else if (ast.isSdsFunction(node)) { - this.formatSdsFunction(node); + this.formatFunction(node); } else if (ast.isSdsPipeline(node)) { - this.formatSdsPipeline(node); + this.formatPipeline(node); } else if (ast.isSdsSegment(node)) { - this.formatSdsSegment(node); + this.formatSegment(node); } // ----------------------------------------------------------------------------- // Annotation calls // ----------------------------------------------------------------------------- else if (ast.isSdsAnnotationCallList(node)) { - this.formatSdsAnnotationCallList(node); + this.formatAnnotationCallList(node); } else if (ast.isSdsAnnotationCall(node)) { - this.formatSdsAnnotationCall(node); + this.formatAnnotationCall(node); } // ----------------------------------------------------------------------------- // Constraints // ----------------------------------------------------------------------------- else if (ast.isSdsConstraintList(node)) { - this.formatSdsConstraintList(node); + this.formatConstraintList(node); } else if (ast.isSdsParameterBound(node)) { - this.formatSdsParameterBound(node); + this.formatParameterBound(node); } // ----------------------------------------------------------------------------- - // Callables, parameters, and results + // Parameters, and results // ----------------------------------------------------------------------------- else if (ast.isSdsParameterList(node)) { - this.formatSdsParameterList(node); + this.formatParameterList(node); } else if (ast.isSdsParameter(node)) { - this.formatSdsParameter(node); + this.formatParameter(node); } else if (ast.isSdsResultList(node)) { - this.formatSdsResultList(node); + this.formatResultList(node); } else if (ast.isSdsResult(node)) { - this.formatSdsResult(node); + this.formatResult(node); } // ----------------------------------------------------------------------------- // Statements // ----------------------------------------------------------------------------- else if (ast.isSdsBlock(node)) { - this.formatSdsBlock(node); + this.formatBlock(node); } else if (ast.isSdsAssignment(node)) { - this.formatSdsAssignment(node); + this.formatAssignment(node); } else if (ast.isSdsAssigneeList(node)) { - this.formatSdsAssigneeList(node); + this.formatAssigneeList(node); } else if (ast.isSdsPlaceholder(node)) { - this.formatSdsPlaceholder(node); + this.formatPlaceholder(node); } else if (ast.isSdsYield(node)) { - this.formatSdsYield(node); + this.formatYield(node); } else if (ast.isSdsExpressionStatement(node)) { - this.formatSdsExpressionStatement(node); + this.formatExpressionStatement(node); } else if (ast.isSdsOutputStatement(node)) { - this.formatSdsOutputStatement(node); + this.formatOutputStatement(node); } // ----------------------------------------------------------------------------- // Expressions // ----------------------------------------------------------------------------- else if (ast.isSdsBlockLambda(node)) { - this.formatSdsBlockLambda(node); + this.formatBlockLambda(node); } else if (ast.isSdsBlockLambdaResult(node)) { - this.formatSdsBlockLambdaResult(node); + this.formatBlockLambdaResult(node); } else if (ast.isSdsExpressionLambda(node)) { - this.formatSdsExpressionLambda(node); + this.formatExpressionLambda(node); } else if (ast.isSdsInfixOperation(node)) { - this.formatSdsInfixOperation(node); + this.formatInfixOperation(node); } else if (ast.isSdsPrefixOperation(node)) { - this.formatSdsPrefixOperation(node); + this.formatPrefixOperation(node); } else if (ast.isSdsCall(node)) { - this.formatSdsCall(node); + this.formatCall(node); } else if (ast.isSdsArgumentList(node)) { - this.formatSdsArgumentList(node); + this.formatArgumentList(node); } else if (ast.isSdsArgument(node)) { - this.formatSdsArgument(node); + this.formatArgument(node); } else if (ast.isSdsIndexedAccess(node)) { - this.formatSdsIndexedAccess(node); + this.formatIndexedAccess(node); } else if (ast.isSdsMemberAccess(node)) { - this.formatSdsMemberAccess(node); + this.formatMemberAccess(node); } else if (ast.isSdsList(node)) { - this.formatSdsList(node); + this.formatList(node); } else if (ast.isSdsMap(node)) { - this.formatSdsMap(node); + this.formatMap(node); } else if (ast.isSdsMapEntry(node)) { - this.formatSdsMapEntry(node); + this.formatMapEntry(node); } else if (ast.isSdsParenthesizedExpression(node)) { - this.formatSdsParenthesizedExpression(node); + this.formatParenthesizedExpression(node); } else if (ast.isSdsTemplateStringStart(node)) { - this.formatSdsTemplateStringStart(node); + this.formatTemplateStringStart(node); } else if (ast.isSdsTemplateStringInner(node)) { - this.formatSdsTemplateStringInner(node); + this.formatTemplateStringInner(node); } else if (ast.isSdsTemplateStringEnd(node)) { - this.formatSdsTemplateStringEnd(node); + this.formatTemplateStringEnd(node); } else if (ast.isSdsTypeCast(node)) { - this.formatSdsTypeCast(node); + this.formatTypeCast(node); } // ----------------------------------------------------------------------------- // Types // ----------------------------------------------------------------------------- else if (ast.isSdsMemberType(node)) { - this.formatSdsMemberType(node); + this.formatMemberType(node); } else if (ast.isSdsCallableType(node)) { - this.formatSdsCallableType(node); + this.formatCallableType(node); } else if (ast.isSdsLiteralType(node)) { - this.formatSdsLiteralType(node); + this.formatLiteralType(node); } else if (ast.isSdsLiteralList(node)) { - this.formatSdsLiteralList(node); + this.formatLiteralList(node); } else if (ast.isSdsNamedType(node)) { - this.formatSdsNamedType(node); + this.formatNamedType(node); } else if (ast.isSdsUnionType(node)) { - this.formatSdsUnionType(node); + this.formatUnionType(node); } else if (ast.isSdsTypeParameterList(node)) { - this.formatSdsTypeParameterList(node); + this.formatTypeParameterList(node); } else if (ast.isSdsTypeParameter(node)) { - this.formatSdsTypeParameter(node); + this.formatTypeParameter(node); } else if (ast.isSdsTypeArgumentList(node)) { - this.formatSdsTypeArgumentList(node); + this.formatTypeArgumentList(node); } else if (ast.isSdsTypeArgument(node)) { - this.formatSdsTypeArgument(node); + this.formatTypeArgument(node); } } @@ -186,7 +186,7 @@ export class SafeDsFormatter extends AbstractFormatter { // Module // ----------------------------------------------------------------------------- - private formatSdsModule(node: ast.SdsModule): void { + private formatModule(node: ast.SdsModule): void { const formatter = this.getNodeFormatter(node); const annotations = getAnnotationCalls(node); const name = node.name; @@ -267,7 +267,7 @@ export class SafeDsFormatter extends AbstractFormatter { }); } - private formatSdsImport(node: ast.SdsImport): void { + private formatImport(node: ast.SdsImport): void { const formatter = this.getNodeFormatter(node); formatter.keyword('from').append(oneSpace()); @@ -275,19 +275,19 @@ export class SafeDsFormatter extends AbstractFormatter { formatter.keyword('import').surround(oneSpace()); } - private formatSdsImportedDeclarationList(node: ast.SdsImportedDeclarationList): void { + private formatImportedDeclarationList(node: ast.SdsImportedDeclarationList): void { const formatter = this.getNodeFormatter(node); formatter.keywords(',').prepend(noSpace()).append(oneSpace()); } - private formatSdsImportedDeclaration(node: ast.SdsImportedDeclaration): void { + private formatImportedDeclaration(node: ast.SdsImportedDeclaration): void { const formatter = this.getNodeFormatter(node); formatter.property('alias').prepend(oneSpace()); } - private formatSdsImportedDeclarationAlias(node: ast.SdsImportedDeclarationAlias): void { + private formatImportedDeclarationAlias(node: ast.SdsImportedDeclarationAlias): void { const formatter = this.getNodeFormatter(node); formatter.keyword('as').append(oneSpace()); @@ -297,7 +297,7 @@ export class SafeDsFormatter extends AbstractFormatter { // Declarations // ----------------------------------------------------------------------------- - private formatSdsAnnotation(node: ast.SdsAnnotation): void { + private formatAnnotation(node: ast.SdsAnnotation): void { const formatter = this.getNodeFormatter(node); this.formatVisibilityAndKeyword(formatter, node, 'annotation'); @@ -306,7 +306,7 @@ export class SafeDsFormatter extends AbstractFormatter { formatter.property('constraintList').prepend(oneSpace()); } - private formatSdsAttribute(node: ast.SdsAttribute): void { + private formatAttribute(node: ast.SdsAttribute): void { const formatter = this.getNodeFormatter(node); if (getAnnotationCalls(node).length > 0) { @@ -322,7 +322,7 @@ export class SafeDsFormatter extends AbstractFormatter { formatter.keyword(':').prepend(noSpace()).append(oneSpace()); } - private formatSdsClass(node: ast.SdsClass): void { + private formatClass(node: ast.SdsClass): void { const formatter = this.getNodeFormatter(node); this.formatVisibilityAndKeyword(formatter, node, 'class'); @@ -339,14 +339,14 @@ export class SafeDsFormatter extends AbstractFormatter { } } - formatSdsParentTypeList(node: ast.SdsParentTypeList): void { + formatParentTypeList(node: ast.SdsParentTypeList): void { const formatter = this.getNodeFormatter(node); formatter.keyword('sub').append(oneSpace()); formatter.keywords(',').prepend(noSpace()).append(oneSpace()); } - private formatSdsClassBody(node: ast.SdsClassBody): void { + private formatClassBody(node: ast.SdsClassBody): void { const formatter = this.getNodeFormatter(node); const members = node.members ?? []; @@ -365,7 +365,7 @@ export class SafeDsFormatter extends AbstractFormatter { } } - private formatSdsEnum(node: ast.SdsEnum): void { + private formatEnum(node: ast.SdsEnum): void { const formatter = this.getNodeFormatter(node); this.formatVisibilityAndKeyword(formatter, node, 'enum'); @@ -373,7 +373,7 @@ export class SafeDsFormatter extends AbstractFormatter { formatter.property('body').prepend(oneSpace()); } - private formatSdsEnumBody(node: ast.SdsEnumBody): void { + private formatEnumBody(node: ast.SdsEnumBody): void { const formatter = this.getNodeFormatter(node); const variants = node.variants ?? []; @@ -392,7 +392,7 @@ export class SafeDsFormatter extends AbstractFormatter { } } - private formatSdsEnumVariant(node: ast.SdsEnumVariant): void { + private formatEnumVariant(node: ast.SdsEnumVariant): void { const formatter = this.getNodeFormatter(node); const annotationCalls = getAnnotationCalls(node); @@ -407,7 +407,7 @@ export class SafeDsFormatter extends AbstractFormatter { formatter.property('constraintList').prepend(oneSpace()); } - formatSdsFunction(node: ast.SdsFunction): void { + formatFunction(node: ast.SdsFunction): void { const formatter = this.getNodeFormatter(node); if (node.isStatic) { @@ -426,7 +426,7 @@ export class SafeDsFormatter extends AbstractFormatter { formatter.property('constraintList').prepend(oneSpace()); } - private formatSdsPipeline(node: ast.SdsPipeline): void { + private formatPipeline(node: ast.SdsPipeline): void { const formatter = this.getNodeFormatter(node); this.formatVisibilityAndKeyword(formatter, node, 'pipeline'); @@ -434,7 +434,7 @@ export class SafeDsFormatter extends AbstractFormatter { formatter.node(node.body).prepend(oneSpace()); } - private formatSdsSegment(node: ast.SdsSegment): void { + private formatSegment(node: ast.SdsSegment): void { const formatter = this.getNodeFormatter(node); this.formatVisibilityAndKeyword(formatter, node, 'segment'); @@ -468,14 +468,14 @@ export class SafeDsFormatter extends AbstractFormatter { // Annotation calls // ----------------------------------------------------------------------------- - private formatSdsAnnotationCallList(node: ast.SdsAnnotationCallList): void { + private formatAnnotationCallList(node: ast.SdsAnnotationCallList): void { const formatter = this.getNodeFormatter(node); const annotationCalls = node.annotationCalls ?? []; formatter.nodes(...annotationCalls.slice(1)).prepend(newLine()); } - private formatSdsAnnotationCall(node: ast.SdsAnnotationCall): void { + private formatAnnotationCall(node: ast.SdsAnnotationCall): void { const formatter = this.getNodeFormatter(node); formatter.keyword('@').append(noSpace()); @@ -486,7 +486,7 @@ export class SafeDsFormatter extends AbstractFormatter { // Constraints // ----------------------------------------------------------------------------- - private formatSdsConstraintList(node: ast.SdsConstraintList) { + private formatConstraintList(node: ast.SdsConstraintList) { const formatter = this.getNodeFormatter(node); formatter.keyword('where').append(oneSpace()); @@ -506,7 +506,7 @@ export class SafeDsFormatter extends AbstractFormatter { } } - private formatSdsParameterBound(node: ast.SdsParameterBound) { + private formatParameterBound(node: ast.SdsParameterBound) { const formatter = this.getNodeFormatter(node); formatter.property('operator').surround(oneSpace()); @@ -517,7 +517,7 @@ export class SafeDsFormatter extends AbstractFormatter { // Callables, parameters, and results // ----------------------------------------------------------------------------- - private formatSdsParameterList(node: ast.SdsParameterList): void { + private formatParameterList(node: ast.SdsParameterList): void { const formatter = this.getNodeFormatter(node); const openingParenthesis = formatter.keyword('('); @@ -540,21 +540,26 @@ export class SafeDsFormatter extends AbstractFormatter { } } - private formatSdsParameter(node: ast.SdsParameter): void { + private formatParameter(node: ast.SdsParameter): void { const formatter = this.getNodeFormatter(node); - const lastAnnotationCall = last(getAnnotationCalls(node)); - if (lastAnnotationCall) { - formatter.node(lastAnnotationCall).append(newLine()); + const annotationCalls = getAnnotationCalls(node); + formatter.nodes(...annotationCalls.slice(1)).prepend(newLine()); + + if (!isEmpty(annotationCalls)) { + if (node.isConstant) { + formatter.keyword('const').prepend(newLine()); + } else { + formatter.property('name').prepend(newLine()); + } } formatter.keyword('const').append(oneSpace()); - formatter.keyword('vararg').append(oneSpace()); formatter.keyword(':').prepend(noSpace()).append(oneSpace()); formatter.keyword('=').surround(oneSpace()); } - private formatSdsResultList(node: ast.SdsResultList): void { + private formatResultList(node: ast.SdsResultList): void { const formatter = this.getNodeFormatter(node); formatter.keyword('->').surround(oneSpace()); @@ -579,9 +584,11 @@ export class SafeDsFormatter extends AbstractFormatter { } } - private formatSdsResult(node: ast.SdsResult): void { + private formatResult(node: ast.SdsResult): void { const formatter = this.getNodeFormatter(node); + formatter.nodes(...getAnnotationCalls(node).slice(1)).prepend(newLine()); + if (getAnnotationCalls(node).length > 0) { formatter.property('name').prepend(newLine()); } @@ -593,7 +600,7 @@ export class SafeDsFormatter extends AbstractFormatter { // Statements // ----------------------------------------------------------------------------- - private formatSdsBlock(node: ast.SdsBlock): void { + private formatBlock(node: ast.SdsBlock): void { const formatter = this.getNodeFormatter(node); const openingBrace = formatter.keyword('{'); const closingBrace = formatter.keyword('}'); @@ -607,39 +614,39 @@ export class SafeDsFormatter extends AbstractFormatter { } } - private formatSdsAssignment(node: ast.SdsAssignment) { + private formatAssignment(node: ast.SdsAssignment) { const formatter = this.getNodeFormatter(node); formatter.keyword('=').surround(oneSpace()); formatter.keyword(';').prepend(noSpace()); } - private formatSdsAssigneeList(node: ast.SdsAssigneeList) { + private formatAssigneeList(node: ast.SdsAssigneeList) { const formatter = this.getNodeFormatter(node); formatter.keywords(',').prepend(noSpace()).append(oneSpace()); } - private formatSdsPlaceholder(node: ast.SdsPlaceholder) { + private formatPlaceholder(node: ast.SdsPlaceholder) { const formatter = this.getNodeFormatter(node); formatter.keyword('val').append(oneSpace()); } - private formatSdsYield(node: ast.SdsYield) { + private formatYield(node: ast.SdsYield) { const formatter = this.getNodeFormatter(node); formatter.keyword('yield').append(oneSpace()); formatter.property('result').prepend(oneSpace()); } - private formatSdsExpressionStatement(node: ast.SdsExpressionStatement) { + private formatExpressionStatement(node: ast.SdsExpressionStatement) { const formatter = this.getNodeFormatter(node); formatter.keyword(';').prepend(noSpace()); } - private formatSdsOutputStatement(node: ast.SdsOutputStatement) { + private formatOutputStatement(node: ast.SdsOutputStatement) { const formatter = this.getNodeFormatter(node); formatter.keyword('out').append(oneSpace()); @@ -650,45 +657,45 @@ export class SafeDsFormatter extends AbstractFormatter { // Expressions // ----------------------------------------------------------------------------- - private formatSdsBlockLambda(node: ast.SdsBlockLambda): void { + private formatBlockLambda(node: ast.SdsBlockLambda): void { const formatter = this.getNodeFormatter(node); formatter.property('body').prepend(oneSpace()); } - private formatSdsBlockLambdaResult(node: ast.SdsBlockLambdaResult) { + private formatBlockLambdaResult(node: ast.SdsBlockLambdaResult) { const formatter = this.getNodeFormatter(node); formatter.keyword('yield').append(oneSpace()); } - private formatSdsExpressionLambda(node: ast.SdsExpressionLambda) { + private formatExpressionLambda(node: ast.SdsExpressionLambda) { const formatter = this.getNodeFormatter(node); formatter.keyword('->').surround(oneSpace()); } - private formatSdsInfixOperation(node: ast.SdsInfixOperation) { + private formatInfixOperation(node: ast.SdsInfixOperation) { const formatter = this.getNodeFormatter(node); formatter.property('operator').surround(oneSpace()); } - private formatSdsPrefixOperation(node: ast.SdsPrefixOperation) { + private formatPrefixOperation(node: ast.SdsPrefixOperation) { const formatter = this.getNodeFormatter(node); formatter.keyword('not').append(oneSpace()); formatter.keyword('-').append(noSpace()); } - private formatSdsCall(node: ast.SdsCall) { + private formatCall(node: ast.SdsCall) { const formatter = this.getNodeFormatter(node); formatter.keyword('?').surround(noSpace()); formatter.property('argumentList').prepend(noSpace()); } - private formatSdsArgumentList(node: ast.SdsArgumentList): void { + private formatArgumentList(node: ast.SdsArgumentList): void { const formatter = this.getNodeFormatter(node); const openingParenthesis = formatter.keyword('('); @@ -708,13 +715,13 @@ export class SafeDsFormatter extends AbstractFormatter { } } - private formatSdsArgument(node: ast.SdsArgument): void { + private formatArgument(node: ast.SdsArgument): void { const formatter = this.getNodeFormatter(node); formatter.keyword('=').surround(oneSpace()); } - private formatSdsIndexedAccess(node: ast.SdsIndexedAccess) { + private formatIndexedAccess(node: ast.SdsIndexedAccess) { const formatter = this.getNodeFormatter(node); formatter.keyword('?').surround(noSpace()); @@ -722,14 +729,14 @@ export class SafeDsFormatter extends AbstractFormatter { formatter.keyword(']').prepend(noSpace()); } - private formatSdsMemberAccess(node: ast.SdsMemberAccess) { + private formatMemberAccess(node: ast.SdsMemberAccess) { const formatter = this.getNodeFormatter(node); formatter.keyword('?').surround(noSpace()); formatter.keyword('.').surround(noSpace()); } - private formatSdsList(node: ast.SdsList) { + private formatList(node: ast.SdsList) { const formatter = this.getNodeFormatter(node); const openingSquareBracket = formatter.keyword('['); @@ -749,7 +756,7 @@ export class SafeDsFormatter extends AbstractFormatter { } } - private formatSdsMap(node: ast.SdsMap) { + private formatMap(node: ast.SdsMap) { const formatter = this.getNodeFormatter(node); const openingCurlyBrace = formatter.keyword('{'); @@ -772,38 +779,38 @@ export class SafeDsFormatter extends AbstractFormatter { } } - private formatSdsMapEntry(node: ast.SdsMapEntry) { + private formatMapEntry(node: ast.SdsMapEntry) { const formatter = this.getNodeFormatter(node); formatter.keyword(':').prepend(noSpace()).append(oneSpace()); } - private formatSdsParenthesizedExpression(node: ast.SdsParenthesizedExpression): void { + private formatParenthesizedExpression(node: ast.SdsParenthesizedExpression): void { const formatter = this.getNodeFormatter(node); formatter.keyword('(').append(noSpace()); formatter.keyword(')').prepend(noSpace()); } - private formatSdsTemplateStringStart(node: ast.SdsTemplateStringStart) { + private formatTemplateStringStart(node: ast.SdsTemplateStringStart) { const formatter = this.getNodeFormatter(node); formatter.node(node).append(oneSpace()); } - private formatSdsTemplateStringInner(node: ast.SdsTemplateStringInner) { + private formatTemplateStringInner(node: ast.SdsTemplateStringInner) { const formatter = this.getNodeFormatter(node); formatter.node(node).surround(oneSpace()); } - private formatSdsTemplateStringEnd(node: ast.SdsTemplateStringEnd) { + private formatTemplateStringEnd(node: ast.SdsTemplateStringEnd) { const formatter = this.getNodeFormatter(node); formatter.node(node).prepend(oneSpace()); } - private formatSdsTypeCast(node: ast.SdsTypeCast) { + private formatTypeCast(node: ast.SdsTypeCast) { const formatter = this.getNodeFormatter(node); formatter.keyword('as').surround(oneSpace()); @@ -825,25 +832,25 @@ export class SafeDsFormatter extends AbstractFormatter { // Types // ----------------------------------------------------------------------------- - private formatSdsMemberType(node: ast.SdsMemberType) { + private formatMemberType(node: ast.SdsMemberType) { const formatter = this.getNodeFormatter(node); formatter.keyword('.').surround(noSpace()); } - private formatSdsCallableType(node: ast.SdsCallableType) { + private formatCallableType(node: ast.SdsCallableType) { const formatter = this.getNodeFormatter(node); formatter.keyword('->').surround(oneSpace()); } - private formatSdsLiteralType(node: ast.SdsLiteralType): void { + private formatLiteralType(node: ast.SdsLiteralType): void { const formatter = this.getNodeFormatter(node); formatter.keyword('literal').append(noSpace()); } - private formatSdsLiteralList(node: ast.SdsLiteralList): void { + private formatLiteralList(node: ast.SdsLiteralList): void { const formatter = this.getNodeFormatter(node); const literals = node.literals ?? []; @@ -856,20 +863,20 @@ export class SafeDsFormatter extends AbstractFormatter { formatter.keyword('>').prepend(noSpace()); } - private formatSdsNamedType(node: ast.SdsNamedType) { + private formatNamedType(node: ast.SdsNamedType) { const formatter = this.getNodeFormatter(node); formatter.keyword('?').prepend(noSpace()); formatter.property('typeArgumentList').prepend(noSpace()); } - private formatSdsUnionType(node: ast.SdsUnionType): void { + private formatUnionType(node: ast.SdsUnionType): void { const formatter = this.getNodeFormatter(node); formatter.keyword('union').append(noSpace()); } - private formatSdsTypeParameterList(node: ast.SdsTypeParameterList): void { + private formatTypeParameterList(node: ast.SdsTypeParameterList): void { const formatter = this.getNodeFormatter(node); const closingBracket = formatter.keyword('>'); @@ -890,9 +897,11 @@ export class SafeDsFormatter extends AbstractFormatter { } } - private formatSdsTypeParameter(node: ast.SdsTypeParameter) { + private formatTypeParameter(node: ast.SdsTypeParameter) { const formatter = this.getNodeFormatter(node); + formatter.nodes(...getAnnotationCalls(node).slice(1)).prepend(newLine()); + if (getAnnotationCalls(node).length > 0) { if (node.variance) { formatter.property('variance').prepend(newLine()); @@ -906,7 +915,7 @@ export class SafeDsFormatter extends AbstractFormatter { formatter.keyword('=').surround(oneSpace()); } - private formatSdsTypeArgumentList(node: ast.SdsTypeArgumentList): void { + private formatTypeArgumentList(node: ast.SdsTypeArgumentList): void { const formatter = this.getNodeFormatter(node); const typeArguments = node.typeArguments ?? []; @@ -919,7 +928,7 @@ export class SafeDsFormatter extends AbstractFormatter { formatter.keyword('>').prepend(noSpace()); } - private formatSdsTypeArgument(node: ast.SdsTypeArgument) { + private formatTypeArgument(node: ast.SdsTypeArgument) { const formatter = this.getNodeFormatter(node); formatter.keyword('=').surround(oneSpace()); diff --git a/packages/safe-ds-lang/src/language/safe-ds-module.ts b/packages/safe-ds-lang/src/language/safe-ds-module.ts index c938c8b5a..5b6be0596 100644 --- a/packages/safe-ds-lang/src/language/safe-ds-module.ts +++ b/packages/safe-ds-lang/src/language/safe-ds-module.ts @@ -50,7 +50,6 @@ import { SafeDsMessagingProvider, type SafeDsUserInteractionProvider, } from './communication/safe-ds-messaging-provider.js'; -import { SafeDsConfigurationProvider } from './workspace/safe-ds-configuration-provider.js'; import { SafeDsCodeLensProvider } from './lsp/safe-ds-code-lens-provider.js'; import { SafeDsExecuteCommandHandler } from './lsp/safe-ds-execute-command-handler.js'; import { SafeDsServiceRegistry } from './safe-ds-service-registry.js'; @@ -115,9 +114,6 @@ export type SafeDsAddedServices = { export type SafeDsAddedSharedServices = { ServiceRegistry: SafeDsServiceRegistry; - workspace: { - ConfigurationProvider: SafeDsConfigurationProvider; - }; }; /** @@ -214,7 +210,6 @@ export const SafeDsSharedModule: Module new SafeDsNodeKindProvider(), }, workspace: { - ConfigurationProvider: (sharedServices) => new SafeDsConfigurationProvider(sharedServices), WorkspaceManager: (sharedServices) => new SafeDsWorkspaceManager(sharedServices), }, }; diff --git a/packages/safe-ds-lang/src/language/workspace/safe-ds-configuration-provider.ts b/packages/safe-ds-lang/src/language/workspace/safe-ds-configuration-provider.ts deleted file mode 100644 index a8fa96ae7..000000000 --- a/packages/safe-ds-lang/src/language/workspace/safe-ds-configuration-provider.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { DefaultConfigurationProvider, Emitter, Event } from 'langium'; -import { DidChangeConfigurationParams } from 'vscode-languageserver'; - -export class SafeDsConfigurationProvider extends DefaultConfigurationProvider { - protected onConfigurationSectionUpdateEmitter = new Emitter(); - - override updateConfiguration(change: DidChangeConfigurationParams): void { - if (!change.settings) { - /* c8 ignore next 2 */ - return; - } - - Object.keys(change.settings).forEach((section) => { - const configuration = change.settings[section]; - this.updateSectionConfiguration(section, configuration); - this.onConfigurationSectionUpdateEmitter.fire({ section, configuration }); - }); - } - - /** - * Get notified after a configuration section has been updated. - */ - get onConfigurationSectionUpdate(): Event { - return this.onConfigurationSectionUpdateEmitter.event; - } -} - -type ConfigurationSectionUpdate = { - /** - * The name of the configuration section that has been updated. - */ - section: string; - - /** - * The updated configuration section. - */ - configuration: any; -}; diff --git a/packages/safe-ds-lang/src/language/workspace/safe-ds-settings-provider.ts b/packages/safe-ds-lang/src/language/workspace/safe-ds-settings-provider.ts index 164864512..e1043261c 100644 --- a/packages/safe-ds-lang/src/language/workspace/safe-ds-settings-provider.ts +++ b/packages/safe-ds-lang/src/language/workspace/safe-ds-settings-provider.ts @@ -1,10 +1,9 @@ import { SafeDsServices } from '../safe-ds-module.js'; import { SafeDsLanguageMetaData } from '../generated/module.js'; -import { SafeDsConfigurationProvider } from './safe-ds-configuration-provider.js'; -import { DeepPartial, Disposable } from 'langium'; +import { ConfigurationProvider, DeepPartial, Disposable } from 'langium'; export class SafeDsSettingsProvider { - private readonly configurationProvider: SafeDsConfigurationProvider; + private readonly configurationProvider: ConfigurationProvider; private cachedSettings: DeepPartial = {}; private watchers = new Set>(); diff --git a/packages/safe-ds-lang/tests/resources/call graph/callable/function.sdsdev b/packages/safe-ds-lang/tests/resources/call graph/callable/function.sdsdev index 8d8659fe9..df64efc01 100644 --- a/packages/safe-ds-lang/tests/resources/call graph/callable/function.sdsdev +++ b/packages/safe-ds-lang/tests/resources/call graph/callable/function.sdsdev @@ -4,4 +4,4 @@ package tests.callGraph.callable.function @Pure fun g() // $TEST$ ["myFunction", "f", "g"] -@Pure »fun myFunction(param1: Any = f(), param2: () -> () = g)« +»@Pure fun myFunction(param1: Any = f(), param2: () -> () = g)« diff --git a/packages/safe-ds-lang/tests/resources/formatting/declarations/annotations/annotation call (multiple).sdsdev b/packages/safe-ds-lang/tests/resources/formatting/declarations/annotations/annotation call (multiple).sdsdev new file mode 100644 index 000000000..f4bfc1070 --- /dev/null +++ b/packages/safe-ds-lang/tests/resources/formatting/declarations/annotations/annotation call (multiple).sdsdev @@ -0,0 +1,14 @@ +package test + +@Annotation @Annotation() @Annotation + +annotation MyAnnotation + +// ----------------------------------------------------------------------------- + +package test + +@Annotation +@Annotation() +@Annotation +annotation MyAnnotation diff --git a/packages/safe-ds-lang/tests/resources/formatting/declarations/classes/annotation call (multiple).sdsdev b/packages/safe-ds-lang/tests/resources/formatting/declarations/classes/annotation call (multiple).sdsdev new file mode 100644 index 000000000..377ed3cb1 --- /dev/null +++ b/packages/safe-ds-lang/tests/resources/formatting/declarations/classes/annotation call (multiple).sdsdev @@ -0,0 +1,12 @@ +package test + +@Annotation @Annotation() @Annotation class MyClass + +// ----------------------------------------------------------------------------- + +package test + +@Annotation +@Annotation() +@Annotation +class MyClass diff --git a/packages/safe-ds-lang/tests/resources/formatting/declarations/classes/attributes/annotated (multiple).sdsdev b/packages/safe-ds-lang/tests/resources/formatting/declarations/classes/attributes/annotated (multiple).sdsdev new file mode 100644 index 000000000..5d604c4eb --- /dev/null +++ b/packages/safe-ds-lang/tests/resources/formatting/declarations/classes/attributes/annotated (multiple).sdsdev @@ -0,0 +1,12 @@ +class MyClass { + @Annotation @Annotation() @Annotation attr a +} + +// ----------------------------------------------------------------------------- + +class MyClass { + @Annotation + @Annotation() + @Annotation + attr a +} diff --git a/packages/safe-ds-lang/tests/resources/formatting/declarations/classes/methods/annotated instance method (multiple).sdsdev b/packages/safe-ds-lang/tests/resources/formatting/declarations/classes/methods/annotated instance method (multiple).sdsdev new file mode 100644 index 000000000..b3eb08856 --- /dev/null +++ b/packages/safe-ds-lang/tests/resources/formatting/declarations/classes/methods/annotated instance method (multiple).sdsdev @@ -0,0 +1,13 @@ +class MyClass { + @Annotation @Annotation() @Annotation fun myFunction ( ) +} + + +// ----------------------------------------------------------------------------- + +class MyClass { + @Annotation + @Annotation() + @Annotation + fun myFunction() +} diff --git a/packages/safe-ds-lang/tests/resources/formatting/declarations/classes/methods/annotated static method (multiple).sdsdev b/packages/safe-ds-lang/tests/resources/formatting/declarations/classes/methods/annotated static method (multiple).sdsdev new file mode 100644 index 000000000..de659e443 --- /dev/null +++ b/packages/safe-ds-lang/tests/resources/formatting/declarations/classes/methods/annotated static method (multiple).sdsdev @@ -0,0 +1,12 @@ +class MyClass { + @Annotation @Annotation() @Annotation static fun myFunction ( ) +} + +// ----------------------------------------------------------------------------- + +class MyClass { + @Annotation + @Annotation() + @Annotation + static fun myFunction() +} diff --git a/packages/safe-ds-lang/tests/resources/formatting/declarations/classes/nested classes/annotated nested class (multiple).sdsdev b/packages/safe-ds-lang/tests/resources/formatting/declarations/classes/nested classes/annotated nested class (multiple).sdsdev new file mode 100644 index 000000000..4313b3253 --- /dev/null +++ b/packages/safe-ds-lang/tests/resources/formatting/declarations/classes/nested classes/annotated nested class (multiple).sdsdev @@ -0,0 +1,12 @@ +class MyOuterClass { + @Annotation @Annotation() @Annotation class MyClass +} + +// ----------------------------------------------------------------------------- + +class MyOuterClass { + @Annotation + @Annotation() + @Annotation + class MyClass +} diff --git a/packages/safe-ds-lang/tests/resources/formatting/declarations/classes/nested enums/annotated nested enum (multiple).sdsdev b/packages/safe-ds-lang/tests/resources/formatting/declarations/classes/nested enums/annotated nested enum (multiple).sdsdev new file mode 100644 index 000000000..cfc3ed9e4 --- /dev/null +++ b/packages/safe-ds-lang/tests/resources/formatting/declarations/classes/nested enums/annotated nested enum (multiple).sdsdev @@ -0,0 +1,14 @@ +class MyOuterClass { + @Annotation @Annotation() @Annotation enum MyEnum { MyEnumVariant } +} + +// ----------------------------------------------------------------------------- + +class MyOuterClass { + @Annotation + @Annotation() + @Annotation + enum MyEnum { + MyEnumVariant + } +} diff --git a/packages/safe-ds-lang/tests/resources/formatting/declarations/enums/annotation call (multiple).sdsdev b/packages/safe-ds-lang/tests/resources/formatting/declarations/enums/annotation call (multiple).sdsdev new file mode 100644 index 000000000..2e6202c5d --- /dev/null +++ b/packages/safe-ds-lang/tests/resources/formatting/declarations/enums/annotation call (multiple).sdsdev @@ -0,0 +1,12 @@ +package test + +@Annotation @Annotation() @Annotation enum MyEnum + +// ----------------------------------------------------------------------------- + +package test + +@Annotation +@Annotation() +@Annotation +enum MyEnum diff --git a/packages/safe-ds-lang/tests/resources/formatting/declarations/enums/variants/annotation call (multiple).sdsdev b/packages/safe-ds-lang/tests/resources/formatting/declarations/enums/variants/annotation call (multiple).sdsdev new file mode 100644 index 000000000..4f0b0814b --- /dev/null +++ b/packages/safe-ds-lang/tests/resources/formatting/declarations/enums/variants/annotation call (multiple).sdsdev @@ -0,0 +1,12 @@ +enum MyEnum { + @Annotation @Annotation() @Annotation MyEnumVariant +} + +// ----------------------------------------------------------------------------- + +enum MyEnum { + @Annotation + @Annotation() + @Annotation + MyEnumVariant +} diff --git a/packages/safe-ds-lang/tests/resources/formatting/declarations/functions/annotation call (multiple).sdsdev b/packages/safe-ds-lang/tests/resources/formatting/declarations/functions/annotation call (multiple).sdsdev new file mode 100644 index 000000000..1d1a14b21 --- /dev/null +++ b/packages/safe-ds-lang/tests/resources/formatting/declarations/functions/annotation call (multiple).sdsdev @@ -0,0 +1,12 @@ +package test + +@Annotation @Annotation() @Annotation fun myFunction ( ) + +// ----------------------------------------------------------------------------- + +package test + +@Annotation +@Annotation() +@Annotation +fun myFunction() diff --git a/packages/safe-ds-lang/tests/resources/formatting/declarations/parameters/annotation call (multiple).sdsdev b/packages/safe-ds-lang/tests/resources/formatting/declarations/parameters/annotation call (multiple).sdsdev new file mode 100644 index 000000000..364a8b26d --- /dev/null +++ b/packages/safe-ds-lang/tests/resources/formatting/declarations/parameters/annotation call (multiple).sdsdev @@ -0,0 +1,12 @@ +class C( + @Annotation @Annotation() @Annotation a: Int +) + +// ----------------------------------------------------------------------------- + +class C( + @Annotation + @Annotation() + @Annotation + a: Int +) diff --git a/packages/safe-ds-lang/tests/resources/formatting/declarations/parameters/annotation call.sdsdev b/packages/safe-ds-lang/tests/resources/formatting/declarations/parameters/annotation call.sdsdev new file mode 100644 index 000000000..eb4c48ae4 --- /dev/null +++ b/packages/safe-ds-lang/tests/resources/formatting/declarations/parameters/annotation call.sdsdev @@ -0,0 +1,19 @@ +class C( + @Annotation a: Int, + @Annotation const b: Int, + @Annotation() c: Int, + @Annotation() const d: Int +) + +// ----------------------------------------------------------------------------- + +class C( + @Annotation + a: Int, + @Annotation + const b: Int, + @Annotation() + c: Int, + @Annotation() + const d: Int +) diff --git a/packages/safe-ds-lang/tests/resources/formatting/declarations/pipelines/annotation call (multiple).sdsdev b/packages/safe-ds-lang/tests/resources/formatting/declarations/pipelines/annotation call (multiple).sdsdev new file mode 100644 index 000000000..bfcb681ef --- /dev/null +++ b/packages/safe-ds-lang/tests/resources/formatting/declarations/pipelines/annotation call (multiple).sdsdev @@ -0,0 +1,12 @@ +package test + +@Annotation @Annotation() @Annotation pipeline myPipeline { } + +// ----------------------------------------------------------------------------- + +package test + +@Annotation +@Annotation() +@Annotation +pipeline myPipeline {} diff --git a/packages/safe-ds-lang/tests/resources/formatting/declarations/results/annotation call (multiple).sdsdev b/packages/safe-ds-lang/tests/resources/formatting/declarations/results/annotation call (multiple).sdsdev new file mode 100644 index 000000000..393612390 --- /dev/null +++ b/packages/safe-ds-lang/tests/resources/formatting/declarations/results/annotation call (multiple).sdsdev @@ -0,0 +1,12 @@ +fun f() -> ( + @Annotation @Annotation() @Annotation a: Int +) + +// ----------------------------------------------------------------------------- + +fun f() -> ( + @Annotation + @Annotation() + @Annotation + a: Int +) diff --git a/packages/safe-ds-lang/tests/resources/formatting/declarations/segments/annotation call (multiple).sdsdev b/packages/safe-ds-lang/tests/resources/formatting/declarations/segments/annotation call (multiple).sdsdev new file mode 100644 index 000000000..743e771a5 --- /dev/null +++ b/packages/safe-ds-lang/tests/resources/formatting/declarations/segments/annotation call (multiple).sdsdev @@ -0,0 +1,12 @@ +package test + +@Annotation @Annotation() @Annotation segment mySegment ( ) { } + +// ----------------------------------------------------------------------------- + +package test + +@Annotation +@Annotation() +@Annotation +segment mySegment() {} diff --git a/packages/safe-ds-lang/tests/resources/formatting/declarations/type parameters/annotation call (multiple).sdsdev b/packages/safe-ds-lang/tests/resources/formatting/declarations/type parameters/annotation call (multiple).sdsdev new file mode 100644 index 000000000..c84e76e4c --- /dev/null +++ b/packages/safe-ds-lang/tests/resources/formatting/declarations/type parameters/annotation call (multiple).sdsdev @@ -0,0 +1,10 @@ +fun f<@Annotation @Annotation() @Annotation T>() + +// ----------------------------------------------------------------------------- + +fun f< + @Annotation + @Annotation() + @Annotation + T +>() diff --git a/packages/safe-ds-lang/tests/resources/generation/markdown/annotations/deprecated/generated/tests/generation/markdown/annotations/deprecated/MyAnnotation1.md b/packages/safe-ds-lang/tests/resources/generation/markdown/annotations/deprecated/generated/tests/generation/markdown/annotations/deprecated/MyAnnotation1.md index 27bde97b9..79380e26f 100644 --- a/packages/safe-ds-lang/tests/resources/generation/markdown/annotations/deprecated/generated/tests/generation/markdown/annotations/deprecated/MyAnnotation1.md +++ b/packages/safe-ds-lang/tests/resources/generation/markdown/annotations/deprecated/generated/tests/generation/markdown/annotations/deprecated/MyAnnotation1.md @@ -23,7 +23,8 @@ ??? quote "Stub code in `main.sdsstub`" - ```sds linenums="4" + ```sds linenums="3" + @Deprecated annotation MyAnnotation1 ``` { data-search-exclude } diff --git a/packages/safe-ds-lang/tests/resources/generation/markdown/annotations/documented/generated/tests/generation/markdown/annotations/documented/MyAnnotation3.md b/packages/safe-ds-lang/tests/resources/generation/markdown/annotations/documented/generated/tests/generation/markdown/annotations/documented/MyAnnotation3.md index 68bfc4727..c61b181fc 100644 --- a/packages/safe-ds-lang/tests/resources/generation/markdown/annotations/documented/generated/tests/generation/markdown/annotations/documented/MyAnnotation3.md +++ b/packages/safe-ds-lang/tests/resources/generation/markdown/annotations/documented/generated/tests/generation/markdown/annotations/documented/MyAnnotation3.md @@ -10,7 +10,8 @@ Description of MyAnnotation3. ??? quote "Stub code in `main.sdsstub`" - ```sds linenums="20" + ```sds linenums="19" + @Targets([AnnotationTarget.Annotation]) annotation MyAnnotation3 ``` { data-search-exclude } diff --git a/packages/safe-ds-lang/tests/resources/generation/markdown/annotations/experimental/generated/tests/generation/markdown/annotations/experimental/MyAnnotation1.md b/packages/safe-ds-lang/tests/resources/generation/markdown/annotations/experimental/generated/tests/generation/markdown/annotations/experimental/MyAnnotation1.md index 0b2f622a8..2fa5dbc4a 100644 --- a/packages/safe-ds-lang/tests/resources/generation/markdown/annotations/experimental/generated/tests/generation/markdown/annotations/experimental/MyAnnotation1.md +++ b/packages/safe-ds-lang/tests/resources/generation/markdown/annotations/experimental/generated/tests/generation/markdown/annotations/experimental/MyAnnotation1.md @@ -19,7 +19,8 @@ ??? quote "Stub code in `main.sdsstub`" - ```sds linenums="4" + ```sds linenums="3" + @Experimental annotation MyAnnotation1 ``` { data-search-exclude } diff --git a/packages/safe-ds-lang/tests/resources/generation/markdown/annotations/undocumented/generated/tests/generation/markdown/annotations/undocumented/MyAnnotation3.md b/packages/safe-ds-lang/tests/resources/generation/markdown/annotations/undocumented/generated/tests/generation/markdown/annotations/undocumented/MyAnnotation3.md index 4d70d016d..0cd02509c 100644 --- a/packages/safe-ds-lang/tests/resources/generation/markdown/annotations/undocumented/generated/tests/generation/markdown/annotations/undocumented/MyAnnotation3.md +++ b/packages/safe-ds-lang/tests/resources/generation/markdown/annotations/undocumented/generated/tests/generation/markdown/annotations/undocumented/MyAnnotation3.md @@ -8,7 +8,8 @@ ??? quote "Stub code in `main.sdsstub`" - ```sds linenums="8" + ```sds linenums="7" + @Targets([AnnotationTarget.Annotation]) annotation MyAnnotation3 ``` { data-search-exclude } diff --git a/packages/safe-ds-lang/tests/resources/generation/markdown/classes/deprecated/generated/tests/generation/markdown/classes/deprecated/MyClass1.md b/packages/safe-ds-lang/tests/resources/generation/markdown/classes/deprecated/generated/tests/generation/markdown/classes/deprecated/MyClass1.md index 7e785e395..326b537bb 100644 --- a/packages/safe-ds-lang/tests/resources/generation/markdown/classes/deprecated/generated/tests/generation/markdown/classes/deprecated/MyClass1.md +++ b/packages/safe-ds-lang/tests/resources/generation/markdown/classes/deprecated/generated/tests/generation/markdown/classes/deprecated/MyClass1.md @@ -13,7 +13,8 @@ search: ??? quote "Stub code in `main.sdsstub`" - ```sds linenums="4" + ```sds linenums="3" + @Deprecated class MyClass1 ``` { data-search-exclude } diff --git a/packages/safe-ds-lang/tests/resources/generation/markdown/classes/experimental/generated/tests/generation/markdown/classes/experimental/MyClass1.md b/packages/safe-ds-lang/tests/resources/generation/markdown/classes/experimental/generated/tests/generation/markdown/classes/experimental/MyClass1.md index ec958d34c..c6c89259d 100644 --- a/packages/safe-ds-lang/tests/resources/generation/markdown/classes/experimental/generated/tests/generation/markdown/classes/experimental/MyClass1.md +++ b/packages/safe-ds-lang/tests/resources/generation/markdown/classes/experimental/generated/tests/generation/markdown/classes/experimental/MyClass1.md @@ -9,7 +9,8 @@ search: ??? quote "Stub code in `main.sdsstub`" - ```sds linenums="4" + ```sds linenums="3" + @Experimental class MyClass1 ``` { data-search-exclude } diff --git a/packages/safe-ds-lang/tests/resources/generation/markdown/deprecated/generated/tests/generation/markdown/deprecated/MyClass1.md b/packages/safe-ds-lang/tests/resources/generation/markdown/deprecated/generated/tests/generation/markdown/deprecated/MyClass1.md index f061a0122..5b959b809 100644 --- a/packages/safe-ds-lang/tests/resources/generation/markdown/deprecated/generated/tests/generation/markdown/deprecated/MyClass1.md +++ b/packages/safe-ds-lang/tests/resources/generation/markdown/deprecated/generated/tests/generation/markdown/deprecated/MyClass1.md @@ -13,7 +13,8 @@ search: ??? quote "Stub code in `main.sdsstub`" - ```sds linenums="4" + ```sds linenums="3" + @Deprecated class MyClass1 {} ``` { data-search-exclude } diff --git a/packages/safe-ds-lang/tests/resources/generation/markdown/deprecated/generated/tests/generation/markdown/deprecated/MyClass2.md b/packages/safe-ds-lang/tests/resources/generation/markdown/deprecated/generated/tests/generation/markdown/deprecated/MyClass2.md index b4cf4e96e..cf0fd942f 100644 --- a/packages/safe-ds-lang/tests/resources/generation/markdown/deprecated/generated/tests/generation/markdown/deprecated/MyClass2.md +++ b/packages/safe-ds-lang/tests/resources/generation/markdown/deprecated/generated/tests/generation/markdown/deprecated/MyClass2.md @@ -15,7 +15,10 @@ search: ??? quote "Stub code in `main.sdsstub`" - ```sds linenums="9" + ```sds linenums="6" + @Deprecated( + alternative = "Something else", + ) class MyClass2 {} ``` { data-search-exclude } diff --git a/packages/safe-ds-lang/tests/resources/generation/markdown/deprecated/generated/tests/generation/markdown/deprecated/MyClass3.md b/packages/safe-ds-lang/tests/resources/generation/markdown/deprecated/generated/tests/generation/markdown/deprecated/MyClass3.md index 2a108b7bb..30fb58fd0 100644 --- a/packages/safe-ds-lang/tests/resources/generation/markdown/deprecated/generated/tests/generation/markdown/deprecated/MyClass3.md +++ b/packages/safe-ds-lang/tests/resources/generation/markdown/deprecated/generated/tests/generation/markdown/deprecated/MyClass3.md @@ -15,7 +15,10 @@ search: ??? quote "Stub code in `main.sdsstub`" - ```sds linenums="14" + ```sds linenums="11" + @Deprecated( + reason = "To annoy you", + ) class MyClass3 {} ``` { data-search-exclude } diff --git a/packages/safe-ds-lang/tests/resources/generation/markdown/deprecated/generated/tests/generation/markdown/deprecated/MyClass4.md b/packages/safe-ds-lang/tests/resources/generation/markdown/deprecated/generated/tests/generation/markdown/deprecated/MyClass4.md index 4497472e8..fc3eb7cf5 100644 --- a/packages/safe-ds-lang/tests/resources/generation/markdown/deprecated/generated/tests/generation/markdown/deprecated/MyClass4.md +++ b/packages/safe-ds-lang/tests/resources/generation/markdown/deprecated/generated/tests/generation/markdown/deprecated/MyClass4.md @@ -13,7 +13,10 @@ search: ??? quote "Stub code in `main.sdsstub`" - ```sds linenums="19" + ```sds linenums="16" + @Deprecated( + sinceVersion = "1.0.0" + ) class MyClass4 {} ``` { data-search-exclude } diff --git a/packages/safe-ds-lang/tests/resources/generation/markdown/deprecated/generated/tests/generation/markdown/deprecated/MyClass5.md b/packages/safe-ds-lang/tests/resources/generation/markdown/deprecated/generated/tests/generation/markdown/deprecated/MyClass5.md index 97439fa77..41775f29b 100644 --- a/packages/safe-ds-lang/tests/resources/generation/markdown/deprecated/generated/tests/generation/markdown/deprecated/MyClass5.md +++ b/packages/safe-ds-lang/tests/resources/generation/markdown/deprecated/generated/tests/generation/markdown/deprecated/MyClass5.md @@ -13,7 +13,10 @@ search: ??? quote "Stub code in `main.sdsstub`" - ```sds linenums="24" + ```sds linenums="21" + @Deprecated( + removalVersion = "2.0.0", + ) class MyClass5 {} ``` { data-search-exclude } diff --git a/packages/safe-ds-lang/tests/resources/generation/markdown/deprecated/generated/tests/generation/markdown/deprecated/MyClass6.md b/packages/safe-ds-lang/tests/resources/generation/markdown/deprecated/generated/tests/generation/markdown/deprecated/MyClass6.md index e1f5c50e2..e62ce3202 100644 --- a/packages/safe-ds-lang/tests/resources/generation/markdown/deprecated/generated/tests/generation/markdown/deprecated/MyClass6.md +++ b/packages/safe-ds-lang/tests/resources/generation/markdown/deprecated/generated/tests/generation/markdown/deprecated/MyClass6.md @@ -16,7 +16,13 @@ search: ??? quote "Stub code in `main.sdsstub`" - ```sds linenums="32" + ```sds linenums="26" + @Deprecated( + alternative = "Something else", + reason = "To annoy you", + sinceVersion = "1.0.0", + removalVersion = "2.0.0", + ) class MyClass6 {} ``` { data-search-exclude } diff --git a/packages/safe-ds-lang/tests/resources/generation/markdown/enums/deprecated/generated/tests/generation/markdown/enums/deprecated/MyEnum1.md b/packages/safe-ds-lang/tests/resources/generation/markdown/enums/deprecated/generated/tests/generation/markdown/enums/deprecated/MyEnum1.md index 77d7fd62f..45afa00b2 100644 --- a/packages/safe-ds-lang/tests/resources/generation/markdown/enums/deprecated/generated/tests/generation/markdown/enums/deprecated/MyEnum1.md +++ b/packages/safe-ds-lang/tests/resources/generation/markdown/enums/deprecated/generated/tests/generation/markdown/enums/deprecated/MyEnum1.md @@ -8,7 +8,8 @@ ??? quote "Stub code in `main.sdsstub`" - ```sds linenums="4" + ```sds linenums="3" + @Deprecated enum MyEnum1 ``` { data-search-exclude } diff --git a/packages/safe-ds-lang/tests/resources/generation/markdown/enums/experimental/generated/tests/generation/markdown/enums/experimental/MyEnum1.md b/packages/safe-ds-lang/tests/resources/generation/markdown/enums/experimental/generated/tests/generation/markdown/enums/experimental/MyEnum1.md index 2c4f0057c..27c960293 100644 --- a/packages/safe-ds-lang/tests/resources/generation/markdown/enums/experimental/generated/tests/generation/markdown/enums/experimental/MyEnum1.md +++ b/packages/safe-ds-lang/tests/resources/generation/markdown/enums/experimental/generated/tests/generation/markdown/enums/experimental/MyEnum1.md @@ -4,7 +4,8 @@ ??? quote "Stub code in `main.sdsstub`" - ```sds linenums="4" + ```sds linenums="3" + @Experimental enum MyEnum1 ``` { data-search-exclude } diff --git a/packages/safe-ds-lang/tests/resources/generation/markdown/functions/deprecated/generated/tests/generation/markdown/functions/deprecated/myFunction1.md b/packages/safe-ds-lang/tests/resources/generation/markdown/functions/deprecated/generated/tests/generation/markdown/functions/deprecated/myFunction1.md index 1c2ee5478..8b93d30b9 100644 --- a/packages/safe-ds-lang/tests/resources/generation/markdown/functions/deprecated/generated/tests/generation/markdown/functions/deprecated/myFunction1.md +++ b/packages/safe-ds-lang/tests/resources/generation/markdown/functions/deprecated/generated/tests/generation/markdown/functions/deprecated/myFunction1.md @@ -8,7 +8,9 @@ ??? quote "Stub code in `main.sdsstub`" - ```sds linenums="5" + ```sds linenums="3" + @Deprecated + @Pure fun myFunction1() ``` { data-search-exclude } diff --git a/packages/safe-ds-lang/tests/resources/generation/markdown/functions/documented/generated/tests/generation/markdown/functions/documented/myFunction1.md b/packages/safe-ds-lang/tests/resources/generation/markdown/functions/documented/generated/tests/generation/markdown/functions/documented/myFunction1.md index 00231630a..24b23a6f8 100644 --- a/packages/safe-ds-lang/tests/resources/generation/markdown/functions/documented/generated/tests/generation/markdown/functions/documented/myFunction1.md +++ b/packages/safe-ds-lang/tests/resources/generation/markdown/functions/documented/generated/tests/generation/markdown/functions/documented/myFunction1.md @@ -6,7 +6,8 @@ Description of myFunction1. ??? quote "Stub code in `main.sdsstub`" - ```sds linenums="7" + ```sds linenums="6" + @Pure fun myFunction1() ``` { data-search-exclude } diff --git a/packages/safe-ds-lang/tests/resources/generation/markdown/functions/documented/generated/tests/generation/markdown/functions/documented/myFunction2.md b/packages/safe-ds-lang/tests/resources/generation/markdown/functions/documented/generated/tests/generation/markdown/functions/documented/myFunction2.md index db9b069ce..d3da34c63 100644 --- a/packages/safe-ds-lang/tests/resources/generation/markdown/functions/documented/generated/tests/generation/markdown/functions/documented/myFunction2.md +++ b/packages/safe-ds-lang/tests/resources/generation/markdown/functions/documented/generated/tests/generation/markdown/functions/documented/myFunction2.md @@ -22,7 +22,8 @@ Description of myFunction2. ??? quote "Stub code in `main.sdsstub`" - ```sds linenums="17" + ```sds linenums="16" + @Pure fun myFunction2( param1: TypeParam1, param2: TypeParam2, diff --git a/packages/safe-ds-lang/tests/resources/generation/markdown/functions/documented/generated/tests/generation/markdown/functions/documented/myFunction3.md b/packages/safe-ds-lang/tests/resources/generation/markdown/functions/documented/generated/tests/generation/markdown/functions/documented/myFunction3.md index 666632238..52fdd6f0e 100644 --- a/packages/safe-ds-lang/tests/resources/generation/markdown/functions/documented/generated/tests/generation/markdown/functions/documented/myFunction3.md +++ b/packages/safe-ds-lang/tests/resources/generation/markdown/functions/documented/generated/tests/generation/markdown/functions/documented/myFunction3.md @@ -13,7 +13,8 @@ Description of myFunction3. ??? quote "Stub code in `main.sdsstub`" - ```sds linenums="30" + ```sds linenums="29" + @Pure fun myFunction3(param1: MyClass1, param2: Float = 1.0) ``` { data-search-exclude } diff --git a/packages/safe-ds-lang/tests/resources/generation/markdown/functions/documented/generated/tests/generation/markdown/functions/documented/myFunction4.md b/packages/safe-ds-lang/tests/resources/generation/markdown/functions/documented/generated/tests/generation/markdown/functions/documented/myFunction4.md index 8af1bfdff..22f0e0ae1 100644 --- a/packages/safe-ds-lang/tests/resources/generation/markdown/functions/documented/generated/tests/generation/markdown/functions/documented/myFunction4.md +++ b/packages/safe-ds-lang/tests/resources/generation/markdown/functions/documented/generated/tests/generation/markdown/functions/documented/myFunction4.md @@ -13,7 +13,8 @@ Description of myFunction4. ??? quote "Stub code in `main.sdsstub`" - ```sds linenums="39" + ```sds linenums="38" + @Pure fun myFunction4() -> (result1: MyClass1, result2: Float) ``` { data-search-exclude } diff --git a/packages/safe-ds-lang/tests/resources/generation/markdown/functions/documented/generated/tests/generation/markdown/functions/documented/myFunction5.md b/packages/safe-ds-lang/tests/resources/generation/markdown/functions/documented/generated/tests/generation/markdown/functions/documented/myFunction5.md index aa8e7b6f6..e6d66510d 100644 --- a/packages/safe-ds-lang/tests/resources/generation/markdown/functions/documented/generated/tests/generation/markdown/functions/documented/myFunction5.md +++ b/packages/safe-ds-lang/tests/resources/generation/markdown/functions/documented/generated/tests/generation/markdown/functions/documented/myFunction5.md @@ -12,7 +12,8 @@ Description of myFunction5. ??? quote "Stub code in `main.sdsstub`" - ```sds linenums="47" + ```sds linenums="46" + @Pure fun myFunction5() ``` { data-search-exclude } diff --git a/packages/safe-ds-lang/tests/resources/generation/markdown/functions/experimental/generated/tests/generation/markdown/functions/experimental/myFunction1.md b/packages/safe-ds-lang/tests/resources/generation/markdown/functions/experimental/generated/tests/generation/markdown/functions/experimental/myFunction1.md index 2fc56c82f..f80532fa5 100644 --- a/packages/safe-ds-lang/tests/resources/generation/markdown/functions/experimental/generated/tests/generation/markdown/functions/experimental/myFunction1.md +++ b/packages/safe-ds-lang/tests/resources/generation/markdown/functions/experimental/generated/tests/generation/markdown/functions/experimental/myFunction1.md @@ -4,7 +4,9 @@ ??? quote "Stub code in `main.sdsstub`" - ```sds linenums="5" + ```sds linenums="3" + @Experimental + @Pure fun myFunction1() ``` { data-search-exclude } diff --git a/packages/safe-ds-lang/tests/resources/generation/markdown/functions/undocumented/generated/tests/generation/markdown/functions/undocumented/myFunction1.md b/packages/safe-ds-lang/tests/resources/generation/markdown/functions/undocumented/generated/tests/generation/markdown/functions/undocumented/myFunction1.md index 2894db174..270e9ecda 100644 --- a/packages/safe-ds-lang/tests/resources/generation/markdown/functions/undocumented/generated/tests/generation/markdown/functions/undocumented/myFunction1.md +++ b/packages/safe-ds-lang/tests/resources/generation/markdown/functions/undocumented/generated/tests/generation/markdown/functions/undocumented/myFunction1.md @@ -4,7 +4,8 @@ ??? quote "Stub code in `main.sdsstub`" - ```sds linenums="4" + ```sds linenums="3" + @Pure fun myFunction1() ``` { data-search-exclude } diff --git a/packages/safe-ds-lang/tests/resources/generation/markdown/functions/undocumented/generated/tests/generation/markdown/functions/undocumented/myFunction2.md b/packages/safe-ds-lang/tests/resources/generation/markdown/functions/undocumented/generated/tests/generation/markdown/functions/undocumented/myFunction2.md index 85f417f3d..fd3764f28 100644 --- a/packages/safe-ds-lang/tests/resources/generation/markdown/functions/undocumented/generated/tests/generation/markdown/functions/undocumented/myFunction2.md +++ b/packages/safe-ds-lang/tests/resources/generation/markdown/functions/undocumented/generated/tests/generation/markdown/functions/undocumented/myFunction2.md @@ -20,7 +20,8 @@ ??? quote "Stub code in `main.sdsstub`" - ```sds linenums="7" + ```sds linenums="6" + @Pure fun myFunction2( param1: TypeParam1, param2: TypeParam2, diff --git a/packages/safe-ds-lang/tests/resources/generation/markdown/functions/undocumented/generated/tests/generation/markdown/functions/undocumented/myFunction3.md b/packages/safe-ds-lang/tests/resources/generation/markdown/functions/undocumented/generated/tests/generation/markdown/functions/undocumented/myFunction3.md index 78022ca4b..baa71c674 100644 --- a/packages/safe-ds-lang/tests/resources/generation/markdown/functions/undocumented/generated/tests/generation/markdown/functions/undocumented/myFunction3.md +++ b/packages/safe-ds-lang/tests/resources/generation/markdown/functions/undocumented/generated/tests/generation/markdown/functions/undocumented/myFunction3.md @@ -11,7 +11,8 @@ ??? quote "Stub code in `main.sdsstub`" - ```sds linenums="14" + ```sds linenums="13" + @Pure fun myFunction3(param1: Int, param2: Float = 1.0) ``` { data-search-exclude } diff --git a/packages/safe-ds-lang/tests/resources/generation/markdown/functions/undocumented/generated/tests/generation/markdown/functions/undocumented/myFunction4.md b/packages/safe-ds-lang/tests/resources/generation/markdown/functions/undocumented/generated/tests/generation/markdown/functions/undocumented/myFunction4.md index 68a69431f..2938d56f8 100644 --- a/packages/safe-ds-lang/tests/resources/generation/markdown/functions/undocumented/generated/tests/generation/markdown/functions/undocumented/myFunction4.md +++ b/packages/safe-ds-lang/tests/resources/generation/markdown/functions/undocumented/generated/tests/generation/markdown/functions/undocumented/myFunction4.md @@ -11,7 +11,8 @@ ??? quote "Stub code in `main.sdsstub`" - ```sds linenums="17" + ```sds linenums="16" + @Pure fun myFunction4() -> (result1: Int, result2: Float) ``` { data-search-exclude } diff --git a/packages/safe-ds-lang/tests/resources/generation/markdown/segments/deprecated/generated/tests/generation/markdown/segments/deprecated/mySegment1.md b/packages/safe-ds-lang/tests/resources/generation/markdown/segments/deprecated/generated/tests/generation/markdown/segments/deprecated/mySegment1.md index 18de76578..fdbb9d067 100644 --- a/packages/safe-ds-lang/tests/resources/generation/markdown/segments/deprecated/generated/tests/generation/markdown/segments/deprecated/mySegment1.md +++ b/packages/safe-ds-lang/tests/resources/generation/markdown/segments/deprecated/generated/tests/generation/markdown/segments/deprecated/mySegment1.md @@ -8,7 +8,8 @@ ??? quote "Implementation code in `main.sds`" - ```sds linenums="4" + ```sds linenums="3" + @Deprecated segment mySegment1() {} ``` { data-search-exclude } diff --git a/packages/safe-ds-lang/tests/resources/generation/markdown/segments/experimental/generated/tests/generation/markdown/segments/experimental/mySegment1.md b/packages/safe-ds-lang/tests/resources/generation/markdown/segments/experimental/generated/tests/generation/markdown/segments/experimental/mySegment1.md index d42ff1ccb..2c9a1ca12 100644 --- a/packages/safe-ds-lang/tests/resources/generation/markdown/segments/experimental/generated/tests/generation/markdown/segments/experimental/mySegment1.md +++ b/packages/safe-ds-lang/tests/resources/generation/markdown/segments/experimental/generated/tests/generation/markdown/segments/experimental/mySegment1.md @@ -4,7 +4,8 @@ ??? quote "Implementation code in `main.sds`" - ```sds linenums="4" + ```sds linenums="3" + @Experimental segment mySegment1() {} ``` { data-search-exclude } diff --git a/packages/safe-ds-lang/tests/resources/generation/python/declarations/pipeline with python name/generated/tests/generator/pipelineWithPythonName/gen_input.py.map b/packages/safe-ds-lang/tests/resources/generation/python/declarations/pipeline with python name/generated/tests/generator/pipelineWithPythonName/gen_input.py.map index f1fef8332..18e0e5eb7 100644 --- a/packages/safe-ds-lang/tests/resources/generation/python/declarations/pipeline with python name/generated/tests/generator/pipelineWithPythonName/gen_input.py.map +++ b/packages/safe-ds-lang/tests/resources/generation/python/declarations/pipeline with python name/generated/tests/generator/pipelineWithPythonName/gen_input.py.map @@ -1 +1 @@ -{"version":3,"sources":["input.sdsdev"],"names":["testpipeline","f"],"mappings":"AAAA;;;;;;AAKA,IAASA,aAAY;IACjBC,CAAC","file":"gen_input.py"} \ No newline at end of file +{"version":3,"sources":["input.sdsdev"],"names":["testpipeline","f"],"mappings":"AAAA;;;;;;AAIA,IACSA,aAAY;IACjBC,CAAC","file":"gen_input.py"} \ No newline at end of file diff --git a/packages/safe-ds-lang/tests/resources/generation/python/declarations/segment with python name/generated/tests/generator/segmentWithPythonName/gen_input.py.map b/packages/safe-ds-lang/tests/resources/generation/python/declarations/segment with python name/generated/tests/generator/segmentWithPythonName/gen_input.py.map index 4cfa5390c..a52930d56 100644 --- a/packages/safe-ds-lang/tests/resources/generation/python/declarations/segment with python name/generated/tests/generator/segmentWithPythonName/gen_input.py.map +++ b/packages/safe-ds-lang/tests/resources/generation/python/declarations/segment with python name/generated/tests/generator/segmentWithPythonName/gen_input.py.map @@ -1 +1 @@ -{"version":3,"sources":["input.sdsdev"],"names":["testsegment","f"],"mappings":"AAAA;;;;;;AAKA,IAAQA,YAAW;IACfC,CAAC","file":"gen_input.py"} \ No newline at end of file +{"version":3,"sources":["input.sdsdev"],"names":["testsegment","f"],"mappings":"AAAA;;;;;;AAIA,IACQA,YAAW;IACfC,CAAC","file":"gen_input.py"} \ No newline at end of file diff --git a/packages/safe-ds-lang/tests/resources/generation/python/partial/pure dependency/generated/tests/generator/partialPureDependency/gen_input.py.map b/packages/safe-ds-lang/tests/resources/generation/python/partial/pure dependency/generated/tests/generator/partialPureDependency/gen_input.py.map index 005687176..db4495def 100644 --- a/packages/safe-ds-lang/tests/resources/generation/python/partial/pure dependency/generated/tests/generator/partialPureDependency/gen_input.py.map +++ b/packages/safe-ds-lang/tests/resources/generation/python/partial/pure dependency/generated/tests/generator/partialPureDependency/gen_input.py.map @@ -1 +1 @@ -{"version":3,"sources":["input.sdsdev"],"names":["testpipeline","false","null","g","boolean1","ldouble","lint","lnull","lstrmulti","z","f","g2","mapkey","mapvalue","nopartialevalint","listv1","listv3","list3","g3","list","o","value1","mapresult","listresult","g4","listvalue"],"mappings":"AAAA;;;;;;AAcA,IAASA,YAAY;IACjB,2BAAaC,KAAK;IAGlB,4BAAc,IAAI;IAGlB,yBAAW,CAAC;IAGZ,0BAAYC,IAAI;IAGhB,8BAAgB;IAIhB,6BAAe;IAGf,2BAAaC,CAAC,CAACC,IAAQ,EAAEC,IAAO,EAAEC,CAAI,EAAEC,IAAK,EAAEC,aAAS;IAG9C;QACN,sBAAQ,CAAC;QACT,uBAAS,CAAC;QACV,sBAAQ;QACR,uBAAS;QACT,0BAAMC,CAAC,GAAG;QALJ,OAKN,0BAAMA,CAAC;IACJ;eAAM,CAAC;IANd,sBAAQ,CAAAC,CAAC,CAAC,iBAMP,CAAC,EAACA,CAAC,CAAC;IAcP,2BAAa,KAAK;IAClB,6BAAe,OAAO;IACtB,8BAAgBC,EAAE,CAAC,CAACC,KAAM,EAAEC,OAAQ;IAMpC,2BAAa,CAAC;IAEd,2BAAaC,gBAAgB,CAACC,CAAM;IAEpC,yBAAW,CAACA,CAAM;IAElB,0BAAY,CAACC,wBAAM;IACnB,8BAAgBC,uBAAK,CAAC,CAAC;IAEvB,+BAAiBC,EAAE,CAACC,sBAAI;IAIvB,2BAAa,CAAO,CAAP,CAAA,CAAC,CAAAC,mBAAC,GAAC,CAAC,EAAC,CAAC,GAAC,CAAC,EAACC,wBAAM,GAAC,CAAC,EAAwB,CAAvB,CAAAC,2BAAS,EAAC,CAAC,EAACC,4BAAU,GAAC,CAAC,EAACC,EAAE,CAACC,2BAAS","file":"gen_input.py"} \ No newline at end of file +{"version":3,"sources":["input.sdsdev"],"names":["testpipeline","false","null","g","boolean1","ldouble","lint","lnull","lstrmulti","z","f","g2","mapkey","mapvalue","nopartialevalint","listv1","listv3","list3","g3","list","o","value1","mapresult","listresult","g4","listvalue"],"mappings":"AAAA;;;;;;AAcA,IAASA,YAAY;IACjB,2BAAaC,KAAK;IAGlB,4BAAc,IAAI;IAGlB,yBAAW,CAAC;IAGZ,0BAAYC,IAAI;IAGhB,8BAAgB;IAIhB,6BAAe;IAGf,2BAAaC,CAAC,CAACC,IAAQ,EAAEC,IAAO,EAAEC,CAAI,EAAEC,IAAK,EAAEC,aAAS;IAG9C;QACN,sBAAQ,CAAC;QACT,uBAAS,CAAC;QACV,sBAAQ;QACR,uBAAS;QACT,0BAAMC,CAAC,GAAG;QALJ,OAKN,0BAAMA,CAAC;IACJ;eAAM,CAAC;IANd,sBAAQ,CAAAC,CAAC,CAAC,iBAMP,CAAC,EAACA,CAAC,CAAC;IAcP,2BAAa,KAAK;IAClB,6BAAe,OAAO;IACtB,8BAAgBC,EAAE,CAAC,CAACC,KAAM,EAAEC,OAAQ;IAMpC,2BAAa,CAAC;IAEd,2BAAaC,gBAAgB,CAACC,CAAM;IAEpC,yBAAW,CAACA,CAAM;IAElB,0BAAY,CAACC,wBAAM;IACnB,8BAAgBC,uBAAK,CAAC,CAAC;IAEvB,+BAAiBC,EAAE,CAACC,sBAAI;IAIvB,2BAAa,CAAA,CAAA,CAAA,CAAC,CAAAC,mBAAC,GAAC,CAAC,EAAC,CAAC,GAAC,CAAC,EAACC,wBAAM,GAAC,CAAC,EAAC,CAAA,CAAAC,2BAAS,EAAC,CAAC,EAACC,4BAAU,GAAC,CAAC,EAACC,EAAE,CAACC,2BAAS","file":"gen_input.py"} \ No newline at end of file diff --git a/packages/safe-ds-lang/tests/resources/partial evaluation/base cases/functions/main.sdsdev b/packages/safe-ds-lang/tests/resources/partial evaluation/base cases/functions/main.sdsdev index 1f0f1b214..fe78c72da 100644 --- a/packages/safe-ds-lang/tests/resources/partial evaluation/base cases/functions/main.sdsdev +++ b/packages/safe-ds-lang/tests/resources/partial evaluation/base cases/functions/main.sdsdev @@ -1,4 +1,4 @@ package tests.partialValidation.baseCases.functions // $TEST$ serialization f -@Pure »fun f()« +»@Pure fun f()«