-
Notifications
You must be signed in to change notification settings - Fork 141
Open
Labels
Description
Background
Code Actions make an important part of LSP and we can anticipate many use cases in Terraform: https://github.com/hashicorp/terraform-ls/issues?page=2&q=is%3Aopen+is%3Aissue+label%3AtextDocument%2FcodeAction
Therefore it is important to ensure new ones are easy to implement and existing easy to maintain. This can be achieved through appropriate abstraction layers.
Proposal
- Introduce Code Actions hcl-lang#363
- Ensure
DecoderContext
gets populated with all[]CodeActionImpl
- Update
textDocument/codeAction
handler to use the new abstraction layers
func (svc *service) TextDocumentCodeAction(ctx context.Context, params lsp.CodeActionParams) []lsp.CodeAction {
Implementation Notes
This issue intentionally does not focus on specific code actions, which are filled as separate issues. It is considered a dependency for all of them however. It is assumed that any/all of the linked code actions can be implemented on top of the logic this issue talks about.