2024-01-09 19:41:47 +01:00
|
|
|
local util = require 'utility'
|
|
|
|
local n = util.keymap 'n'
|
2023-08-20 14:27:47 +02:00
|
|
|
|
2023-09-04 23:01:56 +02:00
|
|
|
|
2024-01-09 19:41:47 +01:00
|
|
|
vim.g.rustaceanvim = function()
|
|
|
|
local mason = require 'mason-registry'
|
|
|
|
local tools = require 'rustaceanvim'
|
|
|
|
local config = require 'rustaceanvim.config'
|
2023-07-11 23:48:37 +02:00
|
|
|
|
2024-01-09 19:41:47 +01:00
|
|
|
local lsp_root = mason.get_package('codelldb'):get_install_path() .. '/extension/'
|
|
|
|
local lsp_path = lsp_root .. 'adapter/codelldb'
|
|
|
|
local lib_path = lsp_root .. 'lldb/lib/liblldb.so'
|
2023-07-11 23:48:37 +02:00
|
|
|
|
2024-01-09 19:41:47 +01:00
|
|
|
---@type RustaceanOpts
|
|
|
|
return {
|
2023-07-10 14:30:11 +02:00
|
|
|
server = {
|
2023-09-03 14:38:57 +02:00
|
|
|
on_attach = function(_, bufnr)
|
2024-01-09 19:41:47 +01:00
|
|
|
n '<C-b>' (tools.hover_actions.hover_actions) {buffer=bufnr}
|
|
|
|
n '<Leader>a' (tools.code_action_group.code_action_group) {buffer=bufnr}
|
2023-07-10 14:30:11 +02:00
|
|
|
end,
|
2023-07-11 23:48:37 +02:00
|
|
|
},
|
|
|
|
dap = {
|
2024-01-09 19:41:47 +01:00
|
|
|
adapter = config.get_codelldb_adapter(lsp_path, lib_path),
|
2023-07-11 23:48:37 +02:00
|
|
|
},
|
|
|
|
}
|
2023-10-29 09:47:39 +01:00
|
|
|
end
|