blob: 87633cd964c5eb3e23b35cd3cbd861b92d6a6c0d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
local lsp_attach = require "pi.lsp.attach"
local lsp_flags = require "pi.lsp.flags"
return function(ops)
local capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities())
local config = {
on_attach = lsp_attach,
flags = lsp_flags,
capabilities = vim.tbl_deep_extend("force", capabilities, {
offsetEncoding = { "utf-16" },
general = {
positionEncodings = { "utf-16" },
},
}),
}
if vim.fn.executable "clangd" == 1 then
config.cmd = { "clangd" }
end
return vim.tbl_extend("force", config, ops)
end
|