-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adding a refactor function - refactor.extract.propToOutput
#1526
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @ziyeqf
I am actively researching Code Actions and that includes how we can make it easier and more intuitive to add new ones.
We generally track all the Terraform-specific schema, which includes the addressing schema of all blocks, including resource
, here: https://github.com/hashicorp/terraform-schema so it is unlikely we'd be open to re-implementing any of that here in terrafom-ls
.
This also implies that in order to support code actions as first class citizens we will need to make some changes to https://github.com/hashicorp/hcl-lang
I am anticipating we will end up with an interface similar to the one we have there for code lenses:
- https://pkg.go.dev/github.com/hashicorp/[email protected]/decoder#Decoder.CodeLensesForFile
- https://pkg.go.dev/github.com/hashicorp/[email protected]/lang#CodeLensFunc
I am however not ready to commit to any particular design yet as this area is being actively researched and we need to consider the needs of different kinds of common actions before implementing anything.
Your ideas and contributions in #1525 will certainly help us in that respect as we can validate the design against them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a plan for introducing some abstraction layers first before we begin to introduce more code actions. This is to ensure they all stay reasonably maintainable as we can anticipate many more will come.
I outlined some more details in #1575 but this is mostly for transparency, not in the anticipation of an external contributor picking up any of that work. We do expect external contributors like you to participate in maintaining those individual code actions however, which will hopefully make use of the abstraction layers.
I know this may not be the answer you were hoping for but I prefer to be honest and open, even if that implies high likelihood of the PR being closed in the near term and/or need significant rewrite later.
For now I'm putting it on hold and a team member will revisit this PR later. I cannot commit to any timeline at this point unfortunately.
Thank you for your effort and understanding!
It's going to adding a code action to extract an existing property of a resource to a
output
block.test
As description in #1525, I'm trying to add some code actions.
Thanks in advance for any suggestion and insight.