@@ -52,7 +52,8 @@ fileprivate func emitDiagnosticParts(
5252 case . replaceLeadingTrivia( let oldToken, let newTrivia) :
5353 replaceStartLoc = bridgedSourceLoc ( at: oldToken. position)
5454 replaceEndLoc = bridgedSourceLoc (
55- at: oldToken. positionAfterSkippingLeadingTrivia)
55+ at: oldToken. positionAfterSkippingLeadingTrivia
56+ )
5657 newText = newTrivia. description
5758
5859 case . replaceTrailingTrivia( let oldToken, let newTrivia) :
@@ -63,7 +64,8 @@ fileprivate func emitDiagnosticParts(
6364
6465 newText. withBridgedString { bridgedMessage in
6566 diag. fixItReplace (
66- start: replaceStartLoc, end: replaceEndLoc,
67+ start: replaceStartLoc,
68+ end: replaceEndLoc,
6769 replacement: bridgedMessage
6870 )
6971 }
@@ -117,11 +119,11 @@ func emitDiagnostic(
117119extension DiagnosticSeverity {
118120 var bridged : BridgedDiagnosticSeverity {
119121 switch self {
120- case . error: return . error
121- case . note: return . note
122- case . warning: return . warning
123- case . remark: return . remark
124- @unknown default : return . error
122+ case . error: return . error
123+ case . note: return . note
124+ case . warning: return . warning
125+ case . remark: return . remark
126+ @unknown default : return . error
125127 }
126128 }
127129}
@@ -186,7 +188,8 @@ extension SourceManager {
186188 case . replaceTrailingTrivia( let oldToken, let newTrivia) :
187189 replaceStartLoc = bridgedSourceLoc (
188190 for: oldToken,
189- at: oldToken. endPositionBeforeTrailingTrivia)
191+ at: oldToken. endPositionBeforeTrailingTrivia
192+ )
190193 replaceEndLoc = bridgedSourceLoc (
191194 for: oldToken,
192195 at: oldToken. endPosition
@@ -196,7 +199,8 @@ extension SourceManager {
196199
197200 newText. withBridgedString { bridgedMessage in
198201 diag. fixItReplace (
199- start: replaceStartLoc, end: replaceEndLoc,
202+ start: replaceStartLoc,
203+ end: replaceEndLoc,
200204 replacement: bridgedMessage
201205 )
202206 }
@@ -222,11 +226,11 @@ extension SourceManager {
222226 // Emit Fix-Its.
223227 for fixIt in diagnostic. fixIts {
224228 diagnoseSingle (
225- message: fixIt. message. message,
226- severity: . note,
227- node: diagnostic. node,
228- position: diagnostic. position,
229- fixItChanges: fixIt. changes
229+ message: fixIt. message. message,
230+ severity: . note,
231+ node: diagnostic. node,
232+ position: diagnostic. position,
233+ fixItChanges: fixIt. changes
230234 )
231235 }
232236
@@ -315,7 +319,8 @@ public func addQueuedSourceFile(
315319 // Determine the parent link, for a child buffer.
316320 let parent : ( GroupedDiagnostics . SourceFileID , AbsolutePosition ) ?
317321 if parentID >= 0 ,
318- let parentSourceFileID = queuedDiagnostics. pointee. sourceFileIDs [ parentID] {
322+ let parentSourceFileID = queuedDiagnostics. pointee. sourceFileIDs [ parentID]
323+ {
319324 parent = ( parentSourceFileID. pointee, AbsolutePosition ( utf8Offset: positionInParent) )
320325 } else {
321326 parent = nil
@@ -387,17 +392,20 @@ public func addQueuedDiagnostic(
387392 // Map the highlights.
388393 var highlights : [ Syntax ] = [ ]
389394 let highlightRanges = UnsafeBufferPointer < BridgedSourceLoc > (
390- start: highlightRangesPtr, count: numHighlightRanges * 2
395+ start: highlightRangesPtr,
396+ count: numHighlightRanges * 2
391397 )
392398 for index in 0 ..< numHighlightRanges {
393399 // Make sure both the start and the end land within this source file.
394400 guard let start = highlightRanges [ index * 2 ] . raw,
395- let end = highlightRanges [ index * 2 + 1 ] . raw else {
401+ let end = highlightRanges [ index * 2 + 1 ] . raw
402+ else {
396403 continue
397404 }
398405
399406 guard start >= sourceFileBaseAddress && start < sourceFileEndAddress,
400- end >= sourceFileBaseAddress && end <= sourceFileEndAddress else {
407+ end >= sourceFileBaseAddress && end <= sourceFileEndAddress
408+ else {
401409 continue
402410 }
403411
@@ -414,8 +422,9 @@ public func addQueuedDiagnostic(
414422 while true {
415423 // If this syntax matches our starting/ending positions, add the
416424 // highlight and we're done.
417- if highlightSyntax. positionAfterSkippingLeadingTrivia == startPos &&
418- highlightSyntax. endPositionBeforeTrailingTrivia == endPos {
425+ if highlightSyntax. positionAfterSkippingLeadingTrivia == startPos
426+ && highlightSyntax. endPositionBeforeTrailingTrivia == endPos
427+ {
419428 highlights. append ( highlightSyntax)
420429 break
421430 }
0 commit comments