nvim: lsp: Fix diagnostic errors
This commit is contained in:
parent
8aa4fc2f76
commit
cf78dcae4d
|
@ -7,7 +7,7 @@ local util = require 'lspconfig/util'
|
||||||
local cmp = require 'cmp_nvim_lsp'
|
local cmp = require 'cmp_nvim_lsp'
|
||||||
|
|
||||||
-- https://github.com/neovim/nvim-lspconfig/wiki/User-contributed-tips
|
-- https://github.com/neovim/nvim-lspconfig/wiki/User-contributed-tips
|
||||||
function format_range_operator()
|
function FormatRangeOperator()
|
||||||
local old_func = vim.go.operatorfunc
|
local old_func = vim.go.operatorfunc
|
||||||
_G.op_func_formatting = function()
|
_G.op_func_formatting = function()
|
||||||
local start = vim.api.nvim_buf_get_mark(0, '[')
|
local start = vim.api.nvim_buf_get_mark(0, '[')
|
||||||
|
@ -122,7 +122,7 @@ local on_attach = function(client, bufnr)
|
||||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'pd' , '<cmd>lua PeekDefinition()<CR>' , opts)
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'pd' , '<cmd>lua PeekDefinition()<CR>' , opts)
|
||||||
|
|
||||||
if client.resolved_capabilities.document_range_formatting then
|
if client.resolved_capabilities.document_range_formatting then
|
||||||
vim.api.nvim_buf_set_keymap(bufnr, 'x', 'gq', '<cmd>lua format_range_operator()<CR>', opts)
|
vim.api.nvim_buf_set_keymap(bufnr, 'x', 'gq', '<cmd>lua FormatRangeOperator()<CR>', opts)
|
||||||
end
|
end
|
||||||
if client.resolved_capabilities.document_formatting then
|
if client.resolved_capabilities.document_formatting then
|
||||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gq', '<cmd>lua vim.lsp.buf.formatting()<CR>', opts)
|
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gq', '<cmd>lua vim.lsp.buf.formatting()<CR>', opts)
|
||||||
|
@ -232,7 +232,6 @@ local rust_tool_opts = {
|
||||||
show_parameter_hints = true,
|
show_parameter_hints = true,
|
||||||
parameter_hints_prefix = "<- ",
|
parameter_hints_prefix = "<- ",
|
||||||
other_hints_prefix = "=> ",
|
other_hints_prefix = "=> ",
|
||||||
other_hints_prefix = "",
|
|
||||||
highlight = "Hint",
|
highlight = "Hint",
|
||||||
},
|
},
|
||||||
hover_actions = {
|
hover_actions = {
|
||||||
|
@ -283,7 +282,7 @@ nvim_lsp.clangd.setup {
|
||||||
|
|
||||||
require('rust-tools').setup(rust_tool_opts)
|
require('rust-tools').setup(rust_tool_opts)
|
||||||
|
|
||||||
library, runtime_path, lua_version = determine_setup_lua()
|
local library, runtime_path, lua_version = determine_setup_lua()
|
||||||
nvim_lsp.sumneko_lua.setup {
|
nvim_lsp.sumneko_lua.setup {
|
||||||
cmd = { "/usr/bin/lua-language-server" };
|
cmd = { "/usr/bin/lua-language-server" };
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
|
|
Loading…
Reference in a new issue