You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When refactoring existing configuration, one of the actions users may want to take is to extract an expression into a variable, to make the configuration more flexible/reusable and better communicate intentions. This is especially relevant if the configuration represents a published module or the refactoring has the intentions of turning it into one.
Implement refactor.extract code action for any interpolatable expression inside of resource
Implement refactor.extract code action for any interpolatable expression inside of data
Implement refactor.extract code action for any interpolatable expression (inputs) inside of module
Implement refactor.extract code action for any interpolatable expression (value) inside of output
Implement refactor.extract code action for any interpolatable expression inside of provider
Implement refactor.extract code action for any expression inside of locals
Implement refactor.extract code action for id inside of import
Implement refactor.extract code action for any interpolatable expression inside of check
Implementation Notes
There will be edge cases related to pre-existing interpolation involving function calls or references (which are not allowed inside of variable default).
Background
When refactoring existing configuration, one of the actions users may want to take is to extract an expression into a variable, to make the configuration more flexible/reusable and better communicate intentions. This is especially relevant if the configuration represents a published module or the refactoring has the intentions of turning it into one.
For example, they may start with:
and want to end up with:
Proposal
refactor.extract
code action for any interpolatable expression inside ofresource
refactor.extract
code action for any interpolatable expression inside ofdata
refactor.extract
code action for any interpolatable expression (inputs) inside ofmodule
refactor.extract
code action for any interpolatable expression (value) inside ofoutput
refactor.extract
code action for any interpolatable expression inside ofprovider
refactor.extract
code action for any expression inside oflocals
refactor.extract
code action forid
inside ofimport
refactor.extract
code action for any interpolatable expression inside ofcheck
Implementation Notes
There will be edge cases related to pre-existing interpolation involving function calls or references (which are not allowed inside of variable
default
).For example, the user starts with:
We can consider different solutions for such edge cases:
Related: Extraction into a local value may be a better choice here.
The text was updated successfully, but these errors were encountered: