Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix(lsp-terraform): Adapt keywords to use underscores for lsp-mode core compatibility#4806

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
StepaniaH wants to merge2 commits intoemacs-lsp:master
base:master
Choose a base branch
Loading
fromStepaniaH:fix-terraform-docs-link-key

Conversation

@StepaniaH
Copy link

This PR fixes compilation errors inclients/lsp-terraform.el when used with recent versions oflsp-mode 20250531.742`

Fixes#4805

Problem:
Thelsp-terraform.el file (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 withinlsp-defun destructuring forms, such as:docs-link (expected:docs_link) and:provider-requirements (expected:provider_requirements).

This suggests a change inlsp-mode core'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 inlsp-terraform.el withinlsp-defun parameter 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 allowlsp-terraform.el to compile successfully with the currentlsp-mode core.

@github-actionsgithub-actionsbot added the clientOne or more of lsp-mode language clients labelMay 31, 2025
@jcs090218
Copy link
Member

It looks like there is a compile error: 🤔

Unknown key: :docs_link.  Available keys: (:name :docs-link :version :source-type :dependent-modules)

@StepaniaH
Copy link
Author

It looks like there is a compile error: 🤔

Unknown key: :docs_link.  Available keys: (:name :docs-link :version :source-type :dependent-modules)

It is interesting that when I reproduce it in a clean emacs environment (with emacs version 30.1 and lsp-mode-20250601.129), it showslsp-terraform.el:305:34: Error: Unknown key: :docs-link. Available keys: (:name :docs_link :version :source_type :dependent_modules).
Screenshot 2025-06-01 at 10 41 29

jcs090218 reacted with eyes emoji

@psibi
Copy link
Member

These initial changes was originally done by me when implementing the terraform lsp client. IIRC, having it likedocs_link didn't work correctly when interacting with the terraform language server.@StepaniaH Can you confirm that you are able to see module information on the terraform code with these changes ?

@StepaniaH
Copy link
Author

These initial changes was originally done by me when implementing the terraform lsp client. IIRC, having it likedocs_link didn't work correctly when interacting with the terraform language server.@StepaniaH Can you confirm that you are able to see module information on the terraform code with these changes ?

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.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

clientOne or more of lsp-mode language clientsdocumentation

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

lsp-terraform.el fails to compile with recent lsp-mode due to keyword style mismatch

3 participants

@StepaniaH@jcs090218@psibi

[8]ページ先頭

©2009-2025 Movatter.jp