summaryrefslogtreecommitdiff
path: root/fnl/plugins/lsp/lspconfig.fnl
blob: a778eb356f4a3b3c9d81fdfea201f1a4ab9e1fe1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
;; Configuration for lsp clients.

(fn on-attach []
  (vim.api.nvim_create_autocmd :LspAttach
                               {:callback (fn [args]
                                            (let [keymaps (require :plugins.lsp.keymaps)
                                                  buffer (. args :buf)]
                                              (keymaps.on-attach buffer)))}))

(fn config []
  (on-attach)
  (let [diagnostics (require :plugins.lsp.diagnostics)
        mason-lspconfig (require :plugins.lsp.mason-lspconfig)
        ui (require :lspconfig.ui.windows)]
    (set ui.default_options.border :single)
    (diagnostics.setup)
    (mason-lspconfig.setup)))

{1 :neovim/nvim-lspconfig
 :event [:BufReadPost :BufNewFile]
 :dependencies [:mason.nvim
                :williamboman/mason-lspconfig.nvim
                :b0o/schemastore.nvim
                :hrsh7th/cmp-nvim-lsp]
 : config}