mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-22 15:45: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;
|
return;
|
||||||
|
|
||||||
std::vector<std::string> args = session->file.args;
|
std::vector<std::string> args = session->file.args;
|
||||||
|
|
||||||
|
// Show comment docstrings.
|
||||||
args.push_back("-fparse-all-comments");
|
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();
|
std::vector<CXUnsavedFile> unsaved = session->working_files->AsUnsavedFiles();
|
||||||
|
|
||||||
LOG_S(INFO) << "Creating completion session with arguments "
|
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); });
|
[&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,
|
bool EndsWithAny(const std::string& value,
|
||||||
const std::vector<std::string>& endings) {
|
const std::vector<std::string>& endings) {
|
||||||
return std::any_of(
|
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 EndsWith(const std::string& value, const std::string& ending);
|
||||||
bool AnyStartsWith(const std::vector<std::string>& values,
|
bool AnyStartsWith(const std::vector<std::string>& values,
|
||||||
const std::string& start);
|
const std::string& start);
|
||||||
|
bool StartsWithAny(const std::string& value,
|
||||||
|
const std::vector<std::string>& startings);
|
||||||
bool EndsWithAny(const std::string& value,
|
bool EndsWithAny(const std::string& value,
|
||||||
const std::vector<std::string>& endings);
|
const std::vector<std::string>& endings);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user