Remove some TODOs, reduce output sleep from 10ms to 2ms

This commit is contained in:
Jacob Dufault 2017-04-16 16:57:31 -07:00
parent 8e18e7a8ad
commit c6dead848e
2 changed files with 47 additions and 50 deletions

View File

@ -1749,6 +1749,52 @@ void LanguageServerStdinLoop() {
} }
} }
void LanguageServerMainLoop() { void LanguageServerMainLoop() {
IpcManager* ipc = IpcManager::instance(); IpcManager* ipc = IpcManager::instance();
@ -1778,53 +1824,6 @@ void LanguageServerMainLoop() {
} }
} }
bool IsQueryDbProcessRunning() { bool IsQueryDbProcessRunning() {
if (!kUseMultipleProcesses) if (!kUseMultipleProcesses)
return false; return false;
@ -1875,7 +1874,7 @@ void LanguageServerMain() {
new std::thread(&LanguageServerStdinLoop); new std::thread(&LanguageServerStdinLoop);
while (true) { while (true) {
LanguageServerMainLoop(); LanguageServerMainLoop();
std::this_thread::sleep_for(std::chrono::milliseconds(10)); std::this_thread::sleep_for(std::chrono::milliseconds(2));
} }
} }

View File

@ -724,13 +724,11 @@ bool AreEqualLocations(CXIdxLoc loc, CXCursor cursor) {
void indexDeclaration(CXClientData client_data, const CXIdxDeclInfo* decl) { void indexDeclaration(CXClientData client_data, const CXIdxDeclInfo* decl) {
// TODO: allow user to configure if they want STL index.
if (!kIndexStdDeclarations && clang_Location_isInSystemHeader(clang_indexLoc_getCXSourceLocation(decl->loc))) if (!kIndexStdDeclarations && clang_Location_isInSystemHeader(clang_indexLoc_getCXSourceLocation(decl->loc)))
return; return;
assert(AreEqualLocations(decl->loc, decl->cursor)); assert(AreEqualLocations(decl->loc, decl->cursor));
// TODO: Use clang_getFileUniqueID
CXFile file; CXFile file;
clang_getSpellingLocation(clang_indexLoc_getCXSourceLocation(decl->loc), &file, nullptr, nullptr, nullptr); clang_getSpellingLocation(clang_indexLoc_getCXSourceLocation(decl->loc), &file, nullptr, nullptr, nullptr);
IndexParam* param = static_cast<IndexParam*>(client_data); IndexParam* param = static_cast<IndexParam*>(client_data);