Highlighting Indexer: Support cross-hl context checking
ClosedPublic

Authored by dhaumann on Dec 16 2017, 6:32 PM.

Details

Summary

Previously, context references of the form "Comment##C++" were ignored.
With this patch, context cross language references are correctly taken
into account. As result, we can now detect unused contexts correctly
in all cases. To make this work, the ContextChecker had to be moved
to before the loop over all hl files.

As result, the GNU Macros are now not showing up as false positive
anymore.

Test Plan

make && make test, manual testing

Diff Detail

Repository
R216 Syntax Highlighting
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
dhaumann created this revision.Dec 16 2017, 6:32 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptDec 16 2017, 6:32 PM
Restricted Application added a subscriber: Frameworks. · View Herald Transcript
dhaumann requested review of this revision.Dec 16 2017, 6:32 PM
vkrause accepted this revision.Dec 17 2017, 9:30 AM
This revision is now accepted and ready to land.Dec 17 2017, 9:30 AM
dhaumann updated this revision to Diff 24003.Dec 17 2017, 11:40 AM

Cleanups

  • ContextChecker::check(): use 'success' bool correctly (was unused before)
  • remove m_ for member variables in the Language helper class
  • turn firstContext into a bool and immediately add the first context to the usedContextList
vkrause accepted this revision.Dec 17 2017, 11:42 AM
This revision was automatically updated to reflect the committed changes.