add clippy support to rust and show detailed diagnostics on hover
This commit is contained in:
parent
fbdcb2f6ac
commit
6c688b5a55
@ -3,6 +3,7 @@ local u = require('utils')
|
|||||||
|
|
||||||
vim.cmd([[autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif]])
|
vim.cmd([[autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif]])
|
||||||
vim.cmd([[autocmd BufNewFile,BufRead *.md setlocal filetype=notes]])
|
vim.cmd([[autocmd BufNewFile,BufRead *.md setlocal filetype=notes]])
|
||||||
|
vim.cmd([[autocmd CursorHold * lua vim.lsp.diagnostic.show_line_diagnostics()]])
|
||||||
|
|
||||||
key('n', ';', ':Files<CR>', {})
|
key('n', ';', ':Files<CR>', {})
|
||||||
key('', '<C-n>', ':NERDTreeToggle<CR>', {})
|
key('', '<C-n>', ':NERDTreeToggle<CR>', {})
|
||||||
|
@ -64,6 +64,9 @@ for _, lsp in ipairs(servers) do
|
|||||||
if lsp == "lua" then
|
if lsp == "lua" then
|
||||||
config.settings = require'lsp.lua'
|
config.settings = require'lsp.lua'
|
||||||
end
|
end
|
||||||
|
if lsp == "rust" then
|
||||||
|
config.settings = require'lsp.rust'
|
||||||
|
end
|
||||||
nvim_lsp[lsp].setup(config)
|
nvim_lsp[lsp].setup(config)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
19
lua/lsp/rust.lua
Normal file
19
lua/lsp/rust.lua
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
local M = {
|
||||||
|
['rust-analyzer'] = {
|
||||||
|
assist = {
|
||||||
|
importGranularity = "module",
|
||||||
|
importPrefix = "by_self",
|
||||||
|
},
|
||||||
|
cargo = {
|
||||||
|
loadOutDirsFromCheck = true
|
||||||
|
},
|
||||||
|
procMacro = {
|
||||||
|
enable = true
|
||||||
|
},
|
||||||
|
checkOnSave = {
|
||||||
|
command = "clippy"
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return M
|
Loading…
x
Reference in New Issue
Block a user