mirror of
https://github.com/LunarVim/LunarVim.git
synced 2024-09-21 02:55:09 +02:00
disable rust for now
This commit is contained in:
parent
ca0fa9cbb2
commit
e4da06abb0
2 changed files with 72 additions and 57 deletions
|
@ -1,4 +1,5 @@
|
||||||
local opts = {
|
if O.lang.rust.rust_tools.active then
|
||||||
|
local opts = {
|
||||||
tools = { -- rust-tools options
|
tools = { -- rust-tools options
|
||||||
-- automatically set inlay hints (type hints)
|
-- automatically set inlay hints (type hints)
|
||||||
-- There is an issue due to which the hints are not applied on the first
|
-- There is an issue due to which the hints are not applied on the first
|
||||||
|
@ -65,11 +66,22 @@ local opts = {
|
||||||
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
|
} -- rust-analyser options
|
||||||
}
|
}
|
||||||
|
require('rust-tools').setup(opts)
|
||||||
|
|
||||||
require('rust-tools').setup(opts)
|
else
|
||||||
|
|
||||||
-- TODO add this later
|
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([[
|
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>
|
||||||
|
|
|
@ -167,6 +167,9 @@ O = {
|
||||||
yaml = {},
|
yaml = {},
|
||||||
terraform = {},
|
terraform = {},
|
||||||
rust = {
|
rust = {
|
||||||
|
rust_tools = {
|
||||||
|
active = false
|
||||||
|
},
|
||||||
linter = '',
|
linter = '',
|
||||||
formatter = '',
|
formatter = '',
|
||||||
autoformat = false,
|
autoformat = false,
|
||||||
|
|
Loading…
Reference in a new issue