mirror of
				https://github.com/MaskRay/ccls.git
				synced 2025-11-03 22:04:24 +00:00 
			
		
		
		
	Format all code in src/
This commit is contained in:
		
							parent
							
								
									5f04e390a2
								
							
						
					
					
						commit
						7734943620
					
				@ -7,7 +7,6 @@
 | 
			
		||||
#include <optional.h>
 | 
			
		||||
#include <vector>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
using namespace std::experimental;
 | 
			
		||||
 | 
			
		||||
optional<lsDiagnostic> BuildAndDisposeDiagnostic(CXDiagnostic diagnostic,
 | 
			
		||||
 | 
			
		||||
@ -9,7 +9,6 @@
 | 
			
		||||
#include <unordered_map>
 | 
			
		||||
#include <unordered_set>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
struct IndexFile;
 | 
			
		||||
 | 
			
		||||
// Needed for unordered_map usage below.
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										164
									
								
								src/indexer.cc
									
									
									
									
									
								
							
							
						
						
									
										164
									
								
								src/indexer.cc
									
									
									
									
									
								
							@ -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) {}
 | 
			
		||||
 | 
			
		||||
@ -1621,8 +1461,8 @@ std::vector<std::unique_ptr<IndexFile>> Parse(
 | 
			
		||||
 | 
			
		||||
  std::unique_ptr<clang::TranslationUnit> tu = clang::TranslationUnit::Create(
 | 
			
		||||
      index, file, args, unsaved_files,
 | 
			
		||||
                            CXTranslationUnit_KeepGoing |
 | 
			
		||||
                                CXTranslationUnit_DetailedPreprocessingRecord);
 | 
			
		||||
      CXTranslationUnit_KeepGoing |
 | 
			
		||||
          CXTranslationUnit_DetailedPreprocessingRecord);
 | 
			
		||||
  if (!tu)
 | 
			
		||||
    return {};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -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,
 | 
			
		||||
 | 
			
		||||
@ -5,7 +5,6 @@
 | 
			
		||||
#include <type_traits>
 | 
			
		||||
#include <vector>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#include <clang-c/Index.h>
 | 
			
		||||
 | 
			
		||||
namespace clang {
 | 
			
		||||
 | 
			
		||||
@ -4,7 +4,6 @@
 | 
			
		||||
#include <unordered_map>
 | 
			
		||||
#include <vector>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#include "buffer.h"
 | 
			
		||||
 | 
			
		||||
struct ResizableBuffer;
 | 
			
		||||
 | 
			
		||||
@ -7,7 +7,6 @@
 | 
			
		||||
#include <thread>
 | 
			
		||||
#include <vector>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#include <doctest/doctest.h>
 | 
			
		||||
 | 
			
		||||
namespace {
 | 
			
		||||
 | 
			
		||||
@ -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];
 | 
			
		||||
 | 
			
		||||
@ -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>
 | 
			
		||||
 | 
			
		||||
@ -606,7 +606,7 @@ IndexUpdate::IndexUpdate(const IdMap& previous_id_map,
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void IndexUpdate::Merge(const IndexUpdate& update) {
 | 
			
		||||
// This function runs on an indexer thread.
 | 
			
		||||
  // 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);
 | 
			
		||||
 | 
			
		||||
@ -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;
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
@ -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;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user