-
Notifications
You must be signed in to change notification settings - Fork 260
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Index symlinks by replacing tryGetRealName with getName+normalization
Fix #639
- Loading branch information
Showing
3 changed files
with
8 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,13 +17,13 @@ | |
#include <llvm/Support/Path.h> | ||
|
||
using namespace clang; | ||
using namespace llvm; | ||
|
||
namespace ccls { | ||
std::string pathFromFileEntry(const FileEntry &file) { | ||
StringRef name = file.tryGetRealPathName(); | ||
if (name.empty()) | ||
name = file.getName(); | ||
std::string ret = normalizePath(name); | ||
SmallString<128> path(file.getName()); | ||
sys::path::remove_dots(path, /*remove_dot_dot=*/true); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
MaskRay
Author
Owner
|
||
std::string ret(path.str()); | ||
// Resolve symlinks outside of workspace folders, e.g. /usr/include/c++/7.3.0 | ||
return normalizeFolder(ret) ? ret : realPath(ret); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while
file.getName()
=/../lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/iostream
,sys::path::remove_dots
will be/include/c++/4.8.5/iostream
. While in centos , it will be