Revert "Remove rust-specific features"

This reverts commit 0fd1209ff6.
writing
Nick Zana 3 years ago
parent c22dd30feb
commit a0ebc042c8
No known key found for this signature in database
GPG Key ID: A6E59E60FE474883

@ -84,4 +84,8 @@ local on_attach = function(client, bufnr)
end end
-- Code actions
-- TODO: Generalize to LSP or only attach on Rust buffers
map('n', '<leader>t', '<cmd>RustTest<CR>', options) -- Run test under cursor
return { on_attach = on_attach } return { on_attach = on_attach }

@ -1,3 +1,22 @@
local on_attach = require'keybindings'.on_attach local on_attach = require'keybindings'.on_attach
local capabilities = require'cmp_nvim_lsp'.update_capabilities(vim.lsp.protocol.make_client_capabilities()) local capabilities = require'cmp_nvim_lsp'.update_capabilities(vim.lsp.protocol.make_client_capabilities())
local cmp = require'nvim-cmp-cfg'.cmp local cmp = require'nvim-cmp-cfg'.cmp
-- SERVERS
-- rust_analyzer
vim.g.rustfmt_autosave = 1
require'lspconfig'.rust_analyzer.setup{
on_attach = on_attach,
capabilities = capabilities,
settings = {
["rust-analyzer"] = {
procMacro = {
enable = true,
},
checkOnSave = {
command = 'clippy',
extraArgs = "-W clippy::pedantic"
},
}
}
}

@ -31,9 +31,16 @@ local plugins = require('packer').startup(function(use)
use 'hrsh7th/cmp-vsnip' use 'hrsh7th/cmp-vsnip'
use 'hrsh7th/vim-vsnip' use 'hrsh7th/vim-vsnip'
-- Language Specfic
use 'rust-lang/rust.vim'
if packer_bootstrap then if packer_bootstrap then
require('packer').sync() require('packer').sync()
end end
end) end)
-- Required for rust.vim
-- TODO: Convert to lua
vim.cmd([[filetype plugin indent on]])
return plugins return plugins

Loading…
Cancel
Save