[clangd] Added semantic highlighting support for primitives.
authorJohan Vikstrom <jvikstrom@google.com>
Thu, 8 Aug 2019 13:10:30 +0000 (13:10 +0000)
committerJohan Vikstrom <jvikstrom@google.com>
Thu, 8 Aug 2019 13:10:30 +0000 (13:10 +0000)
commitd73d9947466f02a77b87c620eb237ac7b5d96ea3
tree6fa72dd30e3cc7082507389392b13551631663aa
parente1e749d86a61b98564b5cc439d8f737fba9008c8
[clangd] Added semantic highlighting support for primitives.

Summary:
Adds a new HighlightingKind "Primitive". Adds a special case for TypeLocs that have an underlying TypePtr that is are builtin types, adding them as primitives.
The primary reason for this change is because otherwise typedefs that typedef primitives `typedef int A` would not get highlighted (so in the example `A` would not get any highlightings.)

Reviewers: hokein, ilya-biryukov

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

Tags: #clang

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

llvm-svn: 368291
clang-tools-extra/clangd/SemanticHighlighting.cpp
clang-tools-extra/clangd/SemanticHighlighting.h
clang-tools-extra/clangd/test/semantic-highlighting.test
clang-tools-extra/clangd/unittests/SemanticHighlightingTests.cpp
clang-tools-extra/clangd/unittests/TweakTests.cpp