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 = {
|
2024-09-07 07:41:21 -05:00
|
|
|
diagnostics = { globals = { 'vim' } },
|
2024-03-23 03:27:49 -05:00
|
|
|
telemetry = { enable = false },
|
|
|
|
},
|
|
|
|
}
|
|
|
|
})
|
2024-04-03 12:53:42 -05:00
|
|
|
|
2024-05-17 15:12:24 -05:00
|
|
|
lspconfig.ocamllsp.setup {}
|
2024-05-21 19:10:50 -05:00
|
|
|
|
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,
|
|
|
|
})
|
|
|
|
|
2024-05-19 17:30:00 -05:00
|
|
|
-- Enable inlay hints for Rust
|
2024-04-18 18:15:51 -05:00
|
|
|
vim.api.nvim_create_autocmd("LspAttach", {
|
|
|
|
pattern = "*.rs",
|
2024-05-19 17:30:00 -05:00
|
|
|
callback = function()
|
|
|
|
vim.lsp.inlay_hint.enable(true)
|
2024-04-03 12:53:42 -05:00
|
|
|
end,
|
|
|
|
})
|