[clangd] Strip file:// from the URI when calling formatting.

It confuses FileManager on windows.

llvm-svn: 294314
This commit is contained in:
Benjamin Kramer 2017-02-07 16:10:17 +00:00
parent 32f0a4330a
commit f86708dbf5

View File

@ -63,6 +63,9 @@ static std::string formatCode(StringRef Code, StringRef Filename,
// Call clang-format.
// FIXME: Don't ignore style.
format::FormatStyle Style = format::getLLVMStyle();
// On windows FileManager doesn't like file://. Just strip it, clang-format
// doesn't need it.
Filename.consume_front("file://");
tooling::Replacements Replacements =
format::reformat(Style, Code, Ranges, Filename);