Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.
/ npm-dap.nvim Public archive

Run your npm scripts from the debugger dialog

License

Notifications You must be signed in to change notification settings

zyriab/npm-dap.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 

Repository files navigation

npm-dap.nvim

Run your npm scripts from the debugger dialog

🚧 Work in progress 🚧

How to use

Simply call the setup function somewhere after your DAP's JS/TS configurations.

for _, language in ipairs({ "typescript", "javascript", "typescriptreact", "javascriptreact" }) do
    require("dap").configurations[language] = {
        -- Your configs
    }
end

require("npm-dap").setup()

This will add a new configuration on top of your existing ones, giving you the possibility to now choose a script present in your package.json. Once the script has been chosen, it will show in the DAP action selector (you currently have to restart Neovim).

Every config is saved based on the current project's path so no polluting from other projects :)

If you want to remove a script or project altogheter, all your scripts choices are stored in $HOME/.local/share/nvim/npm-dap.json (on Linux, Mac OS too, probably... if you are on Windows, why the hell are you programming on that terrible OS? Do you like to suffer? Do you program in CodeBlocks with the worst light mode ever? Do you actually enjoy the fact that the number of days since a new JavaScript framework was released is 0 every single time? Or maybe you are a game dev... in any case, I can't help you).

TODO

  • Save already selected scripts and show them next time
  • Reload the config after choosing a script so that it shows without having to reload Neovim
  • Kill process on session end <-- seems to be a bug from vscode-js-debugger
  • Debug the sourcemaps jumps/messages
  • Prevent debugger from starting if no script was chosen
  • Add tests (͠≖ ͜ʖ͠≖)
  • Make sure it works well with JS as well (seems good)
  • See if it can work with other Node.js adapters

About

Run your npm scripts from the debugger dialog

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages