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

Disable parts of plugin #364

Open
Tenshock opened this issue Apr 11, 2023 · 2 comments
Open

Disable parts of plugin #364

Tenshock opened this issue Apr 11, 2023 · 2 comments

Comments

@Tenshock
Copy link

Tenshock commented Apr 11, 2023

The plugin makes a lot of things but all are not wanted everytime.

When I setup the plugin, it breaks my configuration and overrides some mappings.

I only want configuration for dap purpose, and particularly RustDebuggables. How can I disable all other configuration and just provide to my configuration only this command without all the rest loading?

I already have a lsp configuration set up, I don't want this plugin to interact with it

@Tenshock
Copy link
Author

To be more precise, it breaks the configuration I have from nvChad, and especially all my keymaps linked to my lsp configuration.

I can't figure out from where the break happens

@BingCoke
Copy link

That is my problem too.
rust-tools takes too many time for setup and give some features which i will not use for sometime.By the way, rust-tools will not change your keymaps so it will be another problem. lsp provide on_attach function to keymap in buffer, so if you use rust-tools , you should config lsp by youself.
like this

local lsp_conf = require("lsp.lsp")
-- import rust-tools plugin safely
local rust_setup, rt = pcall(require, "rust-tools")
if not rust_setup then
  return
end

local lldb_path = "/usr/lib/codelldb/"

local codelldb_path = lldb_path .. "adapter/codelldb"
local liblldb_path = lldb_path .. "lldb/lib/liblldb.so"
-- The liblldb extension is .so for linux and .dylib for macOS
local keymap = vim.keymap -- for conciseness

rt.setup({
  dap = {
    adapter = require("rust-tools.dap").get_codelldb_adapter(codelldb_path, liblldb_path),
  },
  server = {
    capabilities = lsp_conf.capabilities,
    on_attach = function(client, bufnr)
      local opts = { noremap = true, silent = true, buffer = bufnr }
      lsp_conf.on_attach(client, bufnr)
      -- Hover actions
      vim.keymap.set("n", "<F9>", rt.hover_actions.hover_actions, opts)
    end,
    settings = { }
  }
})

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants