Format all code in src/

This commit is contained in:
Jacob Dufault 2017-10-31 12:49:19 -07:00
parent 5f04e390a2
commit 7734943620
12 changed files with 8 additions and 383 deletions

View File

@ -7,7 +7,6 @@
#include <optional.h>
#include <vector>
using namespace std::experimental;
optional<lsDiagnostic> BuildAndDisposeDiagnostic(CXDiagnostic diagnostic,

View File

@ -9,7 +9,6 @@
#include <unordered_map>
#include <unordered_set>
struct IndexFile;
// Needed for unordered_map usage below.

View File

@ -264,39 +264,6 @@ std::string GetDocumentContentInRange(CXTranslationUnit cx_tu,
} // namespace
// static
int IndexFile::kCurrentVersion = 4;
@ -903,57 +870,6 @@ clang::VisiterResult VisitMacroDefinitionAndExpansions(clang::Cursor cursor,
return clang::VisiterResult::Continue;
}
void indexDeclaration(CXClientData client_data, const CXIdxDeclInfo* decl) {
if (!kIndexStdDeclarations &&
clang_Location_isInSystemHeader(
@ -1339,53 +1255,6 @@ bool IsFunctionCallContext(CXCursorKind kind) {
return false;
}
void indexEntityReference(CXClientData client_data,
const CXIdxEntityRefInfo* ref) {
// Don't index references from or to system headers.
@ -1562,35 +1431,6 @@ void indexEntityReference(CXClientData client_data,
}
}
FileContents::FileContents(const std::string& path, const std::string& content)
: path(path), content(content) {}

View File

@ -32,41 +32,6 @@ struct lsRequestId {
void Reflect(Writer& visitor, lsRequestId& value);
void Reflect(Reader& visitor, lsRequestId& id);
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
@ -146,55 +111,6 @@ struct lsResponseError {
void Write(Writer& visitor);
};
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
@ -577,96 +493,6 @@ MAKE_REFLECT_STRUCT(lsDiagnostic, range, severity, source, message);
// TODO: DocumentFilter
// TODO: DocumentSelector
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
@ -1092,42 +918,11 @@ struct Ipc_InitializedNotification
};
MAKE_REFLECT_STRUCT(Ipc_InitializedNotification, id);
struct Ipc_Exit : public IpcMessage<Ipc_Exit> {
static const IpcId kIpcId = IpcId::Exit;
};
MAKE_REFLECT_EMPTY_STRUCT(Ipc_Exit);
enum class lsErrorCodes {
// Defined by JSON RPC
ParseError = -32700,

View File

@ -5,7 +5,6 @@
#include <type_traits>
#include <vector>
#include <clang-c/Index.h>
namespace clang {

View File

@ -4,7 +4,6 @@
#include <unordered_map>
#include <vector>
#include "buffer.h"
struct ResizableBuffer;

View File

@ -7,7 +7,6 @@
#include <thread>
#include <vector>
#include <doctest/doctest.h>
namespace {

View File

@ -11,7 +11,6 @@
#include <iostream>
#include <string>
#include <assert.h>
#include <errno.h>
#include <limits.h>
@ -23,23 +22,19 @@
#include <time.h>
#include <unistd.h>
#include <dirent.h>
#include <sys/stat.h>
#include <sys/types.h> // required for stat.h
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#include <fcntl.h> /* For O_* constants */
#include <semaphore.h>
#include <sys/mman.h>
#include <sys/stat.h> /* For mode constants */
#ifndef __APPLE__
#include <sys/prctl.h>
#endif
@ -156,7 +151,6 @@ std::string GetWorkingDirectory() {
return working_dir;
}
std::string NormalizePath(const std::string& path) {
errno = 0;
char name[PATH_MAX + 1];

View File

@ -4,8 +4,8 @@
#include "match.h"
#include "platform.h"
#include "serializer.h"
#include "utils.h"
#include "timer.h"
#include "utils.h"
#include <clang-c/CXCompilationDatabase.h>
#include <doctest/doctest.h>

View File

@ -484,8 +484,7 @@ optional<lsSymbolInformation> GetSymbolInfo(QueryDatabase* db,
info.kind = lsSymbolKind::Function;
if (func.def->declaring_type.has_value()) {
QueryType& container =
db->types[func.def->declaring_type->id];
QueryType& container = db->types[func.def->declaring_type->id];
if (container.def)
info.kind = lsSymbolKind::Method;
}

View File

@ -13,7 +13,9 @@ long long Timer::ElapsedMicroseconds() const {
long long elapsed = elapsed_;
if (start_.has_value()) {
// TODO: clang-format this file.
elapsed += std::chrono::duration_cast<std::chrono::microseconds>(end - *start_).count();
elapsed +=
std::chrono::duration_cast<std::chrono::microseconds>(end - *start_)
.count();
}
return elapsed;
}