mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-29 02:51:57 +00:00
Format
This commit is contained in:
parent
12bfabf9c2
commit
2751f51956
@ -26,8 +26,8 @@ optional<lsDiagnostic> BuildAndDisposeDiagnostic(CXDiagnostic diagnostic,
|
|||||||
// Get diagnostic location.
|
// Get diagnostic location.
|
||||||
CXFile file;
|
CXFile file;
|
||||||
unsigned start_line, start_column;
|
unsigned start_line, start_column;
|
||||||
clang_getSpellingLocation(clang_getDiagnosticLocation(diagnostic),
|
clang_getSpellingLocation(clang_getDiagnosticLocation(diagnostic), &file,
|
||||||
&file, &start_line, &start_column, nullptr);
|
&start_line, &start_column, nullptr);
|
||||||
|
|
||||||
if (file && path != FileName(file)) {
|
if (file && path != FileName(file)) {
|
||||||
clang_disposeDiagnostic(diagnostic);
|
clang_disposeDiagnostic(diagnostic);
|
||||||
@ -35,7 +35,7 @@ optional<lsDiagnostic> BuildAndDisposeDiagnostic(CXDiagnostic diagnostic,
|
|||||||
}
|
}
|
||||||
|
|
||||||
unsigned end_line = start_line, end_column = start_column,
|
unsigned end_line = start_line, end_column = start_column,
|
||||||
num_ranges = clang_getDiagnosticNumRanges(diagnostic);
|
num_ranges = clang_getDiagnosticNumRanges(diagnostic);
|
||||||
for (unsigned i = 0; i < num_ranges; i++) {
|
for (unsigned i = 0; i < num_ranges; i++) {
|
||||||
CXFile file0, file1;
|
CXFile file0, file1;
|
||||||
unsigned line0, column0, line1, column1;
|
unsigned line0, column0, line1, column1;
|
||||||
|
@ -1396,8 +1396,8 @@ void OnIndexReference(CXClientData client_data, const CXIdxEntityRefInfo* ref) {
|
|||||||
// But there `decl` is of type CXIdxDeclInfo and has more information,
|
// But there `decl` is of type CXIdxDeclInfo and has more information,
|
||||||
// thus not easy to reuse the code.
|
// thus not easy to reuse the code.
|
||||||
var->def.short_name = referenced.get_spelling();
|
var->def.short_name = referenced.get_spelling();
|
||||||
std::string type_name =
|
std::string type_name = ToString(
|
||||||
ToString(clang_getTypeSpelling(clang_getCursorType(referenced.cx_cursor)));
|
clang_getTypeSpelling(clang_getCursorType(referenced.cx_cursor)));
|
||||||
var->def.detailed_name = type_name + " " + var->def.short_name;
|
var->def.detailed_name = type_name + " " + var->def.short_name;
|
||||||
var->def.is_local = false;
|
var->def.is_local = false;
|
||||||
var->def.definition_spelling = ResolveSpelling(referenced.cx_cursor);
|
var->def.definition_spelling = ResolveSpelling(referenced.cx_cursor);
|
||||||
@ -1716,12 +1716,14 @@ void ClangSanityCheck() {
|
|||||||
void* reserved) -> CXIdxClientFile {
|
void* reserved) -> CXIdxClientFile {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
};
|
};
|
||||||
callback.ppIncludedFile = [](
|
callback.ppIncludedFile =
|
||||||
CXClientData client_data,
|
[](CXClientData client_data,
|
||||||
const CXIdxIncludedFileInfo* file) -> CXIdxClientFile { return nullptr; };
|
const CXIdxIncludedFileInfo* file) -> CXIdxClientFile {
|
||||||
callback.importedASTFile = [](
|
return nullptr;
|
||||||
CXClientData client_data,
|
};
|
||||||
const CXIdxImportedASTFileInfo*) -> CXIdxClientASTFile {
|
callback.importedASTFile =
|
||||||
|
[](CXClientData client_data,
|
||||||
|
const CXIdxImportedASTFileInfo*) -> CXIdxClientASTFile {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
};
|
};
|
||||||
callback.startedTranslationUnit = [](CXClientData client_data,
|
callback.startedTranslationUnit = [](CXClientData client_data,
|
||||||
|
@ -2,8 +2,7 @@
|
|||||||
#include "query_utils.h"
|
#include "query_utils.h"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
void PushBack(std::vector<lsLocation>* result,
|
void PushBack(std::vector<lsLocation>* result, optional<lsLocation> location) {
|
||||||
optional<lsLocation> location) {
|
|
||||||
if (location)
|
if (location)
|
||||||
result->push_back(*location);
|
result->push_back(*location);
|
||||||
}
|
}
|
||||||
|
@ -617,8 +617,8 @@ IndexUpdate::IndexUpdate(const IdMap& previous_id_map,
|
|||||||
#undef PROCESS_UPDATE_DIFF
|
#undef PROCESS_UPDATE_DIFF
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This function runs on an indexer thread.
|
||||||
void IndexUpdate::Merge(const IndexUpdate& update) {
|
void IndexUpdate::Merge(const IndexUpdate& update) {
|
||||||
// This function runs on an indexer thread.
|
|
||||||
|
|
||||||
#define INDEX_UPDATE_APPEND(name) AddRange(&name, update.name);
|
#define INDEX_UPDATE_APPEND(name) AddRange(&name, update.name);
|
||||||
#define INDEX_UPDATE_MERGE(name) AddMergeableRange(&name, update.name);
|
#define INDEX_UPDATE_MERGE(name) AddMergeableRange(&name, update.name);
|
||||||
|
Loading…
Reference in New Issue
Block a user