From f3cd0b116d6cac8d5bfc1bde172f703686e5c377 Mon Sep 17 00:00:00 2001 From: Yann Date: Tue, 9 Jul 2024 14:49:09 +0200 Subject: [PATCH] =?UTF-8?q?Version=20fonctionnelle=20du=20d=C3=A9bogueur?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 8 ++++++ init.lua | 74 ++++++++++++++++++++----------------------------------- 2 files changed, 35 insertions(+), 47 deletions(-) diff --git a/README.md b/README.md index aa548d9..645cc46 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,14 @@ Cette commande : - y copie le fichier init.lua - copie le fichier ~/.local/bin/install-neovim.sh +## Rust +```bash +✔ ~> rustup component add rust-analyzer +info: downloading component 'rust-analyzer' +info: installing component 'rust-analyzer' +✔ ~> rust-analyzer --version +rust-analyzer 1.73.0 (cc66ad4 2023-10-03) +``` # Cheatsheet ## Spell diff --git a/init.lua b/init.lua index fae41ca..e347877 100644 --- a/init.lua +++ b/init.lua @@ -72,7 +72,7 @@ require('packer').startup(function(use) use { 'rcarriga/nvim-dap-ui',-- Debug Adapter UI requires = { - {'mfussenegger/nvim-dap', 'nvim-neotest/nvim-nio'},-- Debug Adapter Protocol + {'mfussenegger/nvim-dap', 'nvim-neotest/nvim-nio', 'theHamsta/nvim-dap-virtual-text'},-- Debug Adapter Protocol } } -- use 'puremourning/vimspector' @@ -261,15 +261,13 @@ require('mason-lspconfig').setup({ ensure_installed = { 'html', 'cssls', - 'rust_analyzer', 'lua_ls', 'marksman', 'sqlls', 'jinja_lsp' }, - -- handlers = { - -- lsp.default_setup, - -- }, + -- 'rust_analyzer', + -- non compatible avec rustaceanvim : https://github.com/mrcjkb/rustaceanvim/blob/master/doc/mason.txt }) require('lspconfig').marksman.setup({}) @@ -542,21 +540,6 @@ require("noice").setup({ vim.o.autoread = true vim.g.indentLine_conceallevel = 0 -- pose trop de problème avec le markdown et le json --- vim.keymap.set("n", "rb", ':call vimspector#ToggleBreakpoint()', { buffer = bufnr }) --- vim.keymap.set("n", "rl", ':call vimspector#Launch()', { buffer = bufnr }) --- vim.api.nvim_create_autocmd("FileType", { --- pattern = { "sql", "mysql", "plsql" }, --- callback = function() --- cmp.setup.buffer({ --- sources = { --- { name = "vim-dadbod-completion" }, --- { name = "buffer" }, --- { name = "luasnip" }, --- }, --- }) --- end, --- group = autocomplete_group, --- }) vim.filetype.add({ pattern = { [".*/hypr/.*%.conf"] = "hyprlang" }, @@ -565,43 +548,40 @@ vim.filetype.add({ require'colorizer'.setup() require("nvim-autopairs").setup {} -- ne semble pas pouvoir être intégré dans le use --- inlay hints to remove with version 10 of neovim --- require("lsp-inlayhints").setup() --- vim.api.nvim_create_augroup("LspAttach_inlayhints", {}) --- vim.api.nvim_create_autocmd("LspAttach", { --- group = "LspAttach_inlayhints", --- callback = function(args) --- if not (args.data and args.data.client_id) then --- return --- end - --- local bufnr = args.buf --- local client = vim.lsp.get_client_by_id(args.data.client_id) --- require("lsp-inlayhints").on_attach(client, bufnr) --- end, --- }) ------------------------------------------------- --- --- --- local dap = require("dap") - --- dap.adapters.lldb = { --- type = "executable", --- -- command = "/usr/bin/lldb-vscode", -- adjust as needed --- command = "$HOME/.cargo/bin/rust-lldb", -- adjust as needed --- name = "lldb", --- } --- local dap, dapui = require("dap"), require("dapui") +dapui.setup() +require("nvim-dap-virtual-text").setup() + +dap.adapters.rustlldb = { + type = "executable", + -- command = "/usr/bin/lldb-vscode", -- adjust as needed + command = vim.fn.expand('~').."/.cargo/bin/rust-lldb", -- adjust as needed + name = "rustlldb", +} + dap.listeners.before.attach.dapui_config = function() dapui.open() + vim.opt.mouse = 'n' end dap.listeners.before.launch.dapui_config = function() dapui.open() + vim.opt.mouse = 'n' end dap.listeners.before.event_terminated.dapui_config = function() dapui.close() + vim.opt.mouse = '' end dap.listeners.before.event_exited.dapui_config = function() dapui.close() + vim.opt.mouse = '' end + +vim.keymap.set('n', '', require 'dap'.continue) +vim.keymap.set('n', '', require 'dap'.step_over) +vim.keymap.set('n', '', require 'dap'.step_into) +vim.keymap.set('n', '', require 'dap'.step_out) +vim.keymap.set('n', 'b', require 'dap'.toggle_breakpoint) +vim.keymap.set('n', 'e', require 'dapui'.eval) + +vim.fn.sign_define('DapBreakpoint',{ text ='🟥', texthl ='', linehl ='', numhl =''}) +vim.fn.sign_define('DapStopped',{ text ='▶️', texthl ='', linehl ='', numhl =''})