[clangd] Add line and column number to the index symbol.
authorHaojian Wu <hokein@google.com>
Fri, 13 Apr 2018 08:30:39 +0000 (08:30 +0000)
committerHaojian Wu <hokein@google.com>
Fri, 13 Apr 2018 08:30:39 +0000 (08:30 +0000)
commit545c02a7109c5bc1f97a1a4b55d1db475169a417
treee86c720fe1de0911394b4d4119242a0c4a9867a4
parent1ba194212a948fe4664ed7caedc7637968a7dbc7
[clangd] Add line and column number to the index symbol.

Summary:
LSP is using Line & column as symbol position, clangd needs to transfer file
offset to Line & column when sending results back to LSP client, which is a high
cost, especially for finding workspace symbol -- we have to read the file
content from disk (if it isn't loaded in memory).

Saving these information in the index will make the clangd life eaiser.

Reviewers: sammccall

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

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

llvm-svn: 329997
clang-tools-extra/clangd/index/Index.cpp
clang-tools-extra/clangd/index/Index.h
clang-tools-extra/clangd/index/SymbolCollector.cpp
clang-tools-extra/clangd/index/SymbolYAML.cpp
clang-tools-extra/unittests/clangd/Annotations.cpp
clang-tools-extra/unittests/clangd/Annotations.h
clang-tools-extra/unittests/clangd/SymbolCollectorTests.cpp