Skip to content

Commit 190ee6e

Browse files
committed
[CodeCompletion] Replace includes of CodeCompletion.h by more specific ones
1 parent 7e04315 commit 190ee6e

25 files changed

+72
-47
lines changed

include/swift/IDE/CodeCompletion.h

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -13,28 +13,10 @@
1313
#ifndef SWIFT_IDE_CODECOMPLETION_H
1414
#define SWIFT_IDE_CODECOMPLETION_H
1515

16-
#include "CodeCompletionResultType.h"
17-
#include "swift/AST/Identifier.h"
18-
#include "swift/Basic/Debug.h"
19-
#include "swift/Basic/LLVM.h"
20-
#include "swift/Basic/OptionSet.h"
21-
#include "swift/Basic/StringExtras.h"
22-
#include "swift/Frontend/Frontend.h"
2316
#include "swift/IDE/CodeCompletionConsumer.h"
2417
#include "swift/IDE/CodeCompletionContext.h"
2518
#include "swift/IDE/CodeCompletionResult.h"
2619
#include "swift/IDE/CodeCompletionResultSink.h"
27-
#include "swift/IDE/CodeCompletionString.h"
28-
#include "swift/IDE/ImportDepth.h"
29-
#include "llvm/ADT/ArrayRef.h"
30-
#include "llvm/ADT/StringMap.h"
31-
#include "llvm/ADT/StringRef.h"
32-
#include "llvm/Support/Allocator.h"
33-
#include "llvm/Support/TrailingObjects.h"
34-
#include <functional>
35-
#include <memory>
36-
#include <string>
37-
#include <vector>
3820

3921
namespace swift {
4022
class CodeCompletionCallbacksFactory;
@@ -47,9 +29,6 @@ class SourceFile;
4729
namespace ide {
4830

4931
class CodeCompletionCache;
50-
class CodeCompletionContext;
51-
class CodeCompletionResultBuilder;
52-
struct CodeCompletionResultSink;
5332
struct RequestedCachedModule;
5433

5534
/// A routine to remove code completion tokens from code completion
@@ -79,12 +58,6 @@ ArrayRef<T> copyArray(llvm::BumpPtrAllocator &Allocator,
7958
return llvm::makeArrayRef(Buffer, Arr.size());
8059
}
8160

82-
struct SwiftCompletionInfo {
83-
swift::ASTContext *swiftASTContext = nullptr;
84-
const swift::CompilerInvocation *invocation = nullptr;
85-
CodeCompletionContext *completionContext = nullptr;
86-
};
87-
8861
void postProcessResults(MutableArrayRef<CodeCompletionResult *> results,
8962
CompletionKind Kind, DeclContext *DC,
9063
CodeCompletionResultSink *Sink);

include/swift/IDE/CodeCompletionCache.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
#include "swift/Basic/ThreadSafeRefCounted.h"
1717
#include "swift/IDE/CodeCompletion.h"
18+
#include "swift/IDE/CodeCompletionResult.h"
19+
#include "swift/IDE/CodeCompletionString.h"
1820
#include "llvm/ADT/Hashing.h"
1921
#include "llvm/ADT/IntrusiveRefCntPtr.h"
2022
#include "llvm/Support/Chrono.h"

include/swift/IDE/CodeCompletionResultSink.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
#ifndef SWIFT_IDE_CODECOMPLETIONRESULTSINK
1414
#define SWIFT_IDE_CODECOMPLETIONRESULTSINK
1515

16+
#include "swift/IDE/CodeCompletionResult.h"
17+
1618
namespace swift {
1719
namespace ide {
1820

include/swift/IDE/CodeCompletionStringPrinter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#define SWIFT_IDE_CODECOMPLETIONRESULTSTRINGPRINTER_H
1515

1616
#include "swift/AST/ASTPrinter.h"
17-
#include "swift/IDE/CodeCompletion.h"
17+
#include "swift/IDE/CodeCompletionString.h"
1818

1919
namespace swift {
2020
namespace ide {

include/swift/IDE/CompletionInstance.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,12 @@
1515

1616
#include "swift/Frontend/Frontend.h"
1717
#include "swift/IDE/CancellableResult.h"
18-
#include "swift/IDE/CodeCompletion.h"
18+
#include "swift/IDE/CodeCompletionContext.h"
19+
#include "swift/IDE/CodeCompletionResult.h"
20+
#include "swift/IDE/CodeCompletionResultSink.h"
1921
#include "swift/IDE/ConformingMethodList.h"
22+
#include "swift/IDE/ImportDepth.h"
23+
#include "swift/IDE/SwiftCompletionInfo.h"
2024
#include "swift/IDE/TypeContextInfo.h"
2125
#include "llvm/ADT/Hashing.h"
2226
#include "llvm/ADT/IntrusiveRefCntPtr.h"

include/swift/IDE/CompletionLookup.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,22 @@
1313
#ifndef SWIFT_IDE_COMPLETIONLOOKUP_H
1414
#define SWIFT_IDE_COMPLETIONLOOKUP_H
1515

16+
#include "swift/AST/ASTContext.h"
1617
#include "swift/AST/ASTPrinter.h"
1718
#include "swift/AST/ASTWalker.h"
1819
#include "swift/AST/Expr.h"
1920
#include "swift/AST/ImportCache.h"
2021
#include "swift/AST/Initializer.h"
2122
#include "swift/AST/NameLookup.h"
2223
#include "swift/AST/ProtocolConformance.h"
23-
#include "swift/IDE/CodeCompletion.h"
24+
#include "swift/ClangImporter/ClangImporter.h"
25+
#include "swift/IDE/CodeCompletionContext.h"
26+
#include "swift/IDE/CodeCompletionResult.h"
2427
#include "swift/IDE/CodeCompletionStringPrinter.h"
2528
#include "swift/IDE/PossibleParamInfo.h"
2629
#include "swift/Sema/IDETypeChecking.h"
2730
#include "swift/Strings.h"
31+
#include "swift/Syntax/SyntaxKind.h"
2832

2933
namespace swift {
3034
namespace ide {
@@ -544,7 +548,7 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
544548

545549
void collectPrecedenceGroups();
546550

547-
void getPrecedenceGroupCompletions(SyntaxKind SK);
551+
void getPrecedenceGroupCompletions(syntax::SyntaxKind SK);
548552

549553
void getPoundAvailablePlatformCompletions();
550554

include/swift/IDE/CompletionOverrideLookup.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414
#define SWIFT_IDE_COMPLETION_OVERRIDE_LOOKUP_H
1515

1616
#include "swift/AST/NameLookup.h"
17-
#include "swift/IDE/CodeCompletion.h"
17+
#include "swift/IDE/CodeCompletionResultSink.h"
1818
#include "swift/Sema/IDETypeChecking.h"
19+
#include "swift/Syntax/TokenKinds.h"
1920

2021
namespace swift {
2122
namespace ide {

include/swift/IDE/REPLCodeCompletion.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#define SWIFT_IDE_REPL_CODE_COMPLETION_H
1919

2020
#include "swift/Basic/LLVM.h"
21-
#include "swift/IDE/CodeCompletion.h"
2221
#include "swift/IDE/CodeCompletionCache.h"
2322
#include "swift/IDE/CodeCompletionConsumer.h"
2423
#include "swift/Parse/CodeCompletionCallbacks.h"
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
//===--- SwiftCompletionInfo.h --------------------------------------------===//
2+
//
3+
// This source file is part of the Swift.org open source project
4+
//
5+
// Copyright (c) 2014 - 2019 Apple Inc. and the Swift project authors
6+
// Licensed under Apache License v2.0 with Runtime Library Exception
7+
//
8+
// See https://swift.org/LICENSE.txt for license information
9+
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
10+
//
11+
//===----------------------------------------------------------------------===//
12+
13+
#ifndef SWIFT_IDE_SWIFTCOMPLETIONINFO_H
14+
#define SWIFT_IDE_SWIFTCOMPLETIONINFO_H
15+
16+
#include "swift/Frontend/Frontend.h"
17+
#include "swift/IDE/CodeCompletionContext.h"
18+
19+
namespace swift {
20+
namespace ide {
21+
22+
struct SwiftCompletionInfo {
23+
swift::ASTContext *swiftASTContext = nullptr;
24+
const swift::CompilerInvocation *invocation = nullptr;
25+
CodeCompletionContext *completionContext = nullptr;
26+
};
27+
28+
} // end namespace ide
29+
} // end namespace swift
30+
31+
#endif // SWIFT_IDE_SWIFTCOMPLETIONINFO_H

lib/IDE/CodeCompletionDiagnostics.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#ifndef SWIFT_IDE_CODECOMPLETIONDIAGNOSTICS_H
1414
#define SWIFT_IDE_CODECOMPLETIONDIAGNOSTICS_H
1515

16-
#include "swift/IDE/CodeCompletion.h"
16+
#include "swift/IDE/CodeCompletionResult.h"
1717

1818
namespace swift {
1919

0 commit comments

Comments
 (0)