This commit is contained in:
Jacob Dufault 2017-12-11 21:21:03 -08:00
parent 12bfabf9c2
commit 2751f51956
4 changed files with 15 additions and 14 deletions

View File

@ -26,8 +26,8 @@ optional<lsDiagnostic> BuildAndDisposeDiagnostic(CXDiagnostic diagnostic,
// Get diagnostic location.
CXFile file;
unsigned start_line, start_column;
clang_getSpellingLocation(clang_getDiagnosticLocation(diagnostic),
&file, &start_line, &start_column, nullptr);
clang_getSpellingLocation(clang_getDiagnosticLocation(diagnostic), &file,
&start_line, &start_column, nullptr);
if (file && path != FileName(file)) {
clang_disposeDiagnostic(diagnostic);

View File

@ -1396,8 +1396,8 @@ void OnIndexReference(CXClientData client_data, const CXIdxEntityRefInfo* ref) {
// But there `decl` is of type CXIdxDeclInfo and has more information,
// thus not easy to reuse the code.
var->def.short_name = referenced.get_spelling();
std::string type_name =
ToString(clang_getTypeSpelling(clang_getCursorType(referenced.cx_cursor)));
std::string type_name = ToString(
clang_getTypeSpelling(clang_getCursorType(referenced.cx_cursor)));
var->def.detailed_name = type_name + " " + var->def.short_name;
var->def.is_local = false;
var->def.definition_spelling = ResolveSpelling(referenced.cx_cursor);
@ -1716,11 +1716,13 @@ void ClangSanityCheck() {
void* reserved) -> CXIdxClientFile {
return nullptr;
};
callback.ppIncludedFile = [](
CXClientData client_data,
const CXIdxIncludedFileInfo* file) -> CXIdxClientFile { return nullptr; };
callback.importedASTFile = [](
CXClientData client_data,
callback.ppIncludedFile =
[](CXClientData client_data,
const CXIdxIncludedFileInfo* file) -> CXIdxClientFile {
return nullptr;
};
callback.importedASTFile =
[](CXClientData client_data,
const CXIdxImportedASTFileInfo*) -> CXIdxClientASTFile {
return nullptr;
};

View File

@ -2,8 +2,7 @@
#include "query_utils.h"
namespace {
void PushBack(std::vector<lsLocation>* result,
optional<lsLocation> location) {
void PushBack(std::vector<lsLocation>* result, optional<lsLocation> location) {
if (location)
result->push_back(*location);
}

View File

@ -617,8 +617,8 @@ IndexUpdate::IndexUpdate(const IdMap& previous_id_map,
#undef PROCESS_UPDATE_DIFF
}
void IndexUpdate::Merge(const IndexUpdate& update) {
// This function runs on an indexer thread.
void IndexUpdate::Merge(const IndexUpdate& update) {
#define INDEX_UPDATE_APPEND(name) AddRange(&name, update.name);
#define INDEX_UPDATE_MERGE(name) AddMergeableRange(&name, update.name);