mirror of
https://github.com/MaskRay/ccls.git
synced 2025-02-16 13:48:04 +00:00
Add role to lsLocationEx
This commit is contained in:
parent
1469723c3c
commit
8a427dfa9e
@ -169,8 +169,10 @@ MAKE_REFLECT_STRUCT(lsLocation, uri, range);
|
|||||||
// cquery extension
|
// cquery extension
|
||||||
struct lsLocationEx : lsLocation {
|
struct lsLocationEx : lsLocation {
|
||||||
optional<std::string_view> containerName;
|
optional<std::string_view> containerName;
|
||||||
|
// Avoid circular dependency on symbol.h
|
||||||
|
optional<uint16_t> role;
|
||||||
};
|
};
|
||||||
MAKE_REFLECT_STRUCT(lsLocationEx, uri, range, containerName);
|
MAKE_REFLECT_STRUCT(lsLocationEx, uri, range, containerName, role);
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct lsCommand {
|
struct lsCommand {
|
||||||
|
@ -275,6 +275,7 @@ optional<lsLocationEx> GetLsLocationEx(QueryDatabase* db,
|
|||||||
lsLocationEx ret;
|
lsLocationEx ret;
|
||||||
ret.lsLocation::operator=(*ls_loc);
|
ret.lsLocation::operator=(*ls_loc);
|
||||||
if (container) {
|
if (container) {
|
||||||
|
ret.role = uint16_t(use.role);
|
||||||
EachEntityDef(db, use, [&](const auto& def) {
|
EachEntityDef(db, use, [&](const auto& def) {
|
||||||
ret.containerName = std::string_view(def.detailed_name);
|
ret.containerName = std::string_view(def.detailed_name);
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user