From 14fb0f7536f693c26dbe16cc6ba2a668c79de7e9 Mon Sep 17 00:00:00 2001 From: elkowar <5300871+elkowar@users.noreply.github.com> Date: Fri, 8 Oct 2021 15:01:46 +0200 Subject: [PATCH] Start setting up codelldb stuff --- nvim/.config/nvim/fnl/dots/plugins.fnl | 50 ++++++++----------- nvim/.config/nvim/fnl/dots/plugins/lsp.fnl | 10 +++- .../nvim/fnl/dots/plugins/nvim-dap.fnl | 13 ----- 3 files changed, 30 insertions(+), 43 deletions(-) diff --git a/nvim/.config/nvim/fnl/dots/plugins.fnl b/nvim/.config/nvim/fnl/dots/plugins.fnl index 132f74e..0b77d81 100644 --- a/nvim/.config/nvim/fnl/dots/plugins.fnl +++ b/nvim/.config/nvim/fnl/dots/plugins.fnl @@ -5,11 +5,8 @@ -(defn [use stuff rest] - (use (a.assoc rest 1 stuff))) - - -(defn- safe-require-plugin-config [name] +(defn- safe-req-conf [name] + "safely require a plugins configuration module, prepending 'dots.plugins.' to the given module name" (let [(ok? val-or-err) (pcall require (.. "dots.plugins." name))] (when (not ok?) (print (.. "Plugin config error: " val-or-err))))) @@ -21,7 +18,7 @@ (for [i 1 (a.count pkgs) 2] (let [name (. pkgs i) opts (. pkgs (+ i 1))] - (-?> (. opts :mod) (safe-require-plugin-config)) + (-?> (. opts :mod) (safe-req-conf)) (use (a.assoc opts 1 name)))))))) @@ -38,37 +35,34 @@ :folke/persistence.nvim {:opt false :config #(require "dots.plugins.persistence")} :folke/zen-mode.nvim {:cmd ["ZenMode"] - :opt false :config #(require "dots.plugins.zen-mode")} + :config #(require "dots.plugins.zen-mode")} - :folke/twilight.nvim {:opt false :config #(require "dots.plugins.twilight")} + :folke/twilight.nvim {:config #(require "dots.plugins.twilight")} - :TimUntersberger/neogit {:opt false :config #(require "dots.plugins.neogit") + :TimUntersberger/neogit {:config #(require "dots.plugins.neogit") :cmd ["Neogit"]} :lifepillar/vim-gruvbox8 {:opt false :config - #(do (set vim.g.gruvbox_italics 0) - (set vim.g.gruvbox_italicise_strings 0) - (set vim.g.gruvbox_filetype_hi_groups 1) - (set vim.g.gruvbox_plugin_hi_groups 1) - (vim.cmd "colorscheme gruvbox8") - ((. (require :dots.utils) :highlight) :SignColumn {:bg (. (require :dots.colors) :dark0)}))} + (fn [] + (set vim.g.gruvbox_italics 0) + (set vim.g.gruvbox_italicise_strings 0) + (set vim.g.gruvbox_filetype_hi_groups 1) + (set vim.g.gruvbox_plugin_hi_groups 1) + (vim.cmd "colorscheme gruvbox8") + ((. (require :dots.utils) :highlight) :SignColumn {:bg (. (require :dots.colors) :dark0)}))} ;(req dots.utils.highlight :SignColumn {:bg (. (require :dots.colors) :dark0)}))} ;(req dots.utils.highlight :LspDiagnosticsUnderlineError {:gui "underline"}))} - :nvim-telescope/telescope.nvim {:opt false :config #(require "dots.plugins.telescope") + :nvim-telescope/telescope.nvim {:config #(require "dots.plugins.telescope") :cmd ["Telescope"] :requires [:nvim-lua/popup.nvim :nvim-lua/plenary.nvim]} :nvim-telescope/telescope-packer.nvim {} - - :nvim-telescope/telescope-frecency.nvim {:requires [:tami5/sql.nvim] - :opt false} - ;:opt false :config #((. (require :telescope) :load_extension) "frecency")} @@ -76,7 +70,7 @@ :kyazdani42/nvim-web-devicons {} - :nvim-treesitter/nvim-treesitter {:opt false :config #(require "dots.plugins.treesitter") + :nvim-treesitter/nvim-treesitter {:config #(require "dots.plugins.treesitter") :event ["BufEnter"] :run ":TSUpdate"} @@ -98,7 +92,7 @@ :akinsho/nvim-bufferline.lua {:opt false :config #(require "dots.plugins.bufferline")} :sindrets/diffview.nvim {:cmd ["DiffviewOpen" "DiffviewToggleFiles"] - :opt false :config #(require "dots.plugins.diffview")} + :config #(require "dots.plugins.diffview")} :tweekmonster/startuptime.vim {:cmd ["StartupTime"]} @@ -106,7 +100,8 @@ :lewis6991/gitsigns.nvim {:after ["vim-gruvbox8"] - :opt false :config #(require "dots.plugins.gitsigns")} + :opt false + :config #(require "dots.plugins.gitsigns")} @@ -133,16 +128,13 @@ :rcarriga/nvim-dap-ui {:opt false - :opt false :config #((. (require :dapui) :setup)) - ;:opt false :config #(req dapui.setup) + :config #((. (require :dapui) :setup)) :requires [:mfussenegger/nvim-dap]} - :mfussenegger/nvim-dap {:opt false} - ;:opt false :config #(require "dots.plugins.nvim-dap")} + :mfussenegger/nvim-dap {:opt false :config #(require "dots.plugins.nvim-dap")} - :nvim-telescope/telescope-dap.nvim {:opt false - :requires [:mfussenegger/nvim-dap + :nvim-telescope/telescope-dap.nvim {:requires [:mfussenegger/nvim-dap :nvim-telescope/telescope.nvim]} ; code-related ----------------------------------------- <<< diff --git a/nvim/.config/nvim/fnl/dots/plugins/lsp.fnl b/nvim/.config/nvim/fnl/dots/plugins/lsp.fnl index 2bef38b..0996633 100644 --- a/nvim/.config/nvim/fnl/dots/plugins/lsp.fnl +++ b/nvim/.config/nvim/fnl/dots/plugins/lsp.fnl @@ -97,13 +97,21 @@ (on_attach client bufnr))}) -(let [rust-tools (require "rust-tools")] +(let [rust-tools (require "rust-tools") + rust-tools-dap (require "rust-tools.dap") + extension-path "/home/leon/.vscode/extensions/vadimcn.vscode-lldb-1.6.8/" + codelldb-path (.. extension-path "adapter/codelldb") + liblldb-path (.. extension-path "lldb/lib/libllb.so")] (rust-tools.setup {:tools {:inlay_hints {:show_parameter_hints false} :autoSetHints false} + :dap {:adapter (rust-tools-dap.get_codelldb_adapter codelldb-path liblldb-path)} :server {:on_attach on_attach :capabilities default-capabilities}})) ;:cmd ["/home/leon/coding/prs/rust-analyzer/target/release/rust-analyzer"]}})) + + + (let [sumneko_root_path (.. vim.env.HOME "/.local/share/lua-language-server") sumneko_binary (.. sumneko_root_path "/bin/Linux/lua-language-server")] (init-lsp diff --git a/nvim/.config/nvim/fnl/dots/plugins/nvim-dap.fnl b/nvim/.config/nvim/fnl/dots/plugins/nvim-dap.fnl index c23957e..b8061d7 100644 --- a/nvim/.config/nvim/fnl/dots/plugins/nvim-dap.fnl +++ b/nvim/.config/nvim/fnl/dots/plugins/nvim-dap.fnl @@ -11,19 +11,6 @@ :env {:LLDB_LAUNCH_FLAG_LAUNCH_IN_TTY "yes"} :name "lldb"}) -;; TODO This does not really work,.. REEEEEEEEEEEEEEE - - -;(set dap.adapters.rust - ;{:type "executable" - ;:attach {:pidProperty "pid" :pidSelect "ask"} - ;:command "lldb-vscode" - ;:env {:LLDB_LAUNCH_FLAG_LAUNCH_IN_TTY "yes"} - ;:name "lldb" - ;:initCommands ["command script import \"/home/leon/.rustup/toolchains/nightly-2021-03-18-x86_64-unknown-linux-gnu/lib/rustlib/etc/lldb_lookup.py\"" - ;"type summary add --no-value --python-function lldb_rust_formatters.print_val -x \".*\" --category Rust" - ;"type category enable Rust"]}) - (set dap.adapters.node2 {:type "executable" :command "node"