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,75 +1,87 @@
local opts = { if O.lang.rust.rust_tools.active then
tools = { -- rust-tools options local opts = {
-- automatically set inlay hints (type hints) tools = { -- rust-tools options
-- There is an issue due to which the hints are not applied on the first -- automatically set inlay hints (type hints)
-- opened file. For now, write to the file to trigger a reapplication of -- There is an issue due to which the hints are not applied on the first
-- the hints or just run :RustSetInlayHints. -- opened file. For now, write to the file to trigger a reapplication of
-- default: true -- the hints or just run :RustSetInlayHints.
autoSetHints = true,
-- whether to show hover actions inside the hover window
-- this overrides the default hover handler
-- default: true
hover_with_actions = true,
runnables = {
-- whether to use telescope for selection menu or not
-- default: true -- default: true
use_telescope = true autoSetHints = true,
-- rest of the opts are forwarded to telescope -- whether to show hover actions inside the hover window
}, -- this overrides the default hover handler
inlay_hints = {
-- wheter to show parameter hints with the inlay hints or not
-- default: true -- default: true
show_parameter_hints = true, hover_with_actions = true,
-- prefix for parameter hints runnables = {
-- default: "<-" -- whether to use telescope for selection menu or not
parameter_hints_prefix = "<-", -- default: true
use_telescope = true
-- prefix for all the other hints (type, chaining) -- rest of the opts are forwarded to telescope
-- default: "=>" },
other_hints_prefix = "=>",
-- whether to align to the lenght of the longest line in the file inlay_hints = {
max_len_align = false, -- wheter to show parameter hints with the inlay hints or not
-- default: true
show_parameter_hints = true,
-- padding from the left if max_len_align is true -- prefix for parameter hints
max_len_align_padding = 1, -- default: "<-"
parameter_hints_prefix = "<-",
-- whether to align to the extreme right or not -- prefix for all the other hints (type, chaining)
right_align = false, -- default: "=>"
other_hints_prefix = "=>",
-- padding from the right if right_align is true -- whether to align to the lenght of the longest line in the file
right_align_padding = 7 max_len_align = false,
},
hover_actions = { -- padding from the left if max_len_align is true
-- the border that is used for the hover window max_len_align_padding = 1,
-- see vim.api.nvim_open_win()
border = { -- whether to align to the extreme right or not
{"", "FloatBorder"}, {"", "FloatBorder"}, right_align = false,
{"", "FloatBorder"}, {"", "FloatBorder"},
{"", "FloatBorder"}, {"", "FloatBorder"}, -- padding from the right if right_align is true
{"", "FloatBorder"}, {"", "FloatBorder"} right_align_padding = 7
},
hover_actions = {
-- the border that is used for the hover window
-- see vim.api.nvim_open_win()
border = {
{"", "FloatBorder"}, {"", "FloatBorder"},
{"", "FloatBorder"}, {"", "FloatBorder"},
{"", "FloatBorder"}, {"", "FloatBorder"},
{"", "FloatBorder"}, {"", "FloatBorder"}
}
} }
} },
},
-- all the opts to send to nvim-lspconfig -- all the opts to send to nvim-lspconfig
-- these override the defaults set by rust-tools.nvim -- these override the defaults set by rust-tools.nvim
-- see https://github.com/neovim/nvim-lspconfig/blob/master/CONFIG.md#rust_analyzer -- see https://github.com/neovim/nvim-lspconfig/blob/master/CONFIG.md#rust_analyzer
server = { server = {
cmd = {DATA_PATH .. "/lspinstall/rust/rust-analyzer"},
on_attach = require'lsp'.common_on_attach
} -- rust-analyser options
}
require('rust-tools').setup(opts)
else
require'lspconfig'.rust_analyzer.setup {
cmd = {DATA_PATH .. "/lspinstall/rust/rust-analyzer"}, cmd = {DATA_PATH .. "/lspinstall/rust/rust-analyzer"},
on_attach = require'lsp'.common_on_attach on_attach = require'lsp'.common_on_attach,
} -- rust-analyser options filetypes = {"rust"},
} root_dir = require'lspconfig.util'.root_pattern("Cargo.toml",
"rust-project.json")
}
require('rust-tools').setup(opts) end
-- TODO add this later -- TODO fix these mappings
vim.api.nvim_exec([[ vim.api.nvim_exec([[
autocmd Filetype rust nnoremap <leader>lm <Cmd>RustExpandMacro<CR> autocmd Filetype rust nnoremap <leader>lm <Cmd>RustExpandMacro<CR>
autocmd Filetype rust nnoremap <leader>lH <Cmd>RustToggleInlayHints<CR> autocmd Filetype rust nnoremap <leader>lH <Cmd>RustToggleInlayHints<CR>

View file

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