[clangd] Replace raw lexer code with token buffer in prepare rename.
authorHaojian Wu <hokein.wu@gmail.com>
Wed, 29 Jan 2020 09:12:56 +0000 (10:12 +0100)
committerHaojian Wu <hokein.wu@gmail.com>
Wed, 29 Jan 2020 11:57:18 +0000 (12:57 +0100)
commite864f937669c996b4dc15db7d0ebe4073527c165
tree70aa93d439fa931baee640a819a4062dd0f41c3b
parentbcb3e42fdfb30f516fefd56609a969059b60a982
[clangd] Replace raw lexer code with token buffer in prepare rename.

Summary:
there is a slight behavior change in this patch:

- before: `in^t a;`, returns our internal error message (no symbol at given location)
- after: `in^t a, returns null, and client displays their message (e.g.
   e.g. "the element can't be renamed" in vscode).

both are sensible according LSP, and we'd save one `rename` call in the later case.

Reviewers: sammccall

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D73610
clang-tools-extra/clangd/ClangdServer.cpp
clang-tools-extra/clangd/test/rename.test