neovim: Restore some lost LSP config
This commit is contained in:
parent
6931683c55
commit
e90e16dafe
3 changed files with 26 additions and 2 deletions
|
|
@ -108,7 +108,7 @@ local theme = lush(function(injected_functions)
|
|||
Error { fg = '#EEEEEE', bg = '#AF0000' }, -- Any erroneous construct
|
||||
Todo { fg = '#D70000' }, -- Anything that needs extra attention; mostly the keywords TODO FIXME and XXX
|
||||
|
||||
LspInlayHint { fg = '#777777' },
|
||||
LspInlayHint { Comment },
|
||||
LspReferenceText {} , -- Used for highlighting "text" references
|
||||
LspReferenceRead {} , -- Used for highlighting "read" references
|
||||
LspReferenceWrite {} , -- Used for highlighting "write" references
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ local theme = lush(function(injected_functions)
|
|||
Error { fg = '#000000', bg = '#FF5F00' }, -- Any erroneous construct
|
||||
Todo { fg = '#FF0000' }, -- Anything that needs extra attention; mostly the keywords TODO FIXME and XXX
|
||||
|
||||
LspInlayHint { fg = '#015F00' },
|
||||
LspInlayHint { Comment },
|
||||
LspReferenceText {} , -- Used for highlighting "text" references
|
||||
LspReferenceRead {} , -- Used for highlighting "read" references
|
||||
LspReferenceWrite {} , -- Used for highlighting "write" references
|
||||
|
|
|
|||
|
|
@ -1,5 +1,29 @@
|
|||
vim.lsp.inlay_hint.enable(true)
|
||||
|
||||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
group = vim.api.nvim_create_augroup('jdkaplan.lsp', {}),
|
||||
callback = function(args)
|
||||
local client = assert(vim.lsp.get_client_by_id(args.data.client_id))
|
||||
|
||||
if client:supports_method('textDocument/completion') then
|
||||
vim.lsp.completion.enable(true, client.id, args.buf, {autotrigger = false})
|
||||
end
|
||||
|
||||
-- Usually not needed if server supports "textDocument/willSaveWaitUntil".
|
||||
already_waits = client:supports_method('textDocument/willSaveWaitUntil')
|
||||
can_fmt = client:supports_method('textDocument/formatting')
|
||||
if not already_waits and can_fmt then
|
||||
vim.api.nvim_create_autocmd('BufWritePre', {
|
||||
group = vim.api.nvim_create_augroup('jdkaplan.lsp', {clear=false}),
|
||||
buffer = args.buf,
|
||||
callback = function()
|
||||
vim.lsp.buf.format({ bufnr = args.buf, id = client.id, timeout_ms = 1000 })
|
||||
end,
|
||||
})
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
return {
|
||||
-- HUD
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue