Skip to content

Commit

Permalink
Attempt to have auto install for dap
Browse files Browse the repository at this point in the history
  • Loading branch information
BitInByte committed Apr 21, 2023
1 parent c12b7c3 commit 4b484b2
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 16 deletions.
41 changes: 30 additions & 11 deletions nvim/lua/core/dap/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
-- return
-- end

local dap = require("dap")
-- local dap = require("dap")
local dap_ui = require("dapui")
-- -- local dap = require("dap")

Expand Down Expand Up @@ -85,17 +85,36 @@ dap_ui.setup({
},
})
-- require("mason-nvim-dap").setup_handlers({})
require("mason-nvim-dap").setup({
automatic_installation = true,
handlers = {
function(config)
-- all sources with no handler get passed here

-- Keep original functionality
require("mason-nvim-dap").default_setup(config)
end,
},
})
-- dap.adapters.firefox = {
-- type = "executable",
-- command = "node",
-- -- args = {os.getenv('HOME') .. '/path/to/vscode-firefox-debug/dist/adapter.bundle.js'},
-- }
--
-- dap.configurations.typescript = {
-- {
-- name = "Debug with Firefox",
-- type = "firefox",
-- request = "launch",
-- reAttach = true,
-- url = "http://localhost:3000",
-- webRoot = "${workspaceFolder}",
-- firefoxExecutable = "/usr/bin/firefox",
-- },
-- }

-- require("mason-nvim-dap").setup({
-- automatic_installation = true,
-- handlers = {
-- function(config)
-- -- all sources with no handler get passed here
--
-- -- Keep original functionality
-- require("mason-nvim-dap").default_setup(config)
-- end,
-- },
-- })

vim.fn.sign_define("DapBreakpoint", { text = "🔴", texthl = "", linehl = "", numhl = "" })
vim.fn.sign_define("DapStopped", { text = "🟡", texthl = "", linehl = "", numhl = "" })
Expand Down
15 changes: 13 additions & 2 deletions nvim/lua/core/mason/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,19 @@ require("mason-lspconfig").setup({
})
require("mason-nvim-dap").setup({
automatic_installation = true,
ensure_installed = { "chrome" },
automatic_setup = true,
ensure_installed = { "firefox" },
-- automatic_setup = true,
handlers = {
function(config)
-- all sources with no handler get passed here

-- Keep original functionality
require("mason-nvim-dap").default_setup(config)
end,
-- firefox = function(config)
-- require("mason-nvim-dap").default_setup(config)
-- end,
},
})
require("mason-null-ls").setup({
-- ensure_installed = { "stylua", "eslint_d", "prettierd", "prettier" },
Expand Down
9 changes: 6 additions & 3 deletions nvim/lua/modules/nv-lsp/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ return {
{ "lervag/vimtex" },
{ "akinsho/flutter-tools.nvim", dependencies = { "nvim-lua/plenary.nvim" } },
},
build = ":MasonUpdate", -- :MasonUpdate updates registry contents
config = function()
require("core.mason") -- lsp management
-- Lsp needs to be loaded after mason in order for
Expand All @@ -28,7 +29,8 @@ return {
},

{
"jay-babu/mason-null-ls.nvim",
-- "jay-babu/mason-null-ls.nvim",
"jayp0521/mason-null-ls.nvim",
event = { "BufReadPre", "BufNewFile" },
dependencies = {
"williamboman/mason.nvim",
Expand All @@ -41,8 +43,9 @@ return {
end,
},

"mfussenegger/nvim-dap",
"rcarriga/nvim-dap-ui",
{ "mfussenegger/nvim-dap", dependencies = {
"rcarriga/nvim-dap-ui",
} },

-- LSP Sources && Modules
{
Expand Down

0 comments on commit 4b484b2

Please sign in to comment.