0
  1. I set a breakpoint because I want to investigate what's going on.
  2. I step over/into
  3. Suddenly it goes off to a different (external) file. It's a swirl of going back and forth to different files forever and after 15 minutes I'm still not in my file and don't know what bug I have.

How can I force the debugger to stay only in my file/or potentially only in my folder?

Question no.2. What's the diff btw step over and step into? enter image description here

2

1 Answer 1

0

In VSCode, if you want to skip over files that you don't want to debug, usually files in your node_modules etc you can add a setting to tell VSCode to skip the files when debugging, so you can make the configuration only debug your code.

You have to add a setting skipFiles to you launch configuration, i.e. launch.json

Example:

            "skipFiles": [
                "<node_internals>/**",
                "**/app/out/vs/**"
            ]

You can read more about excluding the files you don't want to debug here - Skipping uninteresting code (node, chrome)

Sign up to request clarification or add additional context in comments.

8 Comments

Thanks! I'd seen your answer in another post before posting my question but it was not helpful. Can you please show us the full example of launch.json for flutter? I couldn't make your example to work. It looks like your example may be for javascript...
You should have posted your whole launch.json then, the question was generic. anyway you can take a look at this file and see how the skipFiles object is set for dart projects. I will add the specific lines you might need for your dart project to the answer github.com/Dart-Code/Dart-Code/blob/master/.vscode/launch.json
My bad, I thought it was working but it was NOT. Adding your code "skipFiles" is NOT permitted and copying all launch.json from your link doesn't work either.
The only thing helpful here would be to see all the launch.json file
Then add it to your question :D. Anyway I don't have any dart project setup with me to check but, one way is to use VSCode's intellisense CTRL+SPACE and find all the options you debugger supports, maybe its named differently and you can find one which can skip files .
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.