[index] Factor out the dependency between the core indexing walker and SourceKit

The goal is to be able to move the core IndexSwiftASTWalker code out of
SourceKit, leaving only the serialization bits behind.

Mostly this replaces some direct uses of UIdent strings with explicit
enums, and then adds the translation code to produce those enums and to
convert them into UIdents in SourceKit.

rdar://problem/22348041
This commit is contained in:
Ben Langmuir
2016-04-13 08:56:59 -07:00
parent 3a59497836
commit bfa5a1f67f
5 changed files with 496 additions and 76 deletions

View File

@@ -14,6 +14,7 @@
#define LLVM_SOURCEKIT_LIB_SWIFTLANG_SWIFTLANGSUPPORT_H
#include "CodeCompletion.h"
#include "SwiftIndexing.h"
#include "SwiftInterfaceGenContext.h"
#include "SourceKit/Core/LangSupport.h"
#include "SourceKit/Support/Concurrency.h"
@@ -246,6 +247,9 @@ public:
static SourceKit::UIdent getUIDForSyntaxStructureElementKind(
swift::ide::SyntaxStructureElementKind Kind);
static SourceKit::UIdent getUIDForSymbol(SymbolKind kind,
SymbolSubKind subKind, bool isRef);
static bool printDisplayName(const swift::ValueDecl *D, llvm::raw_ostream &OS);
/// Generate a USR for a Decl, including the prefix.