Skip to content
This repository has been archived by the owner on Apr 24, 2024. It is now read-only.

how to setup dap config from user config files #14

Open
vamsig7 opened this issue Jun 14, 2023 · 0 comments
Open

how to setup dap config from user config files #14

vamsig7 opened this issue Jun 14, 2023 · 0 comments

Comments

@vamsig7
Copy link

vamsig7 commented Jun 14, 2023

I am trying to setup the debugger from react and am successful in doing so, only if I add my config file somewhere inside the Astrovim folder and calling require for this config file

Eg added my config nvim-dap-config.lua inside astrovim/plugins/configs/nvim-dap-config.lua and called
local dap-config = require("plugins.configs.nvim-dap-config") inside mappings.lua .Everything is working as expected

now I wanted to move this file to $HOME/config/astrovim/user/... Can i get some help on how to acheive this

Contents of nvim-dap-config.lua

local dap = require("dap")
dap.set_log_level("TRACE")
dap.adapters.node2 = {
  type = "executable",
  command = "node",
  args = { vim.fn.stdpath("data") .. "/mason/packages/node-debug2-adapter/out/src/nodeDebug.js" },
}
dap.configurations.javascriptreact = {
  {
    name = "Chrome (9222)",
    type = "chrome",
    request = "attach",
    program = "${file}",
    cwd = vim.fn.getcwd(),
    sourceMaps = true,
    protocol = "inspector",
    port = 9222,
    webRoot = "${workspaceFolder}",
  },
  {
    name = "React Native (8081) (Node2)",
    type = "node2",
    request = "attach",
    program = "${file}",
    cwd = vim.fn.getcwd(),
    sourceMaps = true,
    protocol = "inspector",
    console = "integratedTerminal",
    port = 8081,
  },
  {
    name = "Attach React Native (8081)",
    type = "pwa-node",
    request = "attach",
    processId = require("dap.utils").pick_process,
    cwd = vim.fn.getcwd(),
    rootPath = "${workspaceFolder}",
    skipFiles = { "<node_internals>/**", "node_modules/**" },
    sourceMaps = true,
    protocol = "inspector",
    console = "integratedTerminal",
  },
}

I tried following the same  method as above,  the file is getting detected by the astro config, but dap  this new dap config is not getting appended

Any help on how to add this config in  my user astro config will be much appreciated
I don't want to lose new features 
@vamsig7 vamsig7 changed the title how to setup dap config from use how to setup dap config from user config files Jun 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant