|
21 | 21 | #include "swift/Basic/StringExtras.h" |
22 | 22 | #include "swift/Frontend/Frontend.h" |
23 | 23 | #include "swift/IDE/CodeCompletionResult.h" |
| 24 | +#include "swift/IDE/CodeCompletionResultSink.h" |
24 | 25 | #include "swift/IDE/CodeCompletionString.h" |
25 | 26 | #include "llvm/ADT/ArrayRef.h" |
26 | 27 | #include "llvm/ADT/StringMap.h" |
@@ -75,42 +76,6 @@ ArrayRef<T> copyArray(llvm::BumpPtrAllocator &Allocator, |
75 | 76 | return llvm::makeArrayRef(Buffer, Arr.size()); |
76 | 77 | } |
77 | 78 |
|
78 | | -struct CodeCompletionResultSink { |
79 | | - using AllocatorPtr = std::shared_ptr<llvm::BumpPtrAllocator>; |
80 | | - |
81 | | - /// The allocator used to allocate results "native" to this sink. |
82 | | - AllocatorPtr Allocator; |
83 | | - |
84 | | - /// Allocators that keep alive "foreign" results imported into this sink from |
85 | | - /// other sinks. |
86 | | - std::vector<AllocatorPtr> ForeignAllocators; |
87 | | - |
88 | | - /// Whether to annotate the results with XML. |
89 | | - bool annotateResult = false; |
90 | | - |
91 | | - /// Whether to emit object literals if desired. |
92 | | - bool includeObjectLiterals = true; |
93 | | - |
94 | | - /// Whether to emit type initializers in addition to type names in expression |
95 | | - /// position. |
96 | | - bool addInitsToTopLevel = false; |
97 | | - |
98 | | - /// Whether to perform "call pettern heuristics". |
99 | | - bool enableCallPatternHeuristics = false; |
100 | | - |
101 | | - /// Whether to include an item without any default arguments. |
102 | | - bool addCallWithNoDefaultArgs = true; |
103 | | - |
104 | | - std::vector<CodeCompletionResult *> Results; |
105 | | - |
106 | | - /// A single-element cache for module names stored in Allocator, keyed by a |
107 | | - /// clang::Module * or swift::ModuleDecl *. |
108 | | - std::pair<void *, NullTerminatedStringRef> LastModule; |
109 | | - |
110 | | - CodeCompletionResultSink() |
111 | | - : Allocator(std::make_shared<llvm::BumpPtrAllocator>()) {} |
112 | | -}; |
113 | | - |
114 | 79 | /// A utility for calculating the import depth of a given module. Direct imports |
115 | 80 | /// have depth 1, imports of those modules have depth 2, etc. |
116 | 81 | /// |
|
0 commit comments