Browse Source

Remove `enableComments`, make `index.comments` default to 2, and index builtin types

pull/2/head
Fangrui Song 7 years ago
parent
commit
b4e1e4fd3a
  1. 7
      src/config.h
  2. 6
      src/indexer.cc
  3. 6
      src/messages/initialize.cc
  4. 2
      third_party/loguru

7
src/config.h

@ -87,9 +87,6 @@ struct Config {
// inform users their vscode client is too old and needs to be updated.
optional<int> 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,

6
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<IndexTypeId> 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);
}

6
src/messages/initialize.cc

@ -75,11 +75,7 @@ struct InitializeHandler : BaseMessageHandler<Ipc_InitializeRequest> {
}
}
}
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) {

2
third_party/loguru

@ -1 +1 @@
Subproject commit 2c35b5e7251ab5d364b1b3164eccef7b5d2293c5
Subproject commit 37e48808d720194199bc273be4184402a0bc394a
Loading…
Cancel
Save