Fix(lsp-terraform): Adapt keywords to use underscores for lsp-mode core compatibility#4806
Fix(lsp-terraform): Adapt keywords to use underscores for lsp-mode core compatibility#4806StepaniaH wants to merge 2 commits intoemacs-lsp:masterfrom
Conversation
|
It looks like there is a compile error: 🤔 |
|
These initial changes was originally done by me when implementing the terraform lsp client. IIRC, having it like |
Actually, I rarely write Terraform-related codes. I modified it only because this compilation error in it caused issues with the overall LSP configuration when I reset my Emacs. At least for now, the modified code runs well in my environment. And I will try to re-verify and reproduce the issue at a later time in the near future. If there is any further information, I will promptly sync it with you. |

This PR fixes compilation errors in
clients/lsp-terraform.elwhen used with recent versions oflsp-mode20250531.742`Fixes #4805
Problem:
The
lsp-terraform.elfile (which has not been updated in the main repository for approximately a year) started failing to compile. The errors consistently followed the pattern:Error: Unknown key: :some-key-with-hyphen. Available keys: (... :some_key_with_underscore ...)This occurred for several multi-word keywords within
lsp-defundestructuring forms, such as:docs-link(expected:docs_link) and:provider-requirements(expected:provider_requirements).This suggests a change in
lsp-modecore's keyword handling or its internal type definitions for data related toterraform-ls, now favoring/expecting underscores for these specific multi-word keys.Solution:
This PR updates the affected keywords in
lsp-terraform.elwithinlsp-defunparameter destructuring (for types like&terraform-ls:Module,&terraform-ls:Providers, etc.) to use the underscore convention, matching the "Available keys" provided in the compilation error messages. Corresponding local variable names have also been updated to use underscores.These changes allow
lsp-terraform.elto compile successfully with the currentlsp-modecore.