From f032fb9e2fadaaec6f71aaf45ed1d94128ea45cd Mon Sep 17 00:00:00 2001 From: Elvis Claros Castro Date: Thu, 3 Oct 2024 11:41:10 -0300 Subject: feat: add rust tools --- lua/pi/dap/configs/rust.lua | 57 --------------------------------------------- lua/pi/dap/configs/rust.old | 57 +++++++++++++++++++++++++++++++++++++++++++++ lua/pi/dap/init.lua | 8 +++---- 3 files changed, 61 insertions(+), 61 deletions(-) delete mode 100644 lua/pi/dap/configs/rust.lua create mode 100644 lua/pi/dap/configs/rust.old (limited to 'lua/pi/dap') diff --git a/lua/pi/dap/configs/rust.lua b/lua/pi/dap/configs/rust.lua deleted file mode 100644 index 9ca976f..0000000 --- a/lua/pi/dap/configs/rust.lua +++ /dev/null @@ -1,57 +0,0 @@ -local dap = require("dap") - -local rust_adapter = nil -local rust_adapters = { "lldb-vscode", "codelldb" } -for _, adapter in pairs(rust_adapters) do - if vim.fn.executable(adapter) then - rust_adapter = adapter - end -end - -if rust_adapter ~= nil then - dap.adapters.lldb = { - type = "executable", - command = rust_adapter, - name = "lldb", - } - - dap.configurations.rust = { - { - name = "launch", - type = "lldb", - request = "launch", - program = function() - local dir = vim.fn.getcwd() - return dir .. "/target/debug/" .. vim.fs.basename(dir) - end, - cwd = "${workspaceFolder}", - stopOnEntry = false, - args = function() - local resp = vim.fn.input "Arguments: " - if resp == "" then - return {} - end - - return vim.fn.split(resp, " ") - end, - }, - { - name = "custom", - type = "lldb", - request = "launch", - program = function() - return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file") - end, - cwd = "${workspaceFolder}", - stopOnEntry = false, - args = function() - local resp = vim.fn.input "Arguments: " - if resp == "" then - return {} - end - - return vim.fn.split(resp, " ") - end, - }, - } -end diff --git a/lua/pi/dap/configs/rust.old b/lua/pi/dap/configs/rust.old new file mode 100644 index 0000000..9ca976f --- /dev/null +++ b/lua/pi/dap/configs/rust.old @@ -0,0 +1,57 @@ +local dap = require("dap") + +local rust_adapter = nil +local rust_adapters = { "lldb-vscode", "codelldb" } +for _, adapter in pairs(rust_adapters) do + if vim.fn.executable(adapter) then + rust_adapter = adapter + end +end + +if rust_adapter ~= nil then + dap.adapters.lldb = { + type = "executable", + command = rust_adapter, + name = "lldb", + } + + dap.configurations.rust = { + { + name = "launch", + type = "lldb", + request = "launch", + program = function() + local dir = vim.fn.getcwd() + return dir .. "/target/debug/" .. vim.fs.basename(dir) + end, + cwd = "${workspaceFolder}", + stopOnEntry = false, + args = function() + local resp = vim.fn.input "Arguments: " + if resp == "" then + return {} + end + + return vim.fn.split(resp, " ") + end, + }, + { + name = "custom", + type = "lldb", + request = "launch", + program = function() + return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file") + end, + cwd = "${workspaceFolder}", + stopOnEntry = false, + args = function() + local resp = vim.fn.input "Arguments: " + if resp == "" then + return {} + end + + return vim.fn.split(resp, " ") + end, + }, + } +end diff --git a/lua/pi/dap/init.lua b/lua/pi/dap/init.lua index 327dedf..97084fd 100644 --- a/lua/pi/dap/init.lua +++ b/lua/pi/dap/init.lua @@ -10,11 +10,11 @@ for _, ft_path in ipairs(vim.api.nvim_get_runtime_file("lua/pi/dap/configs/*.lua end -- Signs -vim.fn.sign_define("DapBreakpoint", { text = "🛑", texthl = "", linehl = "", numhl = "" }) +vim.fn.sign_define("DapBreakpoint", { text = "", texthl = "", linehl = "", numhl = "" }) vim.fn.sign_define("DapStopped", { text = "▶", texthl = "", linehl = "", numhl = "" }) -vim.fn.sign_define("DapBreakpointRejected", { text = "🚫", texthl = "", linehl = "", numhl = "" }) -vim.fn.sign_define("DapBreakpointCondition", { text = "❓", texthl = "", linehl = "", numhl = "" }) -vim.fn.sign_define("DapLogPoint", { text = "💬", texthl = "", linehl = "", numhl = "" }) +vim.fn.sign_define("DapBreakpointRejected", { text = "", texthl = "", linehl = "", numhl = "" }) +vim.fn.sign_define("DapBreakpointCondition", { text = "", texthl = "", linehl = "", numhl = "" }) +vim.fn.sign_define("DapLogPoint", { text = "󰍢", texthl = "", linehl = "", numhl = "" }) -- UI structure dapui.setup { -- cgit v1.2.3