|
9 | 9 | --- Merges the default config with `vim.g.haskell_tools`.
|
10 | 10 | ---@brief ]]
|
11 | 11 |
|
12 |
| -local deps = require('haskell-tools.deps') |
13 |
| - |
14 | 12 | ---@type haskell-tools.Config
|
15 | 13 | ---@diagnostic disable-next-line: missing-fields
|
16 | 14 | local HTConfig = {}
|
17 | 15 |
|
18 |
| -local ht_capabilities = vim.lsp.protocol.make_client_capabilities() |
19 |
| -local cmp_capabilities = deps.if_available('cmp_nvim_lsp', function(cmp_nvim_lsp) |
20 |
| - return cmp_nvim_lsp.default_capabilities() |
21 |
| -end, {}) |
22 |
| -local selection_range_capabilities = deps.if_available('lsp-selection-range', function(lsp_selection_range) |
23 |
| - return lsp_selection_range.update_capabilities {} |
24 |
| -end, {}) |
25 |
| -local folding_range_capabilities = deps.if_available('ufo', function(_) |
26 |
| - return { |
27 |
| - textDocument = { |
28 |
| - foldingRange = { |
29 |
| - dynamicRegistration = false, |
30 |
| - lineFoldingOnly = true, |
31 |
| - }, |
32 |
| - }, |
33 |
| - } |
34 |
| -end, {}) |
35 |
| -local capabilities = vim.tbl_deep_extend( |
36 |
| - 'force', |
37 |
| - ht_capabilities, |
38 |
| - cmp_capabilities, |
39 |
| - selection_range_capabilities, |
40 |
| - folding_range_capabilities |
41 |
| -) |
42 |
| - |
43 | 16 | ---@class haskell-tools.Config haskell-tools.nvim plugin configuration.
|
44 | 17 | local HTDefaultConfig = {
|
45 | 18 |
|
@@ -155,7 +128,7 @@ local HTDefaultConfig = {
|
155 | 128 | ---@type lsp.ClientCapabilities | nil LSP client capabilities.
|
156 | 129 | ---@see vim.lsp.protocol.make_client_capabilities
|
157 | 130 | ---@see vim.lsp.start
|
158 |
| - capabilities = capabilities, |
| 131 | + capabilities = vim.lsp.protocol.make_client_capabilities(), |
159 | 132 | ---@type table | (fun(project_root:string|nil):table) | nil The haskell-language-server settings or a function that creates them. To view the default settings, run `haskell-language-server generate-default-config`.
|
160 | 133 | settings = function(project_root)
|
161 | 134 | local ht = require('haskell-tools')
|
|
0 commit comments