[clangd] Add path mappings functionality
authorSam McCall <sam.mccall@gmail.com>
Tue, 7 Jan 2020 10:28:05 +0000 (11:28 +0100)
committerSam McCall <sam.mccall@gmail.com>
Tue, 7 Jan 2020 11:40:51 +0000 (12:40 +0100)
commitc69ae835d0e0dc493eb09e75f0687a1390525440
treea98931e4af16f9353131bcab14e3bbd5214f044d
parent27e6b171e0be0bca1ba4fb934f52816f24487b6f
[clangd] Add path mappings functionality

Summary: Add path mappings to clangd which translate file URIs on inbound and outbound LSP messages. This mapping allows clangd to run in a remote environment (e.g. docker), where the source files and dependencies may be at different locations than the host. See http://lists.llvm.org/pipermail/clangd-dev/2019-January/000231.htm for more.

Patch by William Wagner!

Reviewers: sammccall, ilya-biryukov

Reviewed By: sammccall

Subscribers: usaxena95, ormris, mgorny, MaskRay, jkorous, arphaman, kadircet, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D64305
clang-tools-extra/clangd/CMakeLists.txt
clang-tools-extra/clangd/PathMapping.cpp [new file with mode: 0644]
clang-tools-extra/clangd/PathMapping.h [new file with mode: 0644]
clang-tools-extra/clangd/test/Inputs/path-mappings/server/foo.h [new file with mode: 0644]
clang-tools-extra/clangd/test/path-mappings.test [new file with mode: 0644]
clang-tools-extra/clangd/tool/ClangdMain.cpp
clang-tools-extra/clangd/unittests/CMakeLists.txt
clang-tools-extra/clangd/unittests/PathMappingTests.cpp [new file with mode: 0644]