[clangd:vscode] Resolve symlinks for file paths from clangd.
authorEric Liu <ioeric@google.com>
Thu, 8 Mar 2018 15:28:42 +0000 (15:28 +0000)
committerEric Liu <ioeric@google.com>
Thu, 8 Mar 2018 15:28:42 +0000 (15:28 +0000)
commit2e1980bde1786292b05ac9c1b92ced9c31b9f622
tree84df3881d01b08dee63a3a49b64e6d83a57b418a
parent2e0cbe509242697caec4a119b323475c4d006486
[clangd:vscode] Resolve symlinks for file paths from clangd.

Summary:
For features like go-to-definition, clangd can point clients to symlink paths
(e.g. in bazel execroot) which might not be desired if the symlink points to a
file in the workspace. Clangd might not be able to build the file, and users
might prefer to edit the file on the real path.

This change converts file paths from clangd to real path (e.g. resolving symlinks).
Long term, we might want to the symlink handling logic to clangd where clangd
can better decide whether symlinks should be resolved according to e.g. compile
commands.

Reviewers: sammccall

Subscribers: klimek, ilya-biryukov, jkorous-apple, cfe-commits

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

llvm-svn: 327009
clang-tools-extra/clangd/clients/clangd-vscode/src/extension.ts