2024-03-13 14:07:20 -05:00
|
|
|
local lspconfig = require('lspconfig')
|
2024-04-03 12:53:42 -05:00
|
|
|
local map = vim.keymap.set
|
2024-04-02 01:37:22 -05:00
|
|
|
|
2024-05-17 15:12:24 -05:00
|
|
|
lspconfig.pyright.setup({
|
2024-04-02 01:37:22 -05:00
|
|
|
settings = {
|
|
|
|
python = {
|
|
|
|
analysis = {
|
|
|
|
typeCheckingMode = "off"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
2024-03-23 03:27:49 -05:00
|
|
|
|
|
|
|
lspconfig.lua_ls.setup({
|
|
|
|
settings = {
|
|
|
|
Lua = {
|
|
|
|
telemetry = { enable = false },
|
|
|
|
},
|
|
|
|
}
|
|
|
|
})
|
2024-04-03 12:53:42 -05:00
|
|
|
|
2024-05-17 15:12:24 -05:00
|
|
|
lspconfig.ocamllsp.setup {}
|
|
|
|
|
2024-05-18 17:17:52 -05:00
|
|
|
lspconfig.hls.setup {}
|
|
|
|
|
2024-04-03 12:53:42 -05:00
|
|
|
-- Set ;k to hover and ;a to show code actions
|
|
|
|
vim.api.nvim_create_autocmd("LspAttach", {
|
2024-04-03 15:25:09 -05:00
|
|
|
callback = function()
|
2024-04-03 12:53:42 -05:00
|
|
|
map('n', '<localleader>k', vim.lsp.buf.hover, { remap = false })
|
|
|
|
map('n', '<localleader>a', vim.lsp.buf.code_action, { remap = false })
|
2024-04-18 18:15:51 -05:00
|
|
|
map('n', '<localleader>d', vim.diagnostic.open_float, { remap = false })
|
|
|
|
end,
|
|
|
|
})
|
|
|
|
|
|
|
|
-- Enable inlay hints (needs rework after nvim>=0.10)
|
|
|
|
vim.api.nvim_create_autocmd("LspAttach", {
|
|
|
|
pattern = "*.rs",
|
|
|
|
callback = function(args)
|
|
|
|
if not (args.data and args.data.client_id) then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
local bufnr = args.buf
|
|
|
|
local client = vim.lsp.get_client_by_id(args.data.client_id)
|
|
|
|
require("lsp-inlayhints").on_attach(client, bufnr)
|
2024-04-03 12:53:42 -05:00
|
|
|
end,
|
|
|
|
})
|