disable rust for now

This commit is contained in:
christianchiarulli 2021-07-04 01:44:55 -04:00
parent ca0fa9cbb2
commit e4da06abb0
2 changed files with 72 additions and 57 deletions

View file

@ -1,3 +1,4 @@
if O.lang.rust.rust_tools.active then
local opts = {
tools = { -- rust-tools options
-- automatically set inlay hints (type hints)
@ -66,10 +67,21 @@ local opts = {
on_attach = require'lsp'.common_on_attach
} -- rust-analyser options
}
require('rust-tools').setup(opts)
-- TODO add this later
else
require'lspconfig'.rust_analyzer.setup {
cmd = {DATA_PATH .. "/lspinstall/rust/rust-analyzer"},
on_attach = require'lsp'.common_on_attach,
filetypes = {"rust"},
root_dir = require'lspconfig.util'.root_pattern("Cargo.toml",
"rust-project.json")
}
end
-- TODO fix these mappings
vim.api.nvim_exec([[
autocmd Filetype rust nnoremap <leader>lm <Cmd>RustExpandMacro<CR>
autocmd Filetype rust nnoremap <leader>lH <Cmd>RustToggleInlayHints<CR>

View file

@ -167,6 +167,9 @@ O = {
yaml = {},
terraform = {},
rust = {
rust_tools = {
active = false
},
linter = '',
formatter = '',
autoformat = false,