Permalink
Browse files

Output #include/break/continue/return symbol targets for JSON and Elisp

The targets of #include/break/continue/return symbols do not have a
valid CXCursorKind,  and so Symbol::isNull() returns true for them. But
these targets do have a valid location.

This change enables outputting the locations of these targets when using
--symbol-info-include-targets --json/--elisp.
  • Loading branch information...
jomiller authored and cslux committed Jan 5, 2019
1 parent 1058d5f commit 5f887b6f58be6150bd51f240ad4a7433fa552676
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/Symbol.cpp
@@ -269,8 +269,10 @@ Value Symbol::toValue(const std::shared_ptr<Project> &project,
(*val)[ctxKey] = loc.context(locationToStringFlags);
}
};
if (!symbol.isNull()) {
if (!symbol.location.isNull()) {
formatLocation(symbol.location, "location", "context");
}
if (!symbol.isNull()) {
if (symbol.argumentUsage.index != String::npos) {
formatLocation(symbol.argumentUsage.invocation, "invocation", "invocationContext", 0, "invocationcontext");
if (filterPiece("invokedfunction"))

0 comments on commit 5f887b6

Please sign in to comment.