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