How can I add a break point in VSCode to a dart file from an imported package?

后端 未结 2 822
说谎
说谎 2021-01-23 16:04

When an exception is thrown from within a dart file from an imported package VSCode will automatically open that source file to show where the exception was thrown. Once this fi

相关标签:
2条回答
  • 2021-01-23 16:41

    The settings mentioned in Rémi's answer control whether you'll step into the external files during debugging. If you'd like to add breakpoints but not step into external sources while debugging, you can use F12 (Go to Definition) from your code to jump into the packages to add breakpoints, or navigate to the files from the Dependencies tree on the Explorer pane.

    0 讨论(0)
  • 2021-01-23 16:45

    You need to enable one or two Dart Code settings:

    Add to your user settings the following:

    "dart.debugExternalLibraries": true,
    "dart.debugSdkLibraries": true,
    

    The first will allow debugging of pub packages; while the second will allow debugging of Flutter sdk.

    0 讨论(0)
提交回复
热议问题