https://github.com/Maddobun updated https://github.com/llvm/llvm-project/pull/70798
>From 0572afa42e4e6ca1d1de0e9df045828552cb4480 Mon Sep 17 00:00:00 2001 From: Leo Zhu <yifu....@microchip.com> Date: Wed, 8 Nov 2023 11:10:13 -0500 Subject: [PATCH] Convert URI to uppercase drive letter during parsing --- clang-tools-extra/clangd/URI.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/clang-tools-extra/clangd/URI.cpp b/clang-tools-extra/clangd/URI.cpp index ca65df329aeebf3..4bd4b6db9f51db4 100644 --- a/clang-tools-extra/clangd/URI.cpp +++ b/clang-tools-extra/clangd/URI.cpp @@ -165,8 +165,7 @@ std::string URI::toString() const { return Result; // If authority if empty, we only print body if it starts with "/"; otherwise, // the URI is invalid. - if (!Authority.empty() || llvm::StringRef(Body).startswith("/")) - { + if (!Authority.empty() || llvm::StringRef(Body).startswith("/")) { Result.append("//"); percentEncode(Authority, Result); } @@ -192,6 +191,10 @@ llvm::Expected<URI> URI::parse(llvm::StringRef OrigUri) { Uri = Uri.substr(Pos); } U.Body = percentDecode(Uri); + if (clang::clangd::isWindowsPath(U.Body)) { + Pos = U.Body.find(":"); + U.Body.at(Pos - 1) = std::toupper(U.Body.at(Pos - 1)); + } return U; } _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits