Suggestion: Convert Magic Number to Constant

Idea for the next version of ReSharper:

If you highlight any number and hit Alt+Enter, it should suggest "Convert to Constant".

I've been refactoring some old legacy code containing a few magic numbers, and thought many times that this would be a useful feature.

1 comment

Hello Andrew,

Right now you can just select a magic number, invoke Introduce Variable (or
Field) and introduce it as a constant. Let me know if this satisfies your
needs. Thank you!

Andrey Serebryansky
Senior Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

Idea for the next version of ReSharper:

If you highlight any number and hit Alt+Enter, it should suggest
"Convert to Constant".

I've been refactoring some old legacy code containing a few magic
numbers, and thought many times that this would be a useful feature.

---
Original message URL:
http://devnet.jetbrains.net/message/5308720#5308720



0

Please sign in to leave a comment.