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

fix(lsp-protocol.el): Fix unknown keys in lsp-terraform #3757

Closed
wants to merge 1 commit into from

Conversation

jcs090218
Copy link
Member

When (require 'lsp-terraform) we get the error,

lsp-terraform.el:269:34: Error: Unknown key: :docs-link.  Available keys: (:name :docs_link :version :source_type :dependent_modules)

@psibi Not sure if this is the correct fix. Can you confirm this? 😕

@jcs090218 jcs090218 requested a review from psibi October 12, 2022 09:27
@psibi
Copy link
Member

psibi commented Oct 12, 2022

@jcs090218 I don't think it's right as the language server documention explicitly has those keys: https://github.com/hashicorp/terraform-ls/blob/main/docs/commands.md#modulecalls

@jcs090218
Copy link
Member Author

So the solution should be another way around? Should we change those keys in lsp-terraform.el?

(lsp-defun construct-tf-module ((&terraform-ls:Module :name :docs-link :version :source-type :dependent-modules))

(lsp-defun lsp-terraform-ls--providers-to-tf-package ((&terraform-ls:Providers :provider-requirements :installed-providers))

Do you have any idea on how to fix this? Thanks! 😅

@psibi
Copy link
Member

psibi commented Oct 12, 2022

@jcs090218 Sorry, I don't think I have a good idea on how to fix it since I'm using the key name corresponding to the one used and sent at the terraform language server side.

Should we change those keys in lsp-terraform.el?

I think I tried it before, but it didn't work. But I could be mis-remembering.

@yyoncho
Copy link
Member

yyoncho commented Oct 12, 2022

the keys should be changed in the caller. It is just that lsp-protocol does not convert _ into -.

@github-actions github-actions bot added the client One or more of lsp-mode language clients label Oct 12, 2022
@jcs090218
Copy link
Member Author

I made another changes but the CI failed.

clients/lsp-terraform.el:268:1: Error: Unknown key: :docs_link.  Available keys: (:name :docs-link :version :source-type :dependent-modules)

TBH, I don't know why since it does compile in my workspace.

@jcs090218
Copy link
Member Author

Ah, okay. I realized I would have to remove lsp-mode completely, and should not use package.el to upgrade packages. Not sure why package.el fail to upgrade lsp-mode (maybe not just this package), sorry for the noise. 😓

@jcs090218 jcs090218 closed this Oct 12, 2022
@jcs090218 jcs090218 deleted the fix/lsp-terraform branch October 12, 2022 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client One or more of lsp-mode language clients
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants