Skip to content

Commit

Permalink
fix(ts-qurry): Change to init options (emacs-lsp#4667)
Browse files Browse the repository at this point in the history
* fix(ts-qurry): Change to init options

* use init options
  • Loading branch information
jcs090218 authored Dec 31, 2024
1 parent c7a3fcb commit 5d96434
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions clients/lsp-ts-query.el
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,6 @@ and not the global storage."
(f-join lsp-ts-query-server-store-path
(pcase system-type ('windows-nt "ts_query_ls.exe") (_ "ts_query_ls"))))

(lsp-register-custom-settings
'(("ts_query_ls.settings.parser_install_directories" lsp-ts-query-parser-install-directories)
("ts_query_ls.settings.language_retrieval_patterns" lsp-ts-query-language-retrieval-patterns)))

(lsp-dependency
'ts-query-ls
'(:system "ts_query_ls")
Expand All @@ -112,6 +108,11 @@ or FILE-NAME."
(equal "scm" ext))
t)))

(defun lsp-ts-query--make-init-options ()
"Init options for ts-query server."
`( :parser_install_directories ,lsp-ts-query-parser-install-directories
:language_retrieval_patterns ,lsp-ts-query-language-retrieval-patterns))

(lsp-register-client
(make-lsp-client
:new-connection (lsp-stdio-connection
Expand All @@ -123,6 +124,7 @@ or FILE-NAME."
:activation-fn #'lsp-ts-query--check-enabled
:priority -1
:add-on? t
:initialization-options #'lsp-ts-query--make-init-options
:server-id 'ts-query-ls
:download-server-fn
(lambda (_client callback error-callback _update?)
Expand Down

0 comments on commit 5d96434

Please sign in to comment.