Add initialization option index.name.suppressUnwrittenScope (default: true)

This commit is contained in:
Fangrui Song 2019-03-10 08:55:01 -07:00
parent b80061fe38
commit 4cc9dda994
2 changed files with 8 additions and 2 deletions

View File

@ -273,6 +273,10 @@ struct Config {
std::vector<std::string> multiVersionBlacklist; std::vector<std::string> multiVersionBlacklist;
std::vector<std::string> multiVersionWhitelist; std::vector<std::string> multiVersionWhitelist;
struct Name {
bool suppressUnwrittenScope = true;
} name;
// Allow indexing on textDocument/didChange. // Allow indexing on textDocument/didChange.
// May be too slow for big projects, so it is off by default. // May be too slow for big projects, so it is off by default.
bool onChange = false; bool onChange = false;
@ -335,10 +339,11 @@ REFLECT_STRUCT(Config::Completion, caseSensitivity, detailedLabel,
REFLECT_STRUCT(Config::Diagnostics, blacklist, onChange, onOpen, onSave, REFLECT_STRUCT(Config::Diagnostics, blacklist, onChange, onOpen, onSave,
spellChecking, whitelist) spellChecking, whitelist)
REFLECT_STRUCT(Config::Highlight, largeFileSize, lsRanges, blacklist, whitelist) REFLECT_STRUCT(Config::Highlight, largeFileSize, lsRanges, blacklist, whitelist)
REFLECT_STRUCT(Config::Index::Name, suppressUnwrittenScope);
REFLECT_STRUCT(Config::Index, blacklist, comments, initialBlacklist, REFLECT_STRUCT(Config::Index, blacklist, comments, initialBlacklist,
initialWhitelist, maxInitializerLines, multiVersion, initialWhitelist, maxInitializerLines, multiVersion,
multiVersionBlacklist, multiVersionWhitelist, onChange, threads, multiVersionBlacklist, multiVersionWhitelist, name, onChange,
trackDependency, whitelist); threads, trackDependency, whitelist);
REFLECT_STRUCT(Config::Request, timeout); REFLECT_STRUCT(Config::Request, timeout);
REFLECT_STRUCT(Config::Session, maxNum); REFLECT_STRUCT(Config::Session, maxNum);
REFLECT_STRUCT(Config::WorkspaceSymbol, caseSensitivity, maxNum, sort); REFLECT_STRUCT(Config::WorkspaceSymbol, caseSensitivity, maxNum, sort);

View File

@ -490,6 +490,7 @@ public:
PP.PolishForDeclaration = true; PP.PolishForDeclaration = true;
PP.ConstantsAsWritten = true; PP.ConstantsAsWritten = true;
PP.SuppressTagKeyword = true; PP.SuppressTagKeyword = true;
PP.SuppressUnwrittenScope = g_config->index.name.suppressUnwrittenScope;
PP.SuppressInitializers = true; PP.SuppressInitializers = true;
PP.FullyQualifiedName = false; PP.FullyQualifiedName = false;
return PP; return PP;