Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Commit

Permalink
feat(standalone): Call on_attach when attached to buffer
Browse files Browse the repository at this point in the history
* Fixes #25
  • Loading branch information
simrat39 committed Oct 12, 2021
1 parent c9f5504 commit 21b1967
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lua/rust-tools/standalone.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ function M.start_standalone_client()
cmd = { "rust-analyzer" },
init_options = { detachedFiles = { vim.api.nvim_buf_get_name(0) } },
on_init = function(client)
local current_buf = vim.api.nvim_get_current_buf()
vim.lsp.buf_attach_client(0, client.id)
local on_attach = ra_config.options.server.on_attach
if on_attach then
on_attach(current_buf, client)
end
vim.cmd("command! RustSetInlayHints :lua require('rust-tools.inlay_hints').set_inlay_hints()")
vim.cmd("command! RustDisableInlayHints :lua require('rust-tools.inlay_hints').disable_inlay_hints()")
vim.cmd("command! RustToggleInlayHints :lua require('rust-tools.inlay_hints').toggle_inlay_hints()")
Expand Down

0 comments on commit 21b1967

Please sign in to comment.