This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Do not highlight keywords in semantic highlighting
ClosedPublic

Authored by ilya-biryukov on Oct 25 2019, 5:54 AM.

Details

Summary

Editors are good at highlightings the keywords themselves.
Note that this only affects highlightings of builtin types spelled out
as keywords in the source code. Highlightings of typedefs to builtin
types are unchanged.

Diff Detail

Event Timeline

ilya-biryukov created this revision.Oct 25 2019, 5:54 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 25 2019, 5:54 AM

Build result: fail - 59585 tests passed, 2 failed and 805 were skipped.

failed: Clangd.Clangd/semantic-highlighting.test
failed: LLVM.tools/llvm-ar/mri-utf8.test

Log files: cmake-log.txt, ninja_check_all-log.txt, CMakeCache.txt

hokein added inline comments.Oct 28 2019, 2:12 AM
clang-tools-extra/clangd/SemanticHighlighting.cpp
233

as we are not visiting this base TypeLoc in this patch, will we miss any interesting TypeLocs (e.g. FunctionTypeLoc)?

ilya-biryukov added inline comments.Oct 28 2019, 2:35 AM
clang-tools-extra/clangd/SemanticHighlighting.cpp
233

We didn't do anything interesting with function type locs before this patch as well.
This patch aims to produce equivalent results in all cases except the primitive types (and spell out those cases explicitly by implementing corresponding Visit*TypeLoc methods).

hokein accepted this revision.Oct 28 2019, 3:18 AM
hokein added inline comments.
clang-tools-extra/clangd/SemanticHighlighting.cpp
233

ah, yes, thanks for the explanation, I was over-concerned.

This revision is now accepted and ready to land.Oct 28 2019, 3:18 AM
This revision was automatically updated to reflect the committed changes.

Thanks for the review!