[SourceKit] Add fully annotated declaration to DocInfo requests

Also expose the printing function as a SwiftLangSupport static method.
Ideally we could move this into libIDE, but it currently depends on the
UIdent visitor to get decl-specific tag names and it's not obvious how
we should hoist/abstract that out in a nice way.

rdar://problem/24292226
rdar://problem/24292304
This commit is contained in:
Ben Langmuir
2016-02-25 16:51:17 -08:00
parent be47b433e5
commit 1a83912c4e
8 changed files with 334 additions and 105 deletions

View File

@@ -263,6 +263,17 @@ public:
swift::AccessorKind AccKind,
llvm::raw_ostream &OS);
/// Annotates a declaration with XML tags that describe the key substructure
/// of the declaration for CursorInfo/DocInfo.
///
/// Prints declarations with decl- and type-specific tags derived from the
/// UIDs used for decl/refs.
///
/// FIXME: This move to libIDE, but currently depends on the UIdentVisitor.
static void printFullyAnnotatedDeclaration(const swift::ValueDecl *VD,
swift::Type BaseTy,
llvm::raw_ostream &OS);
/// Tries to resolve the path to the real file-system path. If it fails it
/// returns the original path;
static std::string resolvePathSymlinks(StringRef FilePath);