mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-22 07:35:08 +00:00
Fix a bunch of bugs in argument handling and address some TODOs
This commit is contained in:
parent
0e7c8bdf05
commit
a155f5b686
@ -292,8 +292,16 @@ void EnsureDocumentParsed(ClangCompleteManager* manager,
|
||||
return;
|
||||
|
||||
std::vector<std::string> args = session->file.args;
|
||||
|
||||
// Show comment docstrings.
|
||||
args.push_back("-fparse-all-comments");
|
||||
|
||||
// -fspell-checking enables FixIts for, ie, misspelled types.
|
||||
if (!AnyStartsWith(args, "-fno-spell-checking") &&
|
||||
!AnyStartsWith(args, "-fspell-checking")) {
|
||||
args.push_back("-fspell-checking");
|
||||
}
|
||||
|
||||
std::vector<CXUnsavedFile> unsaved = session->working_files->AsUnsavedFiles();
|
||||
|
||||
LOG_S(INFO) << "Creating completion session with arguments "
|
||||
|
1296
src/project.cc
1296
src/project.cc
File diff suppressed because it is too large
Load Diff
@ -56,6 +56,13 @@ bool AnyStartsWith(const std::vector<std::string>& values,
|
||||
[&start](const std::string& value) { return StartsWith(value, start); });
|
||||
}
|
||||
|
||||
bool StartsWithAny(const std::string& value,
|
||||
const std::vector<std::string>& startings) {
|
||||
return std::any_of(
|
||||
std::begin(startings), std::end(startings),
|
||||
[&value](const std::string& starting) { return StartsWith(value, starting); });
|
||||
}
|
||||
|
||||
bool EndsWithAny(const std::string& value,
|
||||
const std::vector<std::string>& endings) {
|
||||
return std::any_of(
|
||||
|
@ -25,6 +25,8 @@ bool StartsWith(const std::string& value, const std::string& start);
|
||||
bool EndsWith(const std::string& value, const std::string& ending);
|
||||
bool AnyStartsWith(const std::vector<std::string>& values,
|
||||
const std::string& start);
|
||||
bool StartsWithAny(const std::string& value,
|
||||
const std::vector<std::string>& startings);
|
||||
bool EndsWithAny(const std::string& value,
|
||||
const std::vector<std::string>& endings);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user