This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Added semantic highlighting support for primitives.
ClosedPublic

Authored by jvikstrom on Aug 8 2019, 5:34 AM.

Details

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.)

Diff Detail

Repository
rL LLVM

Event Timeline

jvikstrom created this revision.Aug 8 2019, 5:34 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 8 2019, 5:34 AM
hokein accepted this revision.Aug 8 2019, 5:48 AM

nice, just a nit.

clang-tools-extra/clangd/SemanticHighlighting.cpp
138 ↗(On Diff #214121)

nit: we could merge this to the if below.

This revision is now accepted and ready to land.Aug 8 2019, 5:48 AM
This revision was automatically updated to reflect the committed changes.
jvikstrom marked an inline comment as done.
Herald added a project: Restricted Project. · View Herald TranscriptAug 8 2019, 6:09 AM