lsp and dap fixes

This commit is contained in:
Christian Nieves
2024-03-20 20:57:57 +00:00
parent 14a4da6b6c
commit 7af5f17c9b
10 changed files with 101 additions and 89 deletions

View File

@ -101,13 +101,11 @@ return {
sorting = {
comparators = {
-- compare.score_offset, -- not good at all
compare.priority,
compare.score, -- based on : score = score + ((#sources - (source_index - 1)) * sorting.priority_weight)
compare.locality,
compare.recently_used,
compare.offset,
compare.order,
-- compare.scopes, -- what?
-- compare.sort_text,
-- compare.exact,
compare.kind,
-- compare.length, -- useless
@ -126,7 +124,7 @@ return {
nerdfont = "󰊪 nerdfont",
nvim_ciderlsp = "󰚩 Cider",
analysislsp = "󰟌 analysislsp",
-- nvim_lsp_signature_help = "󰊕",
nvim_lsp_signature_help = "󰊕",
nvim_lsp = " LSP",
nvim_lua = " lua",
treesitter = "󰙅 ts",

View File

@ -3,6 +3,12 @@ return {
"mfussenegger/nvim-jdtls",
config = function() end,
},
{
"theHamsta/nvim-dap-virtual-text",
config = function()
require("nvim-dap-virtual-text").setup()
end,
},
{
"mfussenegger/nvim-dap",
dependencies = {
@ -28,8 +34,12 @@ return {
vim.fn.sign_define("DapBreakpointCondition", { text = "", texthl = "DiagnosticSignError" })
vim.fn.sign_define("DapBreakpointRejected", { text = "", texthl = "DiagnosticSignError" })
dap.adapters.java = {}
dap.adapters.cpp = {}
dap.adapters.cppdbg = {
id = "cppdbg",
type = "executable",
command = vim.fn.exepath("OpenDebugAD7"),
}
if use_google then
dap.adapters.lldb = {
type = "executable",
@ -51,6 +61,21 @@ return {
port = 6006,
}
dap.configurations.cppdbg = {
{
name = "Attach to gdbserver :5555",
type = "cppdbg",
request = "launch",
MIMode = "gdb",
miDebuggerServerAddress = "localhost:5555",
miDebuggerPath = vim.fn.exepath("gdb"),
cwd = "${workspaceFolder}",
program = function()
return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file")
end,
},
}
dap.configurations.cpp = {
{
-- If you get an "Operation not permitted" error using this, try disabling YAMA:
@ -76,11 +101,9 @@ return {
mode = "remote",
name = "Attach Remote",
attachCommands = { "gdb-remote localhost:5555" },
-- hostName = "127.0.0.1",
-- port = 5555,
},
}
dap.configurations.c = dap.configurations.cpp
-- dap.configurations.c = dap.configurations.cpp
dap.configurations.java = {
{
@ -150,15 +173,17 @@ return {
})
local dapui = require("dapui")
vim.cmd("set mouse=n")
dapui.setup()
dap.listeners.after.event_initialized["dapui_config"] = function()
vim.cmd("set mouse=a")
dapui.open()
end
dap.listeners.before.event_terminated["dapui_config"] = function()
vim.cmd("set mouse=")
dapui.close()
end
dap.listeners.before.event_exited["dapui_config"] = function()
vim.cmd("set mouse=")
dapui.close()
end
end,

View File

@ -289,6 +289,7 @@ return {
{
name = "critique-nvim",
dir = "~/critique-nvim/",
lazy = false,
dependencies = {
"rktjmp/time-ago.vim",
"nvim-lua/plenary.nvim",

View File

@ -2,7 +2,7 @@ return {
{
"rcarriga/nvim-notify",
event = "VimEnter",
cond = false,
cond = true,
lazy = true,
config = function()
-- local colors = require("catppuccin.palettes").get_palette()
@ -19,7 +19,7 @@ return {
{
"j-hui/fidget.nvim",
event = "VimEnter",
cond = true,
cond = false,
opts = {
progress = {
display = {

View File

@ -9,8 +9,8 @@ _G.find_files = function()
end
-- Helper functions to fetch the current scope and set `search_dirs`
_G.find_dotfiles = function()
require("telescope.builtin").find_files({
search_dirs = { vim.fn.expand("$HOME/dotfiles") },
require("telescope.builtin").git_files({
cwd = vim.fn.expand("$HOME/dotfiles"),
})
end
@ -39,6 +39,9 @@ local keys = {
{ "<C-P>", ":lua find_files()<CR>", desc = "Find Files in CWD" },
{ "<leader>e", ":lua search_cwd()<CR>", desc = "Find Files in Buffer Directory" },
{ "<leader>tc", ":Telescope textcase<CR>", desc = "Text case" },
{ "<leader>t.", ":lua find_dotfiles()<CR>", desc = "Find Dotfiles" },
{ "<leader>tdc", ":Telescope dap commands" },
{ "<leader>tdc", ":Telescope dap configurations" },
{ "<leader>td", ":lua find_dotfiles()<CR>", desc = "Find Dotfiles" },
{ "<leader>tf", ":lua find_files()<CR>", desc = "Find Files in CWD" },
{ "<leader>tf.", ":lua vim.error('use <leader>e')<CR>", desc = "Find Files in Buffer Directory" },
@ -104,7 +107,10 @@ return {
},
{
"nvim-telescope/telescope.nvim",
dependencies = {},
dependencies = {
"mfussenegger/nvim-dap",
"rcarriga/nvim-dap-ui",
},
config = function()
require("telescope").setup({
defaults = {