Skip to content

Commit ad43c56

Browse files
committed
Temporary fix: make auto-indentation by Source not break the whole file on closing withScopedMemoryAllocator block
1 parent 219fd62 commit ad43c56

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

crates/kotlin/src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1198,7 +1198,10 @@ impl InterfaceGenerator<'_> {
11981198
} = f;
11991199

12001200
self.src.push_str(&String::from(src));
1201-
self.src.push_str("}\n");
1201+
// because the withScopedMemoryAllocator opening line doesn't perfectly end with '{',
1202+
// the auto-indentation doesn't work on that. So also make the closing '}' not perfect,
1203+
// so that the indents don't get messed up globally, only locally.
1204+
self.src.push_str("/* free memory allocator */}\n");
12021205
self.src.push_str("// </editor-fold>\n");
12031206
self.src.push_str("}\n");
12041207
if let FunctionKind::Constructor(_) = func.kind {

0 commit comments

Comments
 (0)