Skip to content

Commit 95ae8a4

Browse files
committed
[SourceKit] Make completion-like helper functions static
1 parent 6b66d58 commit 95ae8a4

File tree

3 files changed

+9
-20
lines changed

3 files changed

+9
-20
lines changed

tools/SourceKit/lib/SwiftLang/SwiftCompletion.cpp

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -92,19 +92,6 @@ static UIdent getUIDForCodeCompletionKindToReport(CompletionKind kind) {
9292
}
9393
}
9494

95-
/// The result returned via the Callback of \c swiftCodeCompleteImpl.
96-
/// If \c HasResults is \c false, code completion did not fail, but did not
97-
/// produce any values either. All other fields of the struct should be ignored
98-
/// in that case.
99-
struct CodeCompleteImplResult {
100-
bool HasResults;
101-
swift::ASTContext *Context;
102-
const swift::CompilerInvocation *Invocation;
103-
swift::ide::CodeCompletionContext *CompletionContext;
104-
ArrayRef<RequestedCachedModule> RequestedModules;
105-
DeclContext *DC;
106-
};
107-
10895
static void swiftCodeCompleteImpl(
10996
SwiftLangSupport &Lang, llvm::MemoryBuffer *UnresolvedInputFile,
11097
unsigned Offset, ArrayRef<const char *> Args,
@@ -141,9 +128,10 @@ static void translateCodeCompletionOptions(OptionsDictionary &from,
141128
unsigned &resultOffset,
142129
unsigned &maxResults);
143130

144-
void deliverCodeCompleteResults(SourceKit::CodeCompletionConsumer &SKConsumer,
145-
const CodeCompletion::Options &CCOpts,
146-
CancellableResult<CodeCompleteResult> Result) {
131+
static void
132+
deliverCodeCompleteResults(SourceKit::CodeCompletionConsumer &SKConsumer,
133+
const CodeCompletion::Options &CCOpts,
134+
CancellableResult<CodeCompleteResult> Result) {
147135
switch (Result.getKind()) {
148136
case CancellableResultKind::Success: {
149137
auto kind = getUIDForCodeCompletionKindToReport(

tools/SourceKit/lib/SwiftLang/SwiftConformingMethodList.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ translateConformingMethodListOptions(OptionsDictionary &from,
3232
// ConformingMethodList doesn't receive any options at this point.
3333
}
3434

35-
void deliverResults(SourceKit::ConformingMethodListConsumer &SKConsumer,
36-
CancellableResult<ConformingMethodListResults> Result) {
35+
static void
36+
deliverResults(SourceKit::ConformingMethodListConsumer &SKConsumer,
37+
CancellableResult<ConformingMethodListResults> Result) {
3738
switch (Result.getKind()) {
3839
case CancellableResultKind::Success: {
3940
SKConsumer.setReusingASTContext(Result->DidReuseAST);

tools/SourceKit/lib/SwiftLang/SwiftTypeContextInfo.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ static void translateTypeContextInfoOptions(OptionsDictionary &from,
3030
// TypeContextInfo doesn't receive any options at this point.
3131
}
3232

33-
void deliverResults(SourceKit::TypeContextInfoConsumer &SKConsumer,
34-
CancellableResult<TypeContextInfoResult> Result) {
33+
static void deliverResults(SourceKit::TypeContextInfoConsumer &SKConsumer,
34+
CancellableResult<TypeContextInfoResult> Result) {
3535
switch (Result.getKind()) {
3636
case CancellableResultKind::Success: {
3737
SKConsumer.setReusingASTContext(Result->DidReuseAST);

0 commit comments

Comments
 (0)