fixed rust-tools and lspconfig
This commit is contained in:
parent
2a093ca138
commit
069e35a99c
|
|
@ -10,15 +10,15 @@ local utils = require "core.utils"
|
|||
-- export on_attach & capabilities for custom lspconfigs
|
||||
|
||||
M.on_attach = function(client, bufnr)
|
||||
if vim.g.vim_version > 7 then
|
||||
-- nightly
|
||||
client.server_capabilities.documentFormattingProvider = false
|
||||
client.server_capabilities.documentRangeFormattingProvider = false
|
||||
else
|
||||
-- stable
|
||||
client.resolved_capabilities.document_formatting = false
|
||||
client.resolved_capabilities.document_range_formatting = false
|
||||
end
|
||||
-- if vim.g.vim_version > 7 then
|
||||
-- -- nightly
|
||||
-- client.server_capabilities.documentFormattingProvider = false
|
||||
-- client.server_capabilities.documentRangeFormattingProvider = false
|
||||
-- else
|
||||
-- -- stable
|
||||
-- client.resolved_capabilities.document_formatting = false
|
||||
-- client.resolved_capabilities.document_range_formatting = false
|
||||
-- end
|
||||
|
||||
utils.load_mappings("lspconfig", { buffer = bufnr })
|
||||
|
||||
|
|
|
|||
|
|
@ -21,9 +21,17 @@ local options = {
|
|||
end,
|
||||
},
|
||||
server = {
|
||||
on_attach = function(client, bufnr)
|
||||
end,
|
||||
on_attach =
|
||||
require("plugins.configs.lspconfig").on_attach
|
||||
},
|
||||
|
||||
settings = {
|
||||
["rust-analyzer"] = {
|
||||
checkOnSave = {
|
||||
command = "check",
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rust.setup(options)
|
||||
|
|
|
|||
|
|
@ -67,7 +67,6 @@ local plugins = {
|
|||
config = function ()
|
||||
require("plugins.configs.rust-tools")
|
||||
require("core.utils").load_mappings "rust"
|
||||
require("core.utils").load_mappings "lspconfig"
|
||||
end,
|
||||
},
|
||||
|
||||
|
|
|
|||
Reference in New Issue