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.
Please sign in to leave a 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!"