nvim: lsp: Fix diagnostic errors
This commit is contained in:
parent
8aa4fc2f76
commit
cf78dcae4d
1 changed files with 3 additions and 4 deletions
|
@ -7,7 +7,7 @@ local util = require 'lspconfig/util'
|
|||
local cmp = require 'cmp_nvim_lsp'
|
||||
|
||||
-- https://github.com/neovim/nvim-lspconfig/wiki/User-contributed-tips
|
||||
function format_range_operator()
|
||||
function FormatRangeOperator()
|
||||
local old_func = vim.go.operatorfunc
|
||||
_G.op_func_formatting = function()
|
||||
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)
|
||||
|
||||
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
|
||||
if client.resolved_capabilities.document_formatting then
|
||||
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,
|
||||
parameter_hints_prefix = "<- ",
|
||||
other_hints_prefix = "=> ",
|
||||
other_hints_prefix = "",
|
||||
highlight = "Hint",
|
||||
},
|
||||
hover_actions = {
|
||||
|
@ -283,7 +282,7 @@ nvim_lsp.clangd.setup {
|
|||
|
||||
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 {
|
||||
cmd = { "/usr/bin/lua-language-server" };
|
||||
on_attach = on_attach,
|
||||
|
|
Loading…
Reference in a new issue