mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-25 09:05:10 +00:00
Format
This commit is contained in:
parent
12bfabf9c2
commit
2751f51956
@ -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);
|
||||
@ -35,7 +35,7 @@ optional<lsDiagnostic> BuildAndDisposeDiagnostic(CXDiagnostic diagnostic,
|
||||
}
|
||||
|
||||
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++) {
|
||||
CXFile file0, file1;
|
||||
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,
|
||||
// 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,12 +1716,14 @@ void ClangSanityCheck() {
|
||||
void* reserved) -> CXIdxClientFile {
|
||||
return nullptr;
|
||||
};
|
||||
callback.ppIncludedFile = [](
|
||||
CXClientData client_data,
|
||||
const CXIdxIncludedFileInfo* file) -> CXIdxClientFile { return nullptr; };
|
||||
callback.importedASTFile = [](
|
||||
CXClientData client_data,
|
||||
const CXIdxImportedASTFileInfo*) -> CXIdxClientASTFile {
|
||||
callback.ppIncludedFile =
|
||||
[](CXClientData client_data,
|
||||
const CXIdxIncludedFileInfo* file) -> CXIdxClientFile {
|
||||
return nullptr;
|
||||
};
|
||||
callback.importedASTFile =
|
||||
[](CXClientData client_data,
|
||||
const CXIdxImportedASTFileInfo*) -> CXIdxClientASTFile {
|
||||
return nullptr;
|
||||
};
|
||||
callback.startedTranslationUnit = [](CXClientData client_data,
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -617,8 +617,8 @@ IndexUpdate::IndexUpdate(const IdMap& previous_id_map,
|
||||
#undef PROCESS_UPDATE_DIFF
|
||||
}
|
||||
|
||||
// This function runs on an indexer thread.
|
||||
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_MERGE(name) AddMergeableRange(&name, update.name);
|
||||
|
Loading…
Reference in New Issue
Block a user