[clangd] Extract FsPath from file:// uri
authorKrasimir Georgiev <krasimir@google.com>
Fri, 7 Apr 2017 11:03:26 +0000 (11:03 +0000)
committerKrasimir Georgiev <krasimir@google.com>
Fri, 7 Apr 2017 11:03:26 +0000 (11:03 +0000)
commit50117372db08e56143d3376c60cb2d9b9a33f50b
tree4d5126cbfc124d918a699b80ddbc5f34bdf13efb
parent6e79529db4e81cc99ec28359b6a32a9c3fece184
[clangd] Extract FsPath from file:// uri

Patch contributed by stanionascu!

rfc8089#appendix-E.2 specifies that paths can begin with a drive letter e.g. as file:///c:/.
In this case just consuming front file:// is not enough and the 3rd slash must be consumed to produce a valid path on windows.

The patch introduce a generic way of converting an uri to a filesystem path and back.

Differential Revision: https://reviews.llvm.org/D31401

llvm-svn: 299758
clang-tools-extra/clangd/ASTManager.cpp
clang-tools-extra/clangd/ASTManager.h
clang-tools-extra/clangd/DocumentStore.h
clang-tools-extra/clangd/Protocol.cpp
clang-tools-extra/clangd/Protocol.h
clang-tools-extra/clangd/ProtocolHandlers.cpp
clang-tools-extra/clangd/clients/clangd-vscode/src/extension.ts