Lifted the helper for spelling one scope from another from
SemaCodeComplete -> AST, to reuse it. It should be useful in other contexts too.
Details
- Reviewers
ilya-biryukov
Diff Detail
- Repository
- rC Clang
- Build Status
Buildable 33141 Build 33140: arc lint + arc unit
Event Timeline
One major drawback that I see is the lack of indentation (and other format options) in the added code.
Should we have this fix at a higher level that can have formatting (either now or in the future)? E.g. in clangd directly?
lib/Sema/SemaStmt.cpp | ||
---|---|---|
1208 | Maybe always put each case on a new line? |
I don't think we need to worry about formatting, that's the IDE's job (and whatever formatter it uses).
In general, the code that knows how to warn should also be the one that knows how to fix it, this looks like a good place to me.
Can we unblock this ? Probably this anymore though.
I don't think formatting concerns should block progress on this; we expect users to run clang-format to fix formatting issues instead of hoping the fix-it system gets it right.
That's the general approach for clang-tidy use too, rely on clang-format for formatting the fixes.
Maybe always put each case on a new line?
From my experience, having multiple cases on the same line is not very common.