Disable inspection for "UNUSED_ANONYMOUS_PARAMETER" in project
Answered
I have these inspection warnings for unused parameters in lambdas and can't figure out how to disable them in the inspections settings globally for the project.
Example:
{parameter1,parameter2 -> do_something_with_parameter1}
The editor shows a warning for parameter2: 'Parameter 'parameter2' is never used, could be renamed to _..'.
I prefer to keep the parameter as is, since it is a reminder that I could use it and what the purpose of it is.
I can switch off the inspection by following the 'more actions...':
@file:Suppress("UNUSED_ANONYMOUS_PARAMETER")
That works. But how can I switch off these warning alltogether for the whole project. I couldn't find the respective setting. Any advise?
Please sign in to leave a comment.
Hi Roland,
You can disable the inspection in the list of available context actions (which is what More actions... opens) if you click on the arrow to the right of the quick-fix:
Hi Arina. Thanks for coming back so quickly. I tried that too. It just does not yield the desired effect.
After clicking on the 'Disable inspection' option the warning is still there.
The parameter in question here is d and it is marked with a warning as described in my initial post. When I follow the 'more actions' etc. I find that 'Disable inspection' option but it does not work.