Description
When trying to cargo build, given an example instruction named initialize_with_token_2022, it will fail with a message similar to:
unresolved import `super`
could not find `__cpi_client_accounts_initialize_with_token_2022` in `internal`
This seems to be due to the underscore being lost when converted to camel case (ie. ::client::args::InitializeWithToken2022) and then back to snake case, where the resulting module would be __cpi_client_accounts_initialize_with_token2022 instead of __cpi_client_accounts_initialize_with_token_2022.
Reproduction
Example IDL: https://solscan.io/account/LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj#programIdl
Attempt to use the declare_program! macro with the IDL that contains that instruction name.
Solutions and workaround
Since the discriminator is already specified, I fixed this by changing the instruction name to initialize_with_token2022 on the IDL. A solution would be to avoid converting from camel case into snake_case, as it's always ambiguous whether a number was separated by an from a word or not, another solution would be to always eliminate spaces between numbers and letters.