From 5e579db1248d13278f871724a6d35dc57a3f4d9b Mon Sep 17 00:00:00 2001 From: Slayter Teal Date: Sat, 16 Nov 2024 10:43:13 -0600 Subject: [PATCH] remove rust debugger, renable basic rust lsp --- init.lua | 246 +++++++++++++++++++++++++++---------------------------- 1 file changed, 123 insertions(+), 123 deletions(-) diff --git a/init.lua b/init.lua index 2042fb71..06f2fccf 100644 --- a/init.lua +++ b/init.lua @@ -530,9 +530,9 @@ require('lazy').setup({ require('mason-tool-installer').setup { ensure_installed = ensure_installed } -- Prevent mason from starting rust_analyzer - require('mason-lspconfig').setup_handlers { - ['rust_analyzer'] = function() end, - } + -- require('mason-lspconfig').setup_handlers { + -- ['rust_analyzer'] = function() end, + -- } require('mason-lspconfig').setup { handlers = { @@ -540,9 +540,9 @@ require('lazy').setup({ local server = servers[server_name] or {} -- Don't let mason configure the rust lsp -> this is done later in rustaceanvim - if server_name == 'rust_analyzer' then - return - end + -- if server_name == 'rust_analyzer' then + -- return + -- end -- This handles overriding only values explicitly passed -- by the server configuration above. Useful when disabling @@ -710,123 +710,123 @@ require('lazy').setup({ } end, }, - { --nvim-dap-- - 'mfussenegger/nvim-dap', - config = function() - -- local mason_registry = require 'mason-registry' - -- local codelldb = mason_registry.get_package 'codelldb' - -- local extension_path = codelldb:get_install_path() .. '/extensions/' - -- local codelldb_path = extension_path .. 'adapter/codelldb' - -- - -- local dap = require 'dap' - -- dap.adapters.codelldb = { - -- type = 'server', - -- port = '${port}', - -- executable = { - -- command = codelldb_path, - -- args = { '--port', '${port}' }, - -- }, - -- } - - -- dap.configurations.rust = { - -- { - -- name = 'Launch file', - -- type = 'codelldb', - -- request = 'launch', - -- program = function() - -- return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file') - -- end, - -- cwd = '${workspaceFolder}', - -- stopOnEntry = false, - -- }, - -- } - end, - }, - { --nvim-dap-ui-- - 'rcarriga/nvim-dap-ui', - dependencies = { - 'mfussenegger/nvim-dap', - 'nvim-neotest/nvim-nio', - }, - config = function() - local dapui = require 'dapui' - local dap = require 'dap' - dapui.setup() - - -- handle closing/opening the UI when debugger stops/starts -- - dap.listeners.after.event_initialized['dapui_config'] = function() - dapui.open() - end - dap.listeners.before.event_terminated['dapui_config'] = function() - dapui.close() - end - dap.listeners.before.event_exited['dapui_config'] = function() - dapui.close() - end - - -- setup some nice keybindings -- - -- vim.keymap.set('n', 'dt', ':DapToggleBreakpoint', { desc = '[DEBUGGER] Toggle Breakpoint' }) - -- vim.keymap.set('n', 'dx', ':DapTerminate', { desc = '[DEBUGGER] Terminate Debugger' }) - -- vim.keymap.set('n', 'so', ':DapStepOver', { desc = '[DEBUGGER] Step Over' }) - - -- Nvim DAP Keybindings - local map = vim.keymap.set - - map('n', 'dl', "lua require'dap'.step_into()", { desc = '[DEBUGGER] Step Into' }) - map('n', 'dj', "lua require'dap'.step_over()", { desc = '[DEBUGGER] Step Over' }) - map('n', 'dk', "lua require'dap'.step_out()", { desc = '[DEBUGGER] Step Out' }) - map('n', 'dc', "lua require'dap'.continue()", { desc = '[DEBUGGER] Continue' }) - map('n', 'db', "lua require'dap'.toggle_breakpoint()", { desc = '[DEBUGGER] Toggle Breakpoint' }) - -- map( - -- 'n', - -- 'dd', - -- "lua require'dap'.set_breakpoint(vim.fn.input('Breakpoint condition: '))", - -- { desc = 'Debugger set conditional breakpoint' } - -- ) - map('n', 'de', "lua require'dap'.terminate()", { desc = '[DEBUGGER] Reset' }) - map('n', 'dr', "lua require'dap'.run_last()", { desc = '[DEBUGGER] Run Last' }) - - -- rustaceanvim - map('n', 'dt', "lua vim.cmd('RustLsp testables')", { desc = '[DEBUGGER] Testables' }) - end, - }, - { - 'mrcjkb/rustaceanvim', - version = '^5', - lazy = false, -- This plugin is already lazy - config = function() - -- TODO: these paths are wrong for some fucking reason - -- local mason_registry = require 'mason-registry' - -- local codelldb = mason_registry.get_package 'codelldb' - -- local extension_path = codelldb:get_install_path() .. '/extensions/' - -- local codelldb_path = extension_path .. 'adapter/codelldb' - -- local liblldb_path = extension_path .. 'lldb/lib/liblldb.so' - - local codelldb_path = '/home/slayterteal/.local/share/nvim/mason/packages/codelldb/extension/adapter/codelldb' - -- NOTE: the liblldb is different between linux/mac (liblldb.so/dylib) - local liblldb_path = '/home/slayterteal/.local/share/nvim/mason/packages/codelldb/extension/lldb/lib/liblldb.so' - local rustcfg = require 'rustaceanvim.config' - - vim.g.rustaceanvim = { - -- Plugin configuration - tools = {}, - -- LSP configuration - server = { - on_attach = function(client, bufnr) - -- you can also put keymaps in here - end, - default_settings = { - -- rust-analyzer language server configuration - ['rust-analyzer'] = {}, - }, - }, - -- DAP configuration - dap = { - adapter = rustcfg.get_codelldb_adapter(codelldb_path, liblldb_path), - }, - } - end, - }, + -- { --nvim-dap-- + -- 'mfussenegger/nvim-dap', + -- config = function() + -- local mason_registry = require 'mason-registry' + -- local codelldb = mason_registry.get_package 'codelldb' + -- local extension_path = codelldb:get_install_path() .. '/extensions/' + -- local codelldb_path = extension_path .. 'adapter/codelldb' + -- + -- local dap = require 'dap' + -- dap.adapters.codelldb = { + -- type = 'server', + -- port = '${port}', + -- executable = { + -- command = codelldb_path, + -- args = { '--port', '${port}' }, + -- }, + -- } + -- + -- dap.configurations.rust = { + -- { + -- name = 'Launch file', + -- type = 'codelldb', + -- request = 'launch', + -- program = function() + -- return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file') + -- end, + -- cwd = '${workspaceFolder}', + -- stopOnEntry = false, + -- }, + -- } + -- end, + -- }, + -- { --nvim-dap-ui-- + -- 'rcarriga/nvim-dap-ui', + -- dependencies = { + -- 'mfussenegger/nvim-dap', + -- 'nvim-neotest/nvim-nio', + -- }, + -- config = function() + -- local dapui = require 'dapui' + -- local dap = require 'dap' + -- dapui.setup() + -- + -- -- handle closing/opening the UI when debugger stops/starts -- + -- dap.listeners.after.event_initialized['dapui_config'] = function() + -- dapui.open() + -- end + -- dap.listeners.before.event_terminated['dapui_config'] = function() + -- dapui.close() + -- end + -- dap.listeners.before.event_exited['dapui_config'] = function() + -- dapui.close() + -- end + -- + -- -- setup some nice keybindings -- + -- -- vim.keymap.set('n', 'dt', ':DapToggleBreakpoint', { desc = '[DEBUGGER] Toggle Breakpoint' }) + -- -- vim.keymap.set('n', 'dx', ':DapTerminate', { desc = '[DEBUGGER] Terminate Debugger' }) + -- -- vim.keymap.set('n', 'so', ':DapStepOver', { desc = '[DEBUGGER] Step Over' }) + -- + -- -- Nvim DAP Keybindings + -- local map = vim.keymap.set + -- + -- map('n', 'dl', "lua require'dap'.step_into()", { desc = '[DEBUGGER] Step Into' }) + -- map('n', 'dj', "lua require'dap'.step_over()", { desc = '[DEBUGGER] Step Over' }) + -- map('n', 'dk', "lua require'dap'.step_out()", { desc = '[DEBUGGER] Step Out' }) + -- map('n', 'dc', "lua require'dap'.continue()", { desc = '[DEBUGGER] Continue' }) + -- map('n', 'db', "lua require'dap'.toggle_breakpoint()", { desc = '[DEBUGGER] Toggle Breakpoint' }) + -- -- map( + -- -- 'n', + -- -- 'dd', + -- -- "lua require'dap'.set_breakpoint(vim.fn.input('Breakpoint condition: '))", + -- -- { desc = 'Debugger set conditional breakpoint' } + -- -- ) + -- map('n', 'de', "lua require'dap'.terminate()", { desc = '[DEBUGGER] Reset' }) + -- map('n', 'dr', "lua require'dap'.run_last()", { desc = '[DEBUGGER] Run Last' }) + -- + -- -- rustaceanvim + -- map('n', 'dt', "lua vim.cmd('RustLsp testables')", { desc = '[DEBUGGER] Testables' }) + -- end, + -- }, + -- { + -- 'mrcjkb/rustaceanvim', + -- version = '^5', + -- lazy = false, -- This plugin is already lazy + -- config = function() + -- -- TODO: these paths are wrong for some fucking reason + -- -- local mason_registry = require 'mason-registry' + -- -- local codelldb = mason_registry.get_package 'codelldb' + -- -- local extension_path = codelldb:get_install_path() .. '/extensions/' + -- -- local codelldb_path = extension_path .. 'adapter/codelldb' + -- -- local liblldb_path = extension_path .. 'lldb/lib/liblldb.so' + -- + -- local codelldb_path = '/home/slayterteal/.local/share/nvim/mason/packages/codelldb/extension/adapter/codelldb' + -- -- NOTE: the liblldb is different between linux/mac (liblldb.so/dylib) + -- local liblldb_path = '/home/slayterteal/.local/share/nvim/mason/packages/codelldb/extension/lldb/lib/liblldb.so' + -- local rustcfg = require 'rustaceanvim.config' + -- + -- vim.g.rustaceanvim = { + -- -- Plugin configuration + -- tools = {}, + -- -- LSP configuration + -- server = { + -- on_attach = function(client, bufnr) + -- -- you can also put keymaps in here + -- end, + -- default_settings = { + -- -- rust-analyzer language server configuration + -- ['rust-analyzer'] = {}, + -- }, + -- }, + -- -- DAP configuration + -- dap = { + -- adapter = rustcfg.get_codelldb_adapter(codelldb_path, liblldb_path), + -- }, + -- } + -- end, + -- }, -- ADD COLORSCHEMES HERE (or at least around here) -- {