Skip to content

Commit

Permalink
fix(lang): indentation in rust lang extra (LazyVim#1017)
Browse files Browse the repository at this point in the history
  • Loading branch information
andresatierf authored and joshmedeski committed Sep 1, 2023
1 parent eea1ce2 commit a6246f0
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions lua/lazyvim/plugins/extras/lang/rust.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ return {
rust_analyzer = function(_, opts)
require("lazyvim.util").on_attach(function(client, buffer)
-- stylua: ignore
if client.name == "rust_analyzer" then
vim.keymap.set("n", "K", "<cmd>RustHoverActions<cr>", { buffer = buffer, desc = "Hover Actions (Rust)" })
vim.keymap.set("n", "<leader>cR", "<cmd>RustCodeAction<cr>", { buffer = buffer, desc = "Code Action (Rust)" })
vim.keymap.set("n", "<leader>dr", "<cmd>RustDebuggables<cr>", { buffer = buffer, desc = "Run Debuggables (Rust)" })
end
if client.name == "rust_analyzer" then
vim.keymap.set("n", "K", "<cmd>RustHoverActions<cr>", { buffer = buffer, desc = "Hover Actions (Rust)" })
vim.keymap.set( "n", "<leader>cR", "<cmd>RustCodeAction<cr>", { buffer = buffer, desc = "Code Action (Rust)" })
vim.keymap.set( "n", "<leader>dr", "<cmd>RustDebuggables<cr>", { buffer = buffer, desc = "Run Debuggables (Rust)" })
end
end)
local mason_registry = require("mason-registry")
-- rust tools configuration for debugging support
Expand All @@ -73,12 +73,12 @@ return {
tools = {
on_initialized = function()
vim.cmd([[
augroup RustLSP
autocmd CursorHold *.rs silent! lua vim.lsp.buf.document_highlight()
autocmd CursorMoved,InsertEnter *.rs silent! lua vim.lsp.buf.clear_references()
autocmd BufEnter,CursorHold,InsertLeave *.rs silent! lua vim.lsp.codelens.refresh()
augroup END
]])
augroup RustLSP
autocmd CursorHold *.rs silent! lua vim.lsp.buf.document_highlight()
autocmd CursorMoved,InsertEnter *.rs silent! lua vim.lsp.buf.clear_references()
autocmd BufEnter,CursorHold,InsertLeave *.rs silent! lua vim.lsp.codelens.refresh()
augroup END
]])
end,
},
server = {
Expand Down Expand Up @@ -119,10 +119,9 @@ return {
end
end
require("lazyvim.util").on_attach(function(client, buffer)
-- stylua: ignore
if client.name == "taplo" then
vim.keymap.set("n", "K", show_documentation, { buffer = buffer, desc = "Show Crate Documentation" })
end
if client.name == "taplo" then
vim.keymap.set("n", "K", show_documentation, { buffer = buffer, desc = "Show Crate Documentation" })
end
end)
return false -- make sure the base implementation calls taplo.setup
end,
Expand Down

0 comments on commit a6246f0

Please sign in to comment.