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