mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Enhance fixItRemove() to be a bit more careful about what whitespace it leaves around: if the thing it is removing has leading and trailing whitespace already, this nukes an extra space to avoid leaving double spaces or incorrectly indented results. This includes an extra fix for looking off the start of a buffer, which extractText doesn't and can't handle. This fixes <rdar://problem/21045509> Fixit deletes 'let' from non-binding 'if case let' statements, but leaves an extra space Swift SVN r29449
23 lines
823 B
Swift
23 lines
823 B
Swift
// RUN: %target-parse-verify-swift -parse-as-library
|
|
|
|
//===--- Recovery for extra braces at top level.
|
|
//===--- Keep this test the first one in the file.
|
|
|
|
// Check that we handle multiple consecutive right braces.
|
|
} // expected-error{{extraneous '}' at top level}} {{1-3=}}
|
|
} // expected-error{{extraneous '}' at top level}} {{1-3=}}
|
|
|
|
func foo() {}
|
|
// Check that we handle multiple consecutive right braces.
|
|
} // expected-error{{extraneous '}' at top level}} {{1-3=}}
|
|
} // expected-error{{extraneous '}' at top level}} {{1-3=}}
|
|
func bar() {}
|
|
|
|
//===--- Recovery for extra braces at top level.
|
|
//===--- Keep this test the last one in the file.
|
|
|
|
// Check that we handle multiple consecutive right braces.
|
|
} // expected-error{{extraneous '}' at top level}} {{1-3=}}
|
|
} // expected-error{{extraneous '}' at top level}} {{1-3=}}
|
|
|