Files
swift-mirror/include/swift/SymbolGraphGen/PathComponent.h
Nathan Hawes 6d940951ca [SourceKit][SymbolGraph] Add a 'ParentContexts' field the CursorInfo response
When the SymbolGraph json is requested via (key.retrieve_symbol_graph: 1) this adds
a new field in the response that lists all the parent contexts of the symbol under
the cursor with their symbol graph kind and name, and their USR:

key.parent_contexts: [
    {
      key.kind: "swift.struct",
      key.name: "Parent",
      key.usr: "s:27cursor_symbol_graph_parents6ParentV"
    },
    ...
  ]
}

Resolves rdar://problem/73904365
2021-02-10 16:35:57 +10:00

37 lines
1.1 KiB
C++

//===--- SymbolGraphPathComponent.h - Swift SymbolGraph Path Component ----===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
#ifndef SWIFT_SYMBOLGRAPHGEN_PATHCOMPONENT_H
#define SWIFT_SYMBOLGRAPHGEN_PATHCOMPONENT_H
#include "llvm/ADT/SmallString.h"
namespace swift {
class ValueDecl;
namespace symbolgraphgen {
/// Summary information for a node along a path through a symbol graph.
struct PathComponent {
/// The title of the corresponding symbol graph node.
SmallString<32> Title;
/// The kind of the corresponding symbol graph node.
StringRef Kind;
/// The swift decl associated with the corresponding symbol graph node.
const ValueDecl *VD;
};
} // end namespace symbolgraphgen
} // end namespace swift
#endif // SWIFT_SYMBOLGRAPHGEN_PATHCOMPONENT_H