mirror of
https://github.com/MaskRay/ccls.git
synced 2025-01-31 09:50:26 +00:00
Don't show code lens on include/header guards.
This commit is contained in:
parent
6ab8a27313
commit
b4000fa956
@ -2322,7 +2322,13 @@ bool QueryDbMainLoop(
|
||||
if (var->def.is_local && !config->codeLensOnLocalVariables)
|
||||
continue;
|
||||
|
||||
AddCodeLens("ref", "refs", &common, ref.loc.OffsetStartColumn(0), var->uses, var->def.definition_spelling, true /*force_display*/);
|
||||
bool force_display = true;
|
||||
// Do not show 0 refs on macro with no uses, as it is most likely a
|
||||
// header guard.
|
||||
if (var->def.is_macro)
|
||||
force_display = false;
|
||||
|
||||
AddCodeLens("ref", "refs", &common, ref.loc.OffsetStartColumn(0), var->uses, var->def.definition_spelling, force_display);
|
||||
break;
|
||||
}
|
||||
case SymbolKind::File:
|
||||
|
@ -64,6 +64,7 @@ optional<QueryVar::DefUpdate> ToQuery(const IdMap& id_map, const IndexVar::Def&
|
||||
result.variable_type = id_map.ToQuery(var.variable_type);
|
||||
result.declaring_type = id_map.ToQuery(var.declaring_type);
|
||||
result.is_local = var.is_local;
|
||||
result.is_macro = var.is_macro;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user