Discussion: Test coverage for RemoveUnusedImports in conditional compilation contexts

I’ve been working on improving RemoveUnusedImports to handle imports inside conditional compilation blocks as discussed in #2335. I’m planning to expand the test coverage around this behaviour, and this thread is intended to gather feedback on which scenarios are worth covering.

I’m currently considering tests for:

  • Removing imports from active #if clauses

  • Not removing imports from inactive #if / #elseif clauses

  • Ignoring imports inside #if false blocks

  • Treating imports inside #if true like top-level imports

  • Mixed top-level and conditional imports

  • Nested inactive conditional regions

I’ve started prototyping support for active #if clauses in this PR: PR of the tests.

Would appreciate any guidance on which of these cases should be included.