[clangd] Fix early selection for non-vardecl declarators
authorKadir Cetinkaya <kadircet@google.com>
Tue, 25 Feb 2020 08:33:52 +0000 (09:33 +0100)
committerKadir Cetinkaya <kadircet@google.com>
Wed, 4 Mar 2020 10:01:35 +0000 (11:01 +0100)
commite6b8181895b96740dbe54aca036aa237e0a8363d
treec433f1b745b429f663779e4b237562c63b26023f
parent497c110e873447c32c4fec82eb7a34d072cf941e
[clangd] Fix early selection for non-vardecl declarators

Summary:
Selection tree was performing an early claim only for VarDecls, but
there are other cases where we can have declarators, e.g. FieldDecls. This patch
extends the early claim logic to all types of declarators.

Fixes https://github.com/clangd/clangd/issues/292

Reviewers: sammccall

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

Tags: #clang

Differential Revision: https://reviews.llvm.org/D75106
clang-tools-extra/clangd/Selection.cpp
clang-tools-extra/clangd/unittests/HoverTests.cpp
clang-tools-extra/clangd/unittests/SelectionTests.cpp