Skip to content

Commit

Permalink
Remove enableComments, make index.comments default to 2, and inde…
Browse files Browse the repository at this point in the history
…x builtin types
  • Loading branch information
MaskRay committed Jan 24, 2018
1 parent 43fb1ab commit b4e1e4f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 17 deletions.
7 changes: 1 addition & 6 deletions src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand Down Expand Up @@ -154,8 +151,6 @@ MAKE_REFLECT_STRUCT(Config,

clientVersion,

enableComments,

client,
completion,
index,
Expand Down
6 changes: 1 addition & 5 deletions src/indexer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}

Expand Down
6 changes: 1 addition & 5 deletions src/messages/initialize.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion third_party/loguru
Submodule loguru updated 1 files
+6 −8 loguru.hpp

0 comments on commit b4e1e4f

Please sign in to comment.