Search code examples
typescriptwebstorm

Extract variable to const by default in Webstorm


In WebStorm, the keyboard shortcut Ctrl + Alt + V allows to extract the selected text to a variable :

extract to variable

Most of the time, I need to extract the variable to a const but WebStorm extracts it to a let by default.

How can I change this behavior ?


Solution

  • There is no way to change defaults ( see WEB-26073); but, once you select const type, it will be suggested by default on next refactoring invocation