#pragma once #include "query_utils.h" #include "query.h" #include "working_files.h" #include Maybe GetDefinitionSpellingOfSymbol(QueryDatabase* db, QueryFuncId id); Maybe GetDefinitionSpellingOfSymbol(QueryDatabase* db, SymbolRef sym); Maybe GetDefinitionExtentOfSymbol(QueryDatabase* db, SymbolRef sym); Maybe GetDeclarationFileForSymbol(QueryDatabase* db, SymbolRef sym); std::vector ToUses(QueryDatabase* db, const std::vector& ids); std::vector ToUses(QueryDatabase* db, const std::vector& ids); std::vector ToUses(QueryDatabase* db, const std::vector& ids); std::vector GetUsesOfSymbol(QueryDatabase* db, SymbolRef sym, bool include_decl); std::vector GetDeclarationsOfSymbolForGotoDefinition( QueryDatabase* db, SymbolRef sym); bool HasCallersOnSelfOrBaseOrDerived(QueryDatabase* db, QueryFunc& root); std::vector GetCallersForAllBaseFunctions(QueryDatabase* db, QueryFunc& root); std::vector GetCallersForAllDerivedFunctions(QueryDatabase* db, QueryFunc& root); optional GetLsPosition(WorkingFile* working_file, const Position& position); optional GetLsRange(WorkingFile* working_file, const Range& location); lsDocumentUri GetLsDocumentUri(QueryDatabase* db, QueryFileId file_id, std::string* path); lsDocumentUri GetLsDocumentUri(QueryDatabase* db, QueryFileId file_id); optional GetLsLocation(QueryDatabase* db, WorkingFiles* working_files, Reference location); optional GetLsLocationEx(QueryDatabase* db, WorkingFiles* working_files, Use use, bool extension); std::vector GetLsLocations(QueryDatabase* db, WorkingFiles* working_files, const std::vector& refs); // Returns a symbol. The symbol will have *NOT* have a location assigned. optional GetSymbolInfo(QueryDatabase* db, WorkingFiles* working_files, SymbolRef sym, bool use_short_name); std::vector FindSymbolsAtLocation(WorkingFile* working_file, QueryFile* file, lsPosition position); void EmitDiagnostics(WorkingFiles* working_files, std::string path, std::vector diagnostics); template void EachWithGen(std::vector& collection, Id x, Fn fn) { Q& obj = collection[x.id]; // FIXME Deprecate optional def // if (obj.gen == x.gen && obj.def) if (obj.def) fn(obj); } template void EachWithGen(std::vector& collection, std::vector>& ids, Fn fn) { for (Id x : ids) { Q& obj = collection[x.id]; if (obj.def) // FIXME Deprecate optional def fn(obj); } }