It it possible to have a warning showing that a public method is unused?

In my angular/ts project webstorm tells me when a private method is not being used (method name will be grey), but is does not show any information when a public method is not being used anywhere.

Any clue on this?

I'm using PHP Strom 2019.3 with Angular/typescript

 

Thank you.

 

10 comments
Comment actions Permalink

Is JavaScript | General | Unused global symbol inspection enabled in Settings | Editor | Inspections? It normally reports unused public methods. If enabling inspection doesn't help, try invalidating caches (File > Invalidate caches, Invalidate and Restart).

BTW, what's a result on searching for your public method usages (Alt+F7, Find Usages in method right-click menu)?

0
Comment actions Permalink

Thank you for your reply.

 

I already had the setting "Unused global symbol " as suggested. I also invalidated caches&restart but still no changes: there isn't any information about the method not being used.  Not  even if i inspect code (code/inspect Code...)

 

Curiously, if i try to find usages of that method, it gives me the right message: "no usages found in project Files" 

0
Comment actions Permalink

can you reproduce the issue in a new project (File -> New Project -> Static Web -> Angular CLI, for example)?

0
Comment actions Permalink

I am having the same issue in WebStorm 2020.2

Unused properties defined in Typescript class are not highlighted but the message is good: "No usaged found in All Places".

How can we fix this? The settings mentioned above are well configured but the IDE is still not working as the setup says it should.

 

 

1
Comment actions Permalink

Works fine for me, I need a test project to see what's going it

0
Comment actions Permalink

I am trying to reproduce this behaviour Jolteteofil mentioned in a dedicated repo, but it is not possible. It might have something to do with the overall size of the project. 

In my test repo everything works fine (I copied the "buggy" code in it). In the actual project it does not show unused methods. 

0
Comment actions Permalink

i have the same issue, it's not able to show warning on un-used public method inside a class. 

0
Comment actions Permalink

is there any updated on this issue

0

Please sign in to leave a comment.