mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-22 07:35:08 +00:00
clean up clang_complete found by scturtle; clean up project
This commit is contained in:
parent
f9e1e8cbdc
commit
d2e0c7ca24
@ -776,7 +776,6 @@ std::shared_ptr<CompletionSession> ClangCompleteManager::TryGetSession(
|
||||
// If this request is for a completion, we should move it to
|
||||
// |completion_sessions|.
|
||||
if (mark_as_completion) {
|
||||
assert(!completion_sessions_.TryGet(filename));
|
||||
preloaded_sessions_.TryTake(filename);
|
||||
completion_sessions_.Insert(filename, preloaded_session);
|
||||
}
|
||||
|
@ -44,10 +44,6 @@ struct ClangCompleteManager {
|
||||
using OnDiagnostic =
|
||||
std::function<void(std::string path,
|
||||
std::vector<lsDiagnostic> diagnostics)>;
|
||||
using OnIndex = std::function<void(ClangTranslationUnit* tu,
|
||||
const std::vector<CXUnsavedFile>& unsaved,
|
||||
const std::string& path,
|
||||
const std::vector<std::string>& args)>;
|
||||
using OnComplete =
|
||||
std::function<void(const std::vector<lsCompletionItem>& results,
|
||||
bool is_cached_result)>;
|
||||
|
@ -95,25 +95,6 @@ Project::Entry GetCompilationEntryFromCompileCommandEntry(
|
||||
if (args.empty())
|
||||
return result;
|
||||
|
||||
std::string first_arg = args[0];
|
||||
// Windows' filesystem is not case sensitive, so we compare only
|
||||
// the lower case variant.
|
||||
std::transform(first_arg.begin(), first_arg.end(), first_arg.begin(),
|
||||
tolower);
|
||||
bool clang_cl = strstr(first_arg.c_str(), "clang-cl") ||
|
||||
strstr(first_arg.c_str(), "cl.exe");
|
||||
// Clang only cares about the last --driver-mode flag, so the loop
|
||||
// iterates in reverse to find the last one as soon as possible
|
||||
// in case of multiple --driver-mode flags.
|
||||
for (int i = args.size() - 1; i >= 0; --i) {
|
||||
if (strstr(args[i].c_str(), "--dirver-mode=")) {
|
||||
clang_cl = clang_cl || strstr(args[i].c_str(), "--driver-mode=cl");
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Compiler driver.
|
||||
result.args.push_back(args[0]);
|
||||
|
||||
std::unique_ptr<OptTable> Opts = driver::createDriverOptTable();
|
||||
unsigned MissingArgIndex, MissingArgCount;
|
||||
std::vector<const char*> cargs;
|
||||
|
Loading…
Reference in New Issue
Block a user