From b4e1e4fd3a66bea35b39125d5c8b21c8ea7e7405 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Tue, 23 Jan 2018 22:54:54 -0800 Subject: [PATCH] Remove `enableComments`, make `index.comments` default to 2, and index builtin types --- src/config.h | 7 +------ src/indexer.cc | 6 +----- src/messages/initialize.cc | 6 +----- third_party/loguru | 2 +- 4 files changed, 4 insertions(+), 17 deletions(-) diff --git a/src/config.h b/src/config.h index 09db234a..8fc08680 100644 --- a/src/config.h +++ b/src/config.h @@ -87,9 +87,6 @@ struct Config { // inform users their vscode client is too old and needs to be updated. optional clientVersion; - // TODO Deprecated in favor of index.comments - int enableComments = 0; - struct ClientCapability { // TextDocumentClientCapabilities.completion.completionItem.snippetSupport bool snippetSupport = false; @@ -107,7 +104,7 @@ struct Config { // 0: no; 1: Doxygen comment markers; 2: -fparse-all-comments, which includes // plain // /* - int comments = 0; + int comments = 2; }; Index index; @@ -154,8 +151,6 @@ MAKE_REFLECT_STRUCT(Config, clientVersion, - enableComments, - client, completion, index, diff --git a/src/indexer.cc b/src/indexer.cc index 75ac11ba..1bafc145 100644 --- a/src/indexer.cc +++ b/src/indexer.cc @@ -17,9 +17,6 @@ // TODO: See if we can use clang_indexLoc_getFileLocation to get a type ref on // |Foobar| in DISALLOW_COPY(Foobar) -// TODO Global variable -bool g_index_builtin_types; - namespace { constexpr bool kIndexStdDeclarations = true; @@ -408,8 +405,7 @@ optional ResolveToDeclarationType(IndexFile* db, if (CXType_FirstBuiltin <= type.cx_type.kind && type.cx_type.kind <= CXType_LastBuiltin) { - if (!g_index_builtin_types) - return nullopt; + // For builtin types, use type kinds as USR hash. return db->ToTypeId(type.cx_type.kind); } diff --git a/src/messages/initialize.cc b/src/messages/initialize.cc index c0629fb5..87ec7373 100644 --- a/src/messages/initialize.cc +++ b/src/messages/initialize.cc @@ -75,11 +75,7 @@ struct InitializeHandler : BaseMessageHandler { } } } - g_index_builtin_types = config->index.builtinTypes; - // TODO Remove enableComments - if (config->index.comments > 0) - config->enableComments = config->index.comments; - g_enable_comments = config->enableComments; + g_enable_comments = config->index.comments; // Client capabilities if (request->params.capabilities.textDocument) { diff --git a/third_party/loguru b/third_party/loguru index 2c35b5e7..37e48808 160000 --- a/third_party/loguru +++ b/third_party/loguru @@ -1 +1 @@ -Subproject commit 2c35b5e7251ab5d364b1b3164eccef7b5d2293c5 +Subproject commit 37e48808d720194199bc273be4184402a0bc394a