dlang-community / D-Scanner

Swiss-army knife for D source code
Boost Software License 1.0
240 stars 80 forks source link

add BaseAnalyzerArguments to keep ctor changes sane #939

Closed WebFreak001 closed 11 months ago

WebFreak001 commented 11 months ago

also immediately makes tokens a part of it

This struct can for example precompute token indices for line endings.

I think this cleans up a little code debt and also allows automatic construction for most analyzers (not done in this PR) and with that also a cleaner way of introspecting configuration in the future for the INI config and passing it in through the constructor automatically.

The tokens array is available in each analyzer now, allowing to implement helper methods that operate with those, such as the diagnostic helpers.