diff options
| author | Eric Liu <ioeric@google.com> | 2018-11-28 10:30:42 +0000 |
|---|---|---|
| committer | Eric Liu <ioeric@google.com> | 2018-11-28 10:30:42 +0000 |
| commit | 4d814a93e5b9d130097413bc027efca9524b36ce (patch) | |
| tree | fca975e18d42da20bf4d863182031186674084d0 /clang-tools-extra/clangd/ClangdLSPServer.cpp | |
| parent | 613c80d22f2428fb7e70754340c6a515e8e8d9c9 (diff) | |
| download | bcm5719-llvm-4d814a93e5b9d130097413bc027efca9524b36ce.tar.gz bcm5719-llvm-4d814a93e5b9d130097413bc027efca9524b36ce.zip | |
[clangd] Canonicalize file path in URIForFile.
Summary:
File paths in URIForFile can come from index or local AST. Path from
index goes through URI transformation and the final path is resolved by URI
scheme and could be potentially different from the original path. Hence, we
should do the same transformation for all paths. We do this in URIForFile, which
now converts a path to URI and back to a canonicalized path.
Reviewers: sammccall
Reviewed By: sammccall
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Differential Revision: https://reviews.llvm.org/D54845
llvm-svn: 347739
Diffstat (limited to 'clang-tools-extra/clangd/ClangdLSPServer.cpp')
| -rw-r--r-- | clang-tools-extra/clangd/ClangdLSPServer.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang-tools-extra/clangd/ClangdLSPServer.cpp b/clang-tools-extra/clangd/ClangdLSPServer.cpp index d1fdb657d42..a9d1795d248 100644 --- a/clang-tools-extra/clangd/ClangdLSPServer.cpp +++ b/clang-tools-extra/clangd/ClangdLSPServer.cpp @@ -775,7 +775,7 @@ std::vector<Fix> ClangdLSPServer::getFixes(StringRef File, void ClangdLSPServer::onDiagnosticsReady(PathRef File, std::vector<Diag> Diagnostics) { - URIForFile URI(File); + auto URI = URIForFile::canonicalize(File, /*TUPath=*/File); std::vector<Diagnostic> LSPDiagnostics; DiagnosticToReplacementMap LocalFixIts; // Temporary storage for (auto &Diag : Diagnostics) { |

