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

how to setup dap config from user config files #14

@vamsig7

Description

@vamsig7

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 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions