[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
This commit is contained in:
Nathan Hawes
2021-02-10 14:36:30 +10:00
parent e2bac38348
commit 6d940951ca
11 changed files with 356 additions and 71 deletions

View File

@@ -160,6 +160,7 @@ UID_KEYS = [
KEY('RetrieveRefactorActions', 'key.retrieve_refactor_actions'),
KEY('SymbolGraph', 'key.symbol_graph'),
KEY('RetrieveSymbolGraph', 'key.retrieve_symbol_graph'),
KEY('ParentContexts', 'key.parent_contexts'),
KEY('ActionUID', 'key.actionuid'),
KEY('ActionUnavailableReason', 'key.actionunavailablereason'),
KEY('CompileID', 'key.compileid'),