mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[SourceKit/CodeFormat] Get 'trailing' indentation to work in more places and fix a bug where multi-line string indentation was modified.
E.g. if/guard condition patterns are column-aligned, but hitting enter after the ',' below wasn't column-aligning the next empty line: guard let x = Optional(42), // No indentation added here after enter Also the isTargetContext() check takes a start and end token location, but wasn't accounting for the end location pointing a multiline string, so we weren't walking into such nodes. This meant we didn't realise the target location was within a multiline string in some cases, and we ended up interfering with whitespace in its content.
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
struct Foo<T: Equatable,
|
||||
|
||||
// RUN: %sourcekitd-test -req=format -line=2 -length=1 %s | %FileCheck --strict-whitespace %s
|
||||
// CHECK: key.sourcetext: " "
|
||||
Reference in New Issue
Block a user