[PATCH] D41351: [clangd] Expose offset <-> LSP position functions, and fix bugs
Sam McCall via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Dec 18 05:56:09 PST 2017
sammccall created this revision.
sammccall added a reviewer: ioeric.
Herald added subscribers: cfe-commits, ilya-biryukov, mgorny, klimek.
- 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 https://reviews.llvm.org/D41281, but in a pretty easy-to-resolve way.
rCTE Clang Tools Extra
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 9951 bytes
Desc: not available
More information about the cfe-commits