[clangd] Remove highlightings coming from non topLevelDecls from included files.
authorJohan Vikstrom <jvikstrom@google.com>
Mon, 12 Aug 2019 13:01:11 +0000 (13:01 +0000)
committerJohan Vikstrom <jvikstrom@google.com>
Mon, 12 Aug 2019 13:01:11 +0000 (13:01 +0000)
commitcbe3ed552fa8295f3858b9cd2db4639fc671b82b
tree52d7c9e63e078a9b57fc2fc4305dd060d23a34d2
parent7b4b3305fff358e54a8ed927fd3711a2e1786608
[clangd] Remove highlightings coming from non topLevelDecls from included files.

Summary: It is possible to write include code from other files so that the decls from there do not become topLevelDecls (For example by including methods for a class). These Decls are not filtered by topLevelDecls and therefore SemanticHighlighting must manually check that every SLoc belongs in the main file. Otherwise there can be highlightings appearing in places where they should not.

Reviewers: hokein, ilya-biryukov

Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D66083

llvm-svn: 368563
clang-tools-extra/clangd/SemanticHighlighting.cpp
clang-tools-extra/clangd/unittests/SemanticHighlightingTests.cpp