The new intellij upgrade (10.5) now shows a warning that some of the methods defined for a class are not being used. These methods are public and I plan on not using all of them as I have created them to support the API expected. I would like to disable this warning (not used for public methods in a class). Is there a way to do it?.
相关问题
- Configure gradle plugin based on future tasks
- How to make available “open this project in Intell
- IntelliJ 2017.1.2 GOLANG debug does not work on br
- JavaFX sample issue
- Could not import the newly generated play framewor
相关文章
- In IntelliJ IDEA, how can I create a key binding t
- IntelliJ IDEA can't open projects or add SDK o
- IntelliJ Subversion Authentication Required Dialog
- Kotlin Koans with EduTools plugin: “Failed to laun
- How to set up Intellij to run javap command on a p
- How to enable “type information” for streams retur
- How to add a project to build path in IntelliJ Ide
- How do I use Gradle bootRun with --args in Intelli
Here is the 2019 update for: IntelliJ IDEA 2018.3.2 (Community Edition) Build #IC-183.4886.37, built on December 17, 2018
Settings | Editor | Inspections | Declaration redundancy | Unused declaration
This is an old thread, but I ended up here faster than I could find a solution so I'm going to go ahead and share my findings. First, I am not sure if we are working with the same language (JS here,) but fiddling with the GUI-based tools, here is what I ended up with. The following code was giving me the infamous "not used" warning:
There goes the "Unused definition myMethod" The inspector ended up suggesting to ignore this specific issue by adding
right on top of this specific method so that the following code no longer results in this warning:
Other warnings (typoes etc..) still seem to show up, including unused local variables and parameters, so it seems to isolate this particular issue. The downside is that it tends to pollute your code if you have lots of it...
I think the best way to avoid the highlighting of that unused public methods is writing a couple of test for those methods in your API.
You can disable it for a single method like this
In the latest version, this options is under
Settings>Inspections>Java>Declaration redundancy>Unused declaration>Methods
uncheck options which are not required.I just clicked "suppress for statement" and webstorm prepended this: