andreasfertig / cppinsights

C++ Insights - See your source code with the eyes of a compiler
https://cppinsights.io
MIT License
4.08k stars 240 forks source link

Use `TranslationUnitDecl` handler instead of the previous matchers. #615

Closed andreasfertig closed 7 months ago

andreasfertig commented 7 months ago

This change introduces a TranslationUnit handler, replacing the previous matchers. The advantage is that all statements are processed, not only the ones where an exact match exists.

The new approach fixes #376, #500, and #588.

There is one disadvantage: for primary templates, some code is not reproduced as written. This causes one compile issue.

codecov[bot] commented 7 months ago

Codecov Report

Attention: Patch coverage is 96.57534% with 5 lines in your changes are missing coverage. Please review.

Project coverage is 98.03%. Comparing base (249f736) to head (c0f0420).

Files Patch % Lines
CfrontCodeGenerator.cpp 75.00% 2 Missing :warning:
CodeGenerator.cpp 98.14% 1 Missing :warning:
Insights.cpp 98.48% 1 Missing :warning:
InsightsHelpers.cpp 85.71% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #615 +/- ## ========================================== + Coverage 97.88% 98.03% +0.14% ========================================== Files 27 20 -7 Lines 5067 4880 -187 ========================================== - Hits 4960 4784 -176 + Misses 107 96 -11 ``` | [Flag](https://app.codecov.io/gh/andreasfertig/cppinsights/pull/615/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Andreas+Fertig) | Coverage Δ | | |---|---|---| | [ubuntu](https://app.codecov.io/gh/andreasfertig/cppinsights/pull/615/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Andreas+Fertig) | `97.97% <96.57%> (+0.14%)` | :arrow_up: | | [ubuntu-libcxx](https://app.codecov.io/gh/andreasfertig/cppinsights/pull/615/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Andreas+Fertig) | `98.03% <96.57%> (+0.14%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Andreas+Fertig#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.