mirror of
https://github.com/MaskRay/ccls.git
synced 2025-01-31 18:00: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)
|
if (var->def.is_local && !config->codeLensOnLocalVariables)
|
||||||
continue;
|
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;
|
break;
|
||||||
}
|
}
|
||||||
case SymbolKind::File:
|
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.variable_type = id_map.ToQuery(var.variable_type);
|
||||||
result.declaring_type = id_map.ToQuery(var.declaring_type);
|
result.declaring_type = id_map.ToQuery(var.declaring_type);
|
||||||
result.is_local = var.is_local;
|
result.is_local = var.is_local;
|
||||||
|
result.is_macro = var.is_macro;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user