[clangd] Exclude preprocessed-to-nothing tokens from selection
authorSam McCall <sam.mccall@gmail.com>
Fri, 17 Jul 2020 10:03:24 +0000 (12:03 +0200)
committerSam McCall <sam.mccall@gmail.com>
Mon, 20 Jul 2020 12:50:12 +0000 (14:50 +0200)
commit72f2fb1db4ea19b543265ceba67964174848a875
treebfecfc14b9d41487b7245b243495213ff530b9c4
parentf0ab336e745505f3bb7e8570f12937cf0fbc11aa
[clangd] Exclude preprocessed-to-nothing tokens from selection

This prevents selection of empty preprocessor entities (like #define directives,
or text in disabled sections) creating a selection in the parent element.

Summary: Based on D83508 by Aleksandr Platonov.

Reviewers: ArcsinX, kadircet

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

Tags: #clang

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