diff options
author | Kadir Cetinkaya <kadircet@google.com> | 2018-12-19 10:46:21 +0000 |
---|---|---|
committer | Kadir Cetinkaya <kadircet@google.com> | 2018-12-19 10:46:21 +0000 |
commit | dd67793c0c549638cd93cad1142d324b979ba682 (patch) | |
tree | 031304cd0d3923502a947fbfe22aedd74ccca9d7 /clang-tools-extra/clangd/SourceCode.h | |
parent | 7120fb9b0ba5474693a56d0f6e632058c9764f84 (diff) | |
download | bcm5719-llvm-dd67793c0c549638cd93cad1142d324b979ba682.tar.gz bcm5719-llvm-dd67793c0c549638cd93cad1142d324b979ba682.zip |
[clangd] Unify path canonicalizations in the codebase
Summary:
There were a few different places where we canonicalized paths, each
one had its own flavor. This patch tries to unify them all under one place.
Reviewers: ilya-biryukov
Subscribers: ioeric, MaskRay, jkorous, arphaman, cfe-commits
Differential Revision: https://reviews.llvm.org/D55818
llvm-svn: 349618
Diffstat (limited to 'clang-tools-extra/clangd/SourceCode.h')
-rw-r--r-- | clang-tools-extra/clangd/SourceCode.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/clang-tools-extra/clangd/SourceCode.h b/clang-tools-extra/clangd/SourceCode.h index 769d0afc721..b768d09a195 100644 --- a/clang-tools-extra/clangd/SourceCode.h +++ b/clang-tools-extra/clangd/SourceCode.h @@ -78,17 +78,18 @@ std::vector<TextEdit> replacementsToEdits(StringRef Code, TextEdit toTextEdit(const FixItHint &FixIt, const SourceManager &M, const LangOptions &L); -/// Get the real/canonical path of \p F. This means: +/// Get the canonical path of \p F. This means: /// /// - Absolute path /// - Symlinks resolved /// - No "." or ".." component /// - No duplicate or trailing directory separator /// -/// This function should be used when sending paths to clients, so that paths -/// are normalized as much as possible. -llvm::Optional<std::string> getRealPath(const FileEntry *F, - const SourceManager &SourceMgr); +/// This function should be used when paths needs to be used outside the +/// component that generate it, so that paths are normalized as much as +/// possible. +llvm::Optional<std::string> getCanonicalPath(const FileEntry *F, + const SourceManager &SourceMgr); bool IsRangeConsecutive(const Range &Left, const Range &Right); } // namespace clangd |