10
10
//
11
11
// ===----------------------------------------------------------------------===//
12
12
13
- #include " swift/Basic/LLVM.h"
14
- #include " swift/AST/ASTPrinter.h"
15
13
#include " swift/IDE/CodeCompletionResultPrinter.h"
14
+ #include " swift/AST/ASTPrinter.h"
15
+ #include " swift/Basic/LLVM.h"
16
16
#include " swift/IDE/CodeCompletion.h"
17
17
#include " swift/Markup/XMLUtils.h"
18
18
#include " llvm/Support/raw_ostream.h"
@@ -259,8 +259,9 @@ void swift::ide::printCodeCompletionResultTypeNameAnnotated(const CodeCompletion
259
259
260
260
// / Provide the text for the call parameter, including constructing a typed
261
261
// / editor placeholder for it.
262
- static void constructTextForCallParam (
263
- ArrayRef<CodeCompletionString::Chunk> ParamGroup, raw_ostream &OS) {
262
+ static void
263
+ constructTextForCallParam (ArrayRef<CodeCompletionString::Chunk> ParamGroup,
264
+ raw_ostream &OS) {
264
265
assert (ParamGroup.front ().is (ChunkKind::CallParameterBegin));
265
266
266
267
for (; !ParamGroup.empty (); ParamGroup = ParamGroup.slice (1 )) {
@@ -339,7 +340,8 @@ static void constructTextForCallParam(
339
340
OS << " #>" ;
340
341
}
341
342
342
- void swift::ide::printCodeCompletionResultSourceText (const CodeCompletionResult &Result, llvm::raw_ostream &OS) {
343
+ void swift::ide::printCodeCompletionResultSourceText (
344
+ const CodeCompletionResult &Result, llvm::raw_ostream &OS) {
343
345
auto Chunks = Result.getCompletionString ()->getChunks ();
344
346
for (size_t i = 0 ; i < Chunks.size (); ++i) {
345
347
auto &C = Chunks[i];
@@ -353,14 +355,16 @@ void swift::ide::printCodeCompletionResultSourceText(const CodeCompletionResult
353
355
if (Chunks[i].endsPreviousNestedGroup (C.getNestingLevel ()))
354
356
break ;
355
357
}
356
- constructTextForCallParam (Chunks.slice (Start, i- Start), OS);
358
+ constructTextForCallParam (Chunks.slice (Start, i - Start), OS);
357
359
--i;
358
360
continue ;
359
361
}
360
362
if (C.is (ChunkKind::TypeAnnotationBegin)) {
361
363
// Skip type annotation structure.
362
364
auto level = C.getNestingLevel ();
363
- do { ++i; } while (i != Chunks.size () && !Chunks[i].endsPreviousNestedGroup (level));
365
+ do {
366
+ ++i;
367
+ } while (i != Chunks.size () && !Chunks[i].endsPreviousNestedGroup (level));
364
368
--i;
365
369
}
366
370
if (!C.isAnnotation () && C.hasText ()) {
@@ -369,7 +373,8 @@ void swift::ide::printCodeCompletionResultSourceText(const CodeCompletionResult
369
373
}
370
374
}
371
375
372
- void swift::ide::printCodeCompletionResultFilterName (const CodeCompletionResult &Result, llvm::raw_ostream &OS) {
376
+ void swift::ide::printCodeCompletionResultFilterName (
377
+ const CodeCompletionResult &Result, llvm::raw_ostream &OS) {
373
378
auto str = Result.getCompletionString ();
374
379
// FIXME: we need a more uniform way to handle operator completions.
375
380
if (str->getChunks ().size () == 1 && str->getChunks ()[0 ].is (ChunkKind::Dot)) {
@@ -414,7 +419,9 @@ void swift::ide::printCodeCompletionResultFilterName(const CodeCompletionResult
414
419
case ChunkKind::TypeAnnotationBegin: {
415
420
// Skip call parameter type or type annotation structure.
416
421
auto nestingLevel = C.getNestingLevel ();
417
- do { ++i; } while (i != e && !i->endsPreviousNestedGroup (nestingLevel));
422
+ do {
423
+ ++i;
424
+ } while (i != e && !i->endsPreviousNestedGroup (nestingLevel));
418
425
--i;
419
426
continue ;
420
427
}
@@ -430,5 +437,5 @@ void swift::ide::printCodeCompletionResultFilterName(const CodeCompletionResult
430
437
if (C.hasText () && shouldPrint)
431
438
OS << C.getText ();
432
439
}
433
- }
440
+ }
434
441
}
0 commit comments