mirror of
https://github.com/MaskRay/ccls.git
synced 2025-01-19 20:12:33 +00:00
Better goto-definition on constructors.
This commit is contained in:
parent
2f691e5365
commit
d1fe600fcf
@ -704,6 +704,14 @@ std::vector<SymbolRef> FindSymbolsAtLocation(WorkingFile* working_file, QueryFil
|
|||||||
symbols.push_back(ref);
|
symbols.push_back(ref);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Order function symbols first. This makes goto definition work better when
|
||||||
|
// used on a constructor.
|
||||||
|
std::sort(symbols.begin(), symbols.end(), [](const SymbolRef& a, const SymbolRef& b) {
|
||||||
|
if (a.idx.kind != b.idx.kind && a.idx.kind == SymbolKind::Func)
|
||||||
|
return 1;
|
||||||
|
return 0;
|
||||||
|
});
|
||||||
|
|
||||||
return symbols;
|
return symbols;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user