Skip to content
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

Support for provider for_each #9

Open
1 task
apparentlymart opened this issue Jan 14, 2025 · 0 comments
Open
1 task

Support for provider for_each #9

apparentlymart opened this issue Jan 14, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@apparentlymart
Copy link

Language Server Version

n/a (not released yet)

Problem Statement

We'd like to ensure that the following new features are not incorrectly presented as errors and, ideally, support code completion and other features for them:

  • for_each argument inside a provider block. This currently supports only early evaluation, but since we plan to offer fully-dynamic support here before too long it might make sense to just implement code completion as normal expressions in the language server to avoid throwaway work.
  • provider argument in a resource/data block now supports dynamic instance keys, like aws.by_region["us-west-2"] or aws.by_region[each.key].
  • providers argument in a module block now also supports dynamic instance keys on the right-hand side of each element, using the same syntax as in the previous point.

Attempted Solutions

n/a

Proposal

Ideally support code completion and other such mechanisms for these new language features, but at the very least make sure that none of the new features are flagged as errors when used correctly.

Related LSP methods

  • textDocument/completion for the new arguments and their expressions
  • Possibly textDocument/definition for jumping from a provider reference in a provider/providers argument to the associated provider block, although that's not really for_each-specific so perhaps out of scope.

References

This was one of the deferred tasks from opentofu/opentofu#2123.

Help Wanted

  • I'm interested in contributing a fix myself

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant