Skip to content

Commit dedbf1a

Browse files
committed
fmt
1 parent e0a3d4c commit dedbf1a

File tree

5 files changed

+7
-10
lines changed

5 files changed

+7
-10
lines changed

pkgs/swift2objc/lib/src/generator/_core/utils.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ void outputNextToFile({
4141
String generateAnnotations(Declaration decl) {
4242
final annotations = StringBuffer();
4343
if (decl is CanAsync && (decl as CanAsync).async) {
44-
annotations.write(' async');
44+
annotations.write('async ');
4545
}
4646
if (decl is CanThrow && (decl as CanThrow).throws) {
47-
annotations.write(' throws');
47+
annotations.write('throws ');
4848
}
4949
return annotations.toString();
5050
}

pkgs/swift2objc/lib/src/generator/generators/class_generator.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,17 +113,17 @@ List<String> _generateClassMethod(MethodDeclaration method) {
113113
}
114114

115115
header.write(
116-
'public func ${method.name}(${generateParameters(method.params)})',
116+
'public func ${method.name}(${generateParameters(method.params)}) ',
117117
);
118118

119119
header.write(generateAnnotations(method));
120120

121121
if (!method.returnType.sameAs(voidType)) {
122-
header.write(' -> ${method.returnType.swiftType}');
122+
header.write('-> ${method.returnType.swiftType} ');
123123
}
124124

125125
return [
126-
'$header {',
126+
'$header{',
127127
...method.statements.indent(),
128128
'}\n',
129129
];

pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_function_declaration.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ MethodDeclaration parseMethodDeclaration(
3434
bool isStatic = false,
3535
}) {
3636
final info =
37-
parseFunctionInfo(methodSymbolJson['declarationFragments'], symbolgraph, parseSymbolName(methodSymbolJson));
37+
parseFunctionInfo(methodSymbolJson['declarationFragments'], symbolgraph);
3838
return MethodDeclaration(
3939
id: parseSymbolId(methodSymbolJson),
4040
name: parseSymbolName(methodSymbolJson),
@@ -56,7 +56,6 @@ typedef ParsedFunctionInfo = ({
5656
ParsedFunctionInfo parseFunctionInfo(
5757
Json declarationFragments,
5858
ParsedSymbolgraph symbolgraph,
59-
[String? name]
6059
) {
6160
// `declarationFragments` describes each part of the function declaration,
6261
// things like the `func` keyword, brackets, spaces, etc. We only care about

pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_initializer_declaration.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ InitializerDeclaration parseInitializerDeclaration(
2424
if (info.async) {
2525
// TODO(https://github.com/dart-lang/native/issues/1778): Support async
2626
// initializerse.
27-
throw Exception(
28-
"Async initializers aren't supported yet, at "
27+
throw Exception("Async initializers aren't supported yet, at "
2928
'${initializerSymbolJson.path}');
3029
}
3130

pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_variable_declaration.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ bool _parseVariableAsync(Json json) {
9191
return async;
9292
}
9393

94-
9594
bool _parsePropertyHasSetter(Json propertySymbolJson) {
9695
final fragmentsJson = propertySymbolJson['declarationFragments'];
9796

0 commit comments

Comments
 (0)