-
Notifications
You must be signed in to change notification settings - Fork 20
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
Send settings on client initialization #125
Conversation
Send settings on LSP client initialization. Note jsonnet-language-server is unusual and expects configuration without a prefix. This is probably a bug in jsonnet-language-server, but this PR works with the existing code by passing through the "jsonnet" settings subtree, without the "jsonnet" prefix. Example: ```elisp ;; .emacs (lsp-register-custom-settings '(("jsonnet.formatting" ;; jsonnetfmt --string-style d --comment-style s ((StringStyle . "double") (CommentStyle . "slash"))))) ```
@jdbaldry, leaving this one to you 😄 |
(with-lsp-workspace workspace | ||
(lsp--set-configuration | ||
;; TODO: jsonnet-language-server settings should use a prefix | ||
(ht-get (lsp-configuration-section "jsonnet") "jsonnet")))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question
Does this introduce a dependency on ht
?
Research
It is already a transitive dependency since it is required by lsp-mode
(https://github.com/emacs-lsp/lsp-mode/blob/master/lsp-mode.el#L39)
Follow up question
Does this usage mean that this package should also declare the dependency explicitly?
Initial thought
I'm not at all an expert on Emacs packages but I'd assume it's safest to add the dependency explicitly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If lsp-mode stops using ht
here, then this code is wrong and won't work. So I don't think an explicit dependency improves anything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, thanks for checking :)
Also would you mind signing the CLA? |
Thanks for the contribution! |
Send settings on LSP client initialization. Note jsonnet-language-server is unusual and expects configuration without a prefix. This is probably a bug in jsonnet-language-server, but this PR works with the existing code by passing through the "jsonnet" settings subtree, without the "jsonnet" prefix.
Example: