mirror of
https://github.com/MaskRay/ccls.git
synced 2025-01-19 12:05:50 +00:00
remove UsrRef
This commit is contained in:
parent
6720a886e3
commit
5ebf4551b1
@ -3,7 +3,7 @@
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
class IndexedFile;
|
||||
struct IndexedFile;
|
||||
|
||||
std::string GetCachedFileName(std::string source_file);
|
||||
|
||||
|
@ -351,23 +351,6 @@ void AddCodeLens(
|
||||
result->push_back(code_lens);
|
||||
}
|
||||
|
||||
// TODO: clean these overrides up...
|
||||
void AddCodeLens(
|
||||
QueryableDatabase* db,
|
||||
std::vector<TCodeLens>* result,
|
||||
QueryableLocation loc,
|
||||
const std::vector<UsrRef>& uses,
|
||||
bool exclude_loc,
|
||||
bool only_interesting,
|
||||
const char* singular,
|
||||
const char* plural) {
|
||||
std::vector<QueryableLocation> uses0;
|
||||
uses0.reserve(uses.size());
|
||||
for (const UsrRef& use : uses)
|
||||
uses0.push_back(use.loc);
|
||||
AddCodeLens(db, result, loc, uses0, exclude_loc, only_interesting, singular, plural);
|
||||
}
|
||||
|
||||
void AddCodeLens(
|
||||
QueryableDatabase* db,
|
||||
std::vector<TCodeLens>* result,
|
||||
|
15
src/query.h
15
src/query.h
@ -103,21 +103,6 @@ struct QueryFuncRef {
|
||||
}
|
||||
};
|
||||
|
||||
struct UsrRef {
|
||||
Usr usr;
|
||||
QueryableLocation loc;
|
||||
|
||||
UsrRef(Usr usr, QueryableLocation loc) : usr(usr), loc(loc) {}
|
||||
|
||||
bool operator==(const UsrRef& other) const {
|
||||
return usr == other.usr && loc.range.start == other.loc.range.start;
|
||||
}
|
||||
bool operator!=(const UsrRef& other) const { return !(*this == other); }
|
||||
bool operator<(const UsrRef& other) const {
|
||||
return usr < other.usr && loc.range.start < other.loc.range.start;
|
||||
}
|
||||
};
|
||||
|
||||
// There are two sources of reindex updates: the (single) definition of a
|
||||
// symbol has changed, or one of many users of the symbol has changed.
|
||||
//
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <unordered_map>>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
// Returns true if |value| starts/ends with |start| or |ending|.
|
||||
|
Loading…
Reference in New Issue
Block a user