Support refactoring "Extract variable"
See original GitHub issueIn Intellij, for languages like Java, you have refactoring support. This might become very handy in the HCL plugin too to support Terraform refactorings.
The first refactoring I would like to see supported is to replace a constant value with a variable, given the constant value as a default
value.
On top of that, the existence of a file variables.tf
seems to be best practice although it is not necessarily needed. But if we follow best practices, the refactoring “Extract variable” should put the variable in the variables.tf
file and create this file when it doesn’t exist yet.
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Extract Variable - Refactoring.Guru
The main reason for extracting variables is to make a complex expression more understandable, by dividing it into its intermediate parts. These could...
Read more >Extract/Introduce variable - IntelliJ IDEA - JetBrains
In the editor, select an expression or its part that you want to extract. · Press Ctrl+Alt+V or from the main menu, select...
Read more >Refactoring source code in Visual Studio Code
Visual Studio Code supports refactoring operations (refactorings) such as Extract Method and Extract Variable to improve your code base from within your ...
Read more >Extract Variable - Refactoring
Extract Variable. open in web edition · How do I access the web edition? refactorgram. return order.quantity * order.itemPrice - Math.max(0, order.quantity ...
Read more >Extract variable - Help | IntelliJ IDEA - JetBrains
If you come across an expression that is hard to understand or it is duplicated in several places throughout you code, the Extract...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Here’s test version of plugin if you’d like to try new refactoring.
before:
after: