mirror of
https://github.com/MaskRay/ccls.git
synced 2025-06-06 16:24:54 +00:00
Make llvm::StringRef to std::string conversions explicit.
This commit is contained in:
parent
a2d2fd8167
commit
5002236cb6
@ -25,7 +25,7 @@ std::string pathFromFileEntry(const FileEntry &file) {
|
||||
// Resolve symlinks outside of working folders. This handles leading path
|
||||
// components, e.g. (/lib -> /usr/lib) in
|
||||
// /../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/utility
|
||||
ret = file.tryGetRealPathName();
|
||||
ret = std::string(file.tryGetRealPathName());
|
||||
} else {
|
||||
// If getName() refers to a file within a workspace folder, we prefer it
|
||||
// (which may be a symlink).
|
||||
|
@ -38,7 +38,7 @@ void MessageHandler::workspace_didChangeWatchedFiles(
|
||||
StringRef(path).startswith(g_config->cache.directory)) ||
|
||||
lookupExtension(path).first == LanguageId::Unknown)
|
||||
return;
|
||||
for (std::string cur = path; cur.size(); cur = sys::path::parent_path(cur))
|
||||
for (std::string cur = path; cur.size(); cur = std::string(sys::path::parent_path(cur)))
|
||||
if (cur[0] == '.')
|
||||
return;
|
||||
|
||||
|
@ -251,7 +251,7 @@ void loadDirectoryListing(ProjectProcessor &proc, const std::string &root,
|
||||
std::vector<std::string> files;
|
||||
|
||||
auto getDotCcls = [&root, &folder](std::string cur) {
|
||||
while (!(cur = sys::path::parent_path(cur)).empty()) {
|
||||
while (!(cur = std::string(sys::path::parent_path(cur))).empty()) {
|
||||
auto it = folder.dot_ccls.find(cur + '/');
|
||||
if (it != folder.dot_ccls.end())
|
||||
return it->second;
|
||||
|
@ -249,9 +249,9 @@ public:
|
||||
info.FormatDiagnostic(message);
|
||||
d.range =
|
||||
fromCharSourceRange(sm, *langOpts, diagnosticRange(info, *langOpts));
|
||||
d.message = message.str();
|
||||
d.message = std::string(message.str());
|
||||
d.concerned = concerned;
|
||||
d.file = filename;
|
||||
d.file = std::string(filename);
|
||||
d.level = level;
|
||||
d.category = DiagnosticIDs::getCategoryNumberForDiag(info.getID());
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user