mirror of
https://github.com/MaskRay/ccls.git
synced 2025-01-31 18:00:26 +00:00
Add using declaration to optional.h, include STL optional if available or fallback to third-party one.
This commit is contained in:
parent
b6071004df
commit
48f3c75053
@ -1,12 +1,10 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <optional.h>
|
#include <optional.h>
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
using std::experimental::nullopt;
|
|
||||||
using std::experimental::optional;
|
|
||||||
|
|
||||||
struct Config;
|
struct Config;
|
||||||
struct IndexFile;
|
struct IndexFile;
|
||||||
|
|
||||||
|
@ -1,14 +1,11 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <optional.h>
|
|
||||||
|
|
||||||
#include <clang-c/Index.h>
|
#include <clang-c/Index.h>
|
||||||
|
#include <optional.h>
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
using std::experimental::optional;
|
|
||||||
|
|
||||||
class ClangType {
|
class ClangType {
|
||||||
public:
|
public:
|
||||||
ClangType();
|
ClangType();
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
#include "language_server_api.h"
|
#include "language_server_api.h"
|
||||||
|
|
||||||
#include <clang-c/Index.h>
|
#include <clang-c/Index.h>
|
||||||
|
|
||||||
#include <optional.h>
|
#include <optional.h>
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
using namespace std::experimental;
|
using namespace std::experimental;
|
||||||
|
@ -6,9 +6,6 @@
|
|||||||
|
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
|
|
||||||
using namespace std::experimental;
|
|
||||||
using std::experimental::nullopt;
|
|
||||||
|
|
||||||
// Cached completion information, so we can give fast completion results when
|
// Cached completion information, so we can give fast completion results when
|
||||||
// the user erases a character. vscode will resend the completion request if
|
// the user erases a character. vscode will resend the completion request if
|
||||||
// that happens.
|
// that happens.
|
||||||
|
@ -5,9 +5,9 @@
|
|||||||
#include "serializer.h"
|
#include "serializer.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
#include "optional.h"
|
#include <optional.h>
|
||||||
#include "variant.h"
|
|
||||||
#include <rapidjson/writer.h>
|
#include <rapidjson/writer.h>
|
||||||
|
#include <variant.h>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
@ -15,9 +15,6 @@
|
|||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#include <unordered_set>
|
#include <unordered_set>
|
||||||
|
|
||||||
using std::experimental::nullopt;
|
|
||||||
using std::experimental::optional;
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -6,9 +6,6 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
using std::experimental::nullopt;
|
|
||||||
using std::experimental::optional;
|
|
||||||
|
|
||||||
struct Matcher {
|
struct Matcher {
|
||||||
static optional<Matcher> Create(const std::string& search);
|
static optional<Matcher> Create(const std::string& search);
|
||||||
|
|
||||||
|
@ -6,9 +6,6 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
using std::experimental::nullopt;
|
|
||||||
using std::experimental::optional;
|
|
||||||
|
|
||||||
struct PlatformMutex {
|
struct PlatformMutex {
|
||||||
virtual ~PlatformMutex();
|
virtual ~PlatformMutex();
|
||||||
};
|
};
|
||||||
|
@ -10,9 +10,6 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
using std::experimental::nullopt;
|
|
||||||
using std::experimental::optional;
|
|
||||||
|
|
||||||
struct Project {
|
struct Project {
|
||||||
struct Entry {
|
struct Entry {
|
||||||
std::string filename;
|
std::string filename;
|
||||||
|
@ -3,12 +3,11 @@
|
|||||||
#include "lru_cache.h"
|
#include "lru_cache.h"
|
||||||
#include "query.h"
|
#include "query.h"
|
||||||
|
|
||||||
|
#include <optional.h>
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
||||||
using std::experimental::nullopt;
|
|
||||||
using std::experimental::optional;
|
|
||||||
|
|
||||||
// Caches symbols for a single file for semantic highlighting to provide
|
// Caches symbols for a single file for semantic highlighting to provide
|
||||||
// relatively stable ids. Only supports xxx files at a time.
|
// relatively stable ids. Only supports xxx files at a time.
|
||||||
struct SemanticHighlightSymbolCache {
|
struct SemanticHighlightSymbolCache {
|
||||||
|
@ -1,18 +1,15 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <macro_map.h>
|
||||||
|
#include <optional.h>
|
||||||
|
#include <variant.h>
|
||||||
|
#include <rapidjson/document.h>
|
||||||
|
#include <rapidjson/prettywriter.h>
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "macro_map.h"
|
|
||||||
#include "optional.h"
|
|
||||||
#include "variant.h"
|
|
||||||
#include "rapidjson/document.h"
|
|
||||||
#include "rapidjson/prettywriter.h"
|
|
||||||
|
|
||||||
using std::experimental::nullopt;
|
|
||||||
using std::experimental::optional;
|
|
||||||
|
|
||||||
using Reader = rapidjson::GenericValue<rapidjson::UTF8<>>;
|
using Reader = rapidjson::GenericValue<rapidjson::UTF8<>>;
|
||||||
using Writer = rapidjson::Writer<rapidjson::StringBuffer>;
|
using Writer = rapidjson::Writer<rapidjson::StringBuffer>;
|
||||||
struct IndexFile;
|
struct IndexFile;
|
||||||
|
@ -9,9 +9,6 @@
|
|||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
using std::experimental::optional;
|
|
||||||
using std::experimental::nullopt;
|
|
||||||
|
|
||||||
enum class TaskThread {
|
enum class TaskThread {
|
||||||
Indexer,
|
Indexer,
|
||||||
QueryDb,
|
QueryDb,
|
||||||
|
@ -11,9 +11,6 @@
|
|||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <queue>
|
#include <queue>
|
||||||
|
|
||||||
using std::experimental::nullopt;
|
|
||||||
using std::experimental::optional;
|
|
||||||
|
|
||||||
// TODO: cleanup includes.
|
// TODO: cleanup includes.
|
||||||
|
|
||||||
struct BaseThreadQueue {
|
struct BaseThreadQueue {
|
||||||
|
@ -5,9 +5,6 @@
|
|||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
using std::experimental::nullopt;
|
|
||||||
using std::experimental::optional;
|
|
||||||
|
|
||||||
struct Timer {
|
struct Timer {
|
||||||
using Clock = std::chrono::high_resolution_clock;
|
using Clock = std::chrono::high_resolution_clock;
|
||||||
|
|
||||||
|
@ -7,9 +7,6 @@
|
|||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
||||||
using namespace std::experimental;
|
|
||||||
using std::experimental::nullopt;
|
|
||||||
|
|
||||||
// Caches timestamps of cc files so we can avoid a filesystem reads. This is
|
// Caches timestamps of cc files so we can avoid a filesystem reads. This is
|
||||||
// important for import perf, as during dependency checking the same files are
|
// important for import perf, as during dependency checking the same files are
|
||||||
// checked over and over again if they are common headers.
|
// checked over and over again if they are common headers.
|
||||||
|
@ -10,9 +10,6 @@
|
|||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
using std::experimental::nullopt;
|
|
||||||
using std::experimental::optional;
|
|
||||||
|
|
||||||
// Trim from start (in place)
|
// Trim from start (in place)
|
||||||
void TrimStartInPlace(std::string& s);
|
void TrimStartInPlace(std::string& s);
|
||||||
// Trim from end (in place)
|
// Trim from end (in place)
|
||||||
|
@ -9,9 +9,6 @@
|
|||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
using std::experimental::nullopt;
|
|
||||||
using std::experimental::optional;
|
|
||||||
|
|
||||||
struct WorkingFile {
|
struct WorkingFile {
|
||||||
int version = 0;
|
int version = 0;
|
||||||
std::string filename;
|
std::string filename;
|
||||||
|
Loading…
Reference in New Issue
Block a user