Files
swift-mirror/test/SourceKit/CodeFormat/indent-trailing/trailing-pattern-binding-decl-comma.swift
Nathan Hawes e01c1a1579 [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.
2020-04-19 15:11:16 -07:00

5 lines
154 B
Swift

public let x = 10,
// RUN: %sourcekitd-test -req=format -line=2 -length=1 %s | %FileCheck --strict-whitespace %s
// CHECK: key.sourcetext: " "