mfussenegger / nvim-dap

Debug Adapter Protocol client implementation for Neovim
GNU General Public License v3.0
5.1k stars 179 forks source link

Breakpoints inside lambda function #1149

Closed OuthBack closed 5 months ago

OuthBack commented 5 months ago

Problem Statement

Imagine you are calling a map function that recieves a lambda function as parameter and you want a breakpoint everytime the function runs.

const typedefs = sourceFile
  .getTypeAliases()
  .map((typeAlias) => {
    console.log("test");
    console.log("b");
    return generateTypedefDocumentation(typeAlias).trim();
})

Possible Solutions

A breakpoint symbolized as 🔴

🔴 const typedefs = sourceFile
  .getTypeAliases()
  .map((typeAlias) => {
🔴  console.log("test");
    console.log("b");
    return generateTypedefDocumentation(typeAlias).trim();
})

Everytime the lambda function runs it will trigger the breakpoint and stopping the app.

Considered Alternatives

I didn't find any alternatives yet

OuthBack commented 5 months ago

Actually I commited a mistake. The constant was empty and I thought it was the debugger fault. Sorry open this issue;