Skip to content

Commit

Permalink
fix sementic highlight: parent_kind for Var
Browse files Browse the repository at this point in the history
If the parent_kind isn't found in the first loop (def.spell is never
valid), then take the parent_kind of var.anyDef().

Especially this should allow parent_kind of static variable to be forwarded to the client
and determine if this is a member/field or not
  • Loading branch information
FederAndInk committed Mar 19, 2020
1 parent 5a08ff9 commit b6491f5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/message_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,13 @@ void emitSemanticHighlight(DB *db, WorkingFile *wfile, QueryFile &file) {
break;
}
}
// this should always be true:
if (parent_kind == SymbolKind::Unknown) {
VarDef const *any_def = var.anyDef();
if (any_def) {
parent_kind = any_def->parent_kind;
}
}
break;
}
default:
Expand Down

0 comments on commit b6491f5

Please sign in to comment.