Indeed, the examples you show here could all be done
with code actions.
You are right, but, as already mentioned, many language server
implementors decided otherwise and that's not going to change
because Emacs doesn't like code lenses.
Anyway, you made your point and that's fair enough.