MCPcopy Create free account
hub / github.com/MaskRay/ccls / findFile

Method findFile

src/message_handler.cc:247–262  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

245}
246
247QueryFile *MessageHandler::findFile(const std::string &path, int *out_file_id) {
248 QueryFile *ret = nullptr;
249 auto it = db->name2file_id.find(lowerPathIfInsensitive(path));
250 if (it != db->name2file_id.end()) {
251 QueryFile &file = db->files[it->second];
252 if (file.def) {
253 ret = &file;
254 if (out_file_id)
255 *out_file_id = it->second;
256 return ret;
257 }
258 }
259 if (out_file_id)
260 *out_file_id = -1;
261 return ret;
262}
263
264std::pair<QueryFile *, WorkingFile *> MessageHandler::findOrFail(const std::string &path, ReplyOnce &reply,
265 int *out_file_id, bool allow_unopened) {

Callers

nothing calls this directly

Calls 2

lowerPathIfInsensitiveFunction · 0.85
endMethod · 0.80

Tested by

no test coverage detected