ignatov / intellij-erlang

Erlang IDE
https://www.jetbrains.com/help/idea/2018.2/getting-started-with-erlang.html
Other
735 stars 120 forks source link

find usages of function works only on top clause. #115

Closed vovakyrychenko closed 7 years ago

vovakyrychenko commented 12 years ago
g(_X) -> ok;
g(_X) -> ok. % <- does not work here
ignatov commented 12 years ago

I thinks it's not an issue, but a feature. For what we need a reference on every clause?

vovakyrychenko commented 12 years ago

Just a convenience. One does not have to search for the top manually to find usages using ide.

deadok22 commented 11 years ago

I did some programming in Erlang and I think it would be awesome to have reference on every clause. It would enable us to improve 'Find usages' action. Say, you have the following code (copied from erlang interpreter):

meta(Meta, step) -> dbg_icmd:step(Meta);
meta(Meta, next) -> dbg_icmd:next(Meta);
meta(Meta, continue) -> dbg_icmd:continue(Meta);
meta(Meta, finish) -> dbg_icmd:finish(Meta).

here you can see how atoms are used to do completely different things depending on argument (it would be implemented using virtual functions or something like that in OO languages). So 'Find usages' could utilize this information to show, say, usages of function 'meta' with 'step' as it's second argument, before showing all other results. Same can be done in 'Go to declaration' action.