- Notifications
You must be signed in to change notification settings - Fork43
mxsdev/nvim-dap-vscode-js
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
nvim-dap adapter forvscode-js-debug.
Every platform supported by vscode is provided. This includes:
| Adapter | Platform | Support |
|---|---|---|
pwa-node | Node.js | Full |
pwa-chrome | Chrome | Partial1 |
pwa-msedge | Edge | Untested |
node-terminal | Node.js | Untested |
pwa-extensionHost | VSCode Extensions | Untested |
Supports packer, vim-plug, etc. With packer, for example:
use {"mxsdev/nvim-dap-vscode-js",requires= {"mfussenegger/nvim-dap"} }
You must download and build a copy ofvscode-js-debug in order to use this plugin.
use {"microsoft/vscode-js-debug",opt=true,run="npm install --legacy-peer-deps && npx gulp vsDebugServerBundle && mv dist out"}
git clone https://github.com/microsoft/vscode-js-debugcd vscode-js-debugnpm install --legacy-peer-depsnpx gulp vsDebugServerBundlemv dist outNote: The upstream build process has changed sometime since the creation of this repo. If the above scripts don't work, please make sure you're using the latest version of
vscode-js-debug. Otherwise, feel free to file an issue!
require("dap-vscode-js").setup({-- node_path = "node", -- Path of node executable. Defaults to $NODE_PATH, and then "node"-- debugger_path = "(runtimedir)/site/pack/packer/opt/vscode-js-debug", -- Path to vscode-js-debug installation.-- debugger_cmd = { "js-debug-adapter" }, -- Command to use to launch the debug server. Takes precedence over `node_path` and `debugger_path`.adapters= {'pwa-node','pwa-chrome','pwa-msedge','node-terminal','pwa-extensionHost'},-- which adapters to register in nvim-dap-- log_file_path = "(stdpath cache)/dap_vscode_js.log" -- Path for file logging-- log_file_level = false -- Logging level for output to file. Set to false to disable file logging.-- log_console_level = vim.log.levels.ERROR -- Logging level for output to console. Set to false to disable console output.})for_,languageinipairs({"typescript","javascript"})dorequire("dap").configurations[language]= {...-- see below }end
Note that if vscode-js-debug was installed without packer, its root folder location must be set manually indebugger_path.
Seehere for all custom configuration options.
{ {type="pwa-node",request="launch",name="Launch file",program="${file}",cwd="${workspaceFolder}", }, {type="pwa-node",request="attach",name="Attach",processId=require'dap.utils'.pick_process,cwd="${workspaceFolder}", }}Jest2
{ {type="pwa-node",request="launch",name="Debug Jest Tests",-- trace = true, -- include debugger inforuntimeExecutable="node",runtimeArgs= {"./node_modules/jest/bin/jest.js","--runInBand", },rootPath="${workspaceFolder}",cwd="${workspaceFolder}",console="integratedTerminal",internalConsoleOptions="neverOpen", }}You may also want to check outneotest-jest, which supports this plugin out of the box.
{ {type="pwa-node",request="launch",name="Debug Mocha Tests",-- trace = true, -- include debugger inforuntimeExecutable="node",runtimeArgs= {"./node_modules/mocha/bin/mocha.js", },rootPath="${workspaceFolder}",cwd="${workspaceFolder}",console="integratedTerminal",internalConsoleOptions="neverOpen", }}- Integration withneotest-jest
- Support for switching between child sessions
I would like to say a huge thank you toJens Claes, whose dotfiles this plugin is based off of, and to all members who contributed tothis issue - the insight gained from this was paramount to the success of this project.
Footnotes
About
nvim-dap adapter for vscode-js-debug
Topics
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.