2021-07-15 00:50:07 +02:00
|
|
|
local M = {}
|
|
|
|
|
|
|
|
M.config = function()
|
2021-07-15 03:14:25 +02:00
|
|
|
O.lang.cmake = {
|
|
|
|
formatter = {
|
|
|
|
exe = "clang-format",
|
|
|
|
args = {},
|
|
|
|
},
|
2021-07-20 21:33:15 +02:00
|
|
|
lsp = {
|
|
|
|
path = DATA_PATH .. "/lspinstall/cmake/venv/bin/cmake-language-server",
|
|
|
|
},
|
2021-07-15 03:14:25 +02:00
|
|
|
}
|
2021-07-15 00:50:07 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
M.format = function()
|
|
|
|
-- TODO: implement formatters (if applicable)
|
|
|
|
return "No formatters configured!"
|
|
|
|
end
|
|
|
|
|
|
|
|
M.lint = function()
|
|
|
|
-- TODO: implement linters (if applicable)
|
|
|
|
return "No linters configured!"
|
|
|
|
end
|
|
|
|
|
|
|
|
M.lsp = function()
|
|
|
|
if require("lv-utils").check_lsp_client_active "cmake" then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
|
|
|
require("lspconfig").cmake.setup {
|
2021-07-20 21:33:15 +02:00
|
|
|
cmd = { O.lang.cmake.lsp.path },
|
2021-07-15 00:50:07 +02:00
|
|
|
on_attach = require("lsp").common_on_attach,
|
|
|
|
filetypes = { "cmake" },
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
M.dap = function()
|
|
|
|
-- TODO: implement dap
|
|
|
|
return "No DAP configured!"
|
|
|
|
end
|
|
|
|
|
|
|
|
return M
|