Support backend config files (for init -backend-config=PATH
)
#518
Labels
enhancement
New feature or request
textDocument/completion
textDocument/hover
textDocument/publishDiagnostics
textDocument/semanticTokens
Semantic syntax highlighting
Depends on #285
Current Version
Use-cases
Some users declare the configuration for their state backend via config files, as documented at https://www.terraform.io/docs/language/settings/backends/configuration.html#partial-configuration
Typically such files would be committed within the repository, but there was no established convention for names of such files until recently. Some people seem call them
backend.hcl
.A new convention was therefore established:
*.<backend-name>.tfbackend
to be communicated asterraform-backend-NAME
language ID.Users would benefit from having the same level of support they get for Terraform configurations (
*.tf
) for these files too.Completion
In an empty
*.s3.tfbackend
file, completion would bring up e.g. following fields:Hover
If user hovers over
bucket
in the following configthey would be presented with a popup with details about the field, e.g.
Semantic Tokens
All valid attributes would be reported as attribute tokens and compatible expressions would be highlighted as such.
i.e.
bucket
would be reported as attribute and"terraform-state-prod"
would be reported as string.Diagnostics
Duplicate attributes, or invalid config (e.g. unknown attribute or wrong type for known attribute) would be reported upon save of the file. For example
would yield the following (or similar) diagnostic
Proposal
Establish a naming convention, such that we know what backend type is the configuration for, e.g.*.s3.tfbackend
*.tfbackend
filesLanguageID
in all relevant RPC methods, e.g.textDocument/didOpen
textDocument/didSave
textDocument/didChange
textDocument/completion
textDocument/hover
textDocument/semanticTokens
textDocument/documentLink
(basically to be ignored as there's most likely no linkable content)textDocument/formatting
textDocument/publishDiagnostics
The text was updated successfully, but these errors were encountered: