We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 34dce93 commit 2ed1770Copy full SHA for 2ed1770
lib/IDE/Formatting.cpp
@@ -477,7 +477,7 @@ class FormatWalker : public SourceEntityWalker {
477
return;
478
SourceLoc PrevLoc;
479
auto FindAlignLoc = [&](SourceLoc Loc) {
480
- if (PrevLoc.isValid() &&
+ if (PrevLoc.isValid() && Loc.isValid() &&
481
SM.getLineNumber(PrevLoc) == SM.getLineNumber(Loc))
482
return PrevLoc;
483
return PrevLoc = Loc;
test/SourceKit/CodeFormat/indent-crashes.swift
@@ -0,0 +1,10 @@
1
+subscript (__PLACEHOLDER_0__) -> __PLACEHOLDER_1__ {
2
+ get {
3
+ __PLACEHOLDER_2__
4
+ }
5
+ set(__PLACEHOLDER_3__) {
6
+ __PLACEHOLDER_4__
7
8
+}
9
+
10
+// RUN: %sourcekitd-test -req=format -line=1 -length=1 %s >%t.response
0 commit comments