diff options
author | Sam McCall <sam.mccall@gmail.com> | 2017-12-19 12:23:48 +0000 |
---|---|---|
committer | Sam McCall <sam.mccall@gmail.com> | 2017-12-19 12:23:48 +0000 |
commit | 81a5eb03e612b2aeb88bb6a4d32a26e0b2d9cdb8 (patch) | |
tree | c34d7e6bf282ef5c3c696409314f483de7f11e67 /unittests/clangd/IndexTests.cpp | |
parent | d572b55b00080681f153134669dcc4d0975725bf (diff) |
[clangd] Expose offset <-> LSP position functions, and fix bugs
Summary:
- Moved these functions to SourceCode.h
- added unit tests
- fix off by one in positionToOffset: Offset - 1 in final calculation was wrong
- fixed formatOnType which had an equal and opposite off-by-one
- positionToOffset and offsetToPosition both consistently clamp to beginning/end
of file when input is out of range
- gave variables more descriptive names
- removed windows line ending fixmes where there is nothing to fix
- elaborated on UTF-8 fixmes
This will conflict with Eric's D41281, but in a pretty easy-to-resolve way.
Reviewers: ioeric
Subscribers: klimek, mgorny, ilya-biryukov, cfe-commits
Differential Revision: https://reviews.llvm.org/D41351
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@321073 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/clangd/IndexTests.cpp')
0 files changed, 0 insertions, 0 deletions