Damus
Lesley Lai · 7w
Spent way too much time debugging this stupid bug. C-style switch statement is annoying. https://cdn.masto.host/mastodongamedevplace/media_attachments/files/116/726/279/637/589/184/original/8bed11ee1...
James Widman profile picture
@nprofile1q... this seems like the kind of thing that clangd could help with...

it already provides a code-action to auto-fill a switch with a case for each enumerator; so it seems like we ought to be able to set a config option that specifies a format string that clangd will use during auto-fill; like:

# ~/.clangd:
Completion:
NewEnumCaseFormat: "case %c: { abort(); }"
1
Lesley Lai · 7w
nostr:nprofile1qy2hwumn8ghj7un9d3shjtnyd968gmewwp6kyqpqzd6p99dvq75u96hrvzr6ukhas3ydy6830gtje245573pfvg54xqq38c5ug I wish static analysis can warn this, but neither my compiler (clang) nor clang-tidy did