disable lsps for conjure logs

This commit is contained in:
LordMZTE 2023-02-23 13:56:06 +01:00
parent 3f5186aec2
commit d6517d25de
Signed by: LordMZTE
GPG key ID: B64802DC33A64FF6
2 changed files with 12 additions and 4 deletions

View file

@ -4,6 +4,8 @@
(var args args)
(when (not args)
(set args {}))
(when (not (. args :on_attach))
(tset args :on_attach `check-conjure))
(tset args :capabilities `caps)
`((. lspc ,conf :setup) ,args))
@ -13,10 +15,18 @@
(tset caps :textDocument :foldingRange
{:dynamicRegistration false :lineFoldingOnly true})
;; Check if the buffer is a conjure log and stop the client if it is.
;; TODO: This doesn't work on popups, seems like on_attach isn't called.
(fn check-conjure [client buf]
(when (vim.startswith (vim.fs.basename (vim.api.nvim_buf_get_name buf))
:conjure-)
(client.stop)))
(fn disable-formatter [client _]
(tset client :server_capabilities :documentFormattingRangeProvider false))
(setup :clangd {:on_attach disable-formatter})
(setup :clangd {:on_attach (fn [c b] (disable-formatter c b)
(check-conjure c b))})
(setup :cssls)
(setup :elixirls {:cmd [:elixir-ls]})
(setup :eslint)

View file

@ -67,9 +67,7 @@
(use/pconf use :CKolkey/ts-node-action :tsn-actions
{:requires :jose-elias-alvarez/null-ls.nvim})
(use :nvim-treesitter/playground)
(use {1 :Olical/conjure
;; TODO: stop LSPs from attaching to conjure log
:config #(set vim.g.conjure#mapping#prefix :<F1>)})
(use {1 :Olical/conjure :config #(set vim.g.conjure#mapping#prefix :<F1>)})
(cmp-plugins use))
((. (require :packer) :startup) init)