Is there a way to deprecate a method and have RubyMine mark it ?

I'm using RubyMine mostly for Rails projects (mostly rails 3). I notice that calls of deprecated ActiveRecord etc methods are marked in my code. Is it possible to annotate our own methods as deprecated and have them marked by RubyMine?

If so, what style of annotation to use (If I understand correctly, there are multiple ways of marking methods as deprecated in ruby ( http://stackoverflow.com/questions/293981/best-practice-to-mark-deprecated-code-in-ruby ))

3 comments

Hi,

for Rails project you can place "ActiveSupport::Deprecation.warn" call at the beginning of a deprecated method and RM should treat it as deprecated.
With the latest EAP build you can also use @deprecated Yard tag.

Regards, Oleg.

0

I've tried both of these in current Momiji and didn't seem to work (unless there's something I need to do to either turn on yard, or refresh the code analysis)

0

Hi,

sorry for late response (we were busy with EAP).  It looks like a bug for methat we do not mark deprecated methods (perhaps I'm missing somthing but let's find out ;).
Could you please file a ticket about the problem in our tracker (http://youtrack.jetbrains.com/issues/RUBY) and please provide test project which demonstrate the problem.

Thanks in advance, Oleg.

0

Please sign in to leave a comment.