You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support (and document) launch config debuggerType": 0 for both number and string #5855
The behavior is different based on file name. It runs package test if the file is ending in test.dart even though this file has nothing to with package test. Leading to a crash that it cannot find a suite with such name.
Did we add some logic to simplify running tests in the debugger from launch configurations?
If yes, can we fix the heuristics? Or get a way to disable it?
Screenshots
If applicable, add screenshots to help explain your problem.
Please complete the following information:
You can run the Dart: Collect Diagnostic Information command from the VS Code command palette (F1) to easily capture this information or provide it manually.
Operating System and version:
VS Code version:
Dart extension version:
Dart/Flutter SDK version:
Target device (if the issue relates to Flutter debugging):
I presume this is a typo, and you mean record_use_test.dart?
The behavior is different based on file name. It runs package test if the file is ending in test.dart even though this file has nothing to with package test.
If something is inside a test folder and ends with _test.dart we assume it's a test file:
I'm not sure I understand the change you're proposing. Are you suggesting to examine the file contents and try to infer whether it really is a test? That would require parsing (something we can't do in the extension) and might break test-wrapping packages like package:test_reflective_loader.
If this is just a one-off, we do now support overriding the debugger type (see #5535). Generally my preference is to improve heuristics where we can, but this might be a case where it's better to just override.
How to use it? "DebuggerType" seems to not be a valid field?
Oh, it's possible I didn't add it to the manifest (in which case, VS Code doesn't know it's valid, but it will still work). The original request was from another extension so it wasn't being coded directly into launch.json.
So, just try it anyway and ignore the VS Code warning. If it works, we can use this issue for adding it to the manifest with some docs.
changed the title [-]Running a dart script ending in `test.dart` cannot be run as non-test[/-][+][doc] Document launch config `debuggerType": 0,`[/+]on Dec 23, 2025
Great, I'll add it to the manifest with suitable docs. Maybe we should make it a string enum so you get better autocomplete/values (but still support the numbers too, since we assign the enum values to it internally).
changed the title [-][doc] Document launch config `debuggerType": 0`[/-][+]Support (and document) launch config `debuggerType": 0` for both number and string[/+]on Dec 29, 2025
Activity
DanTup commentedon Dec 23, 2025
I presume this is a typo, and you mean
record_use_test.dart?If something is inside a
testfolder and ends with_test.dartwe assume it's a test file:Dart-Code/src/extension/utils.ts
Lines 96 to 109 in 27900a0
I'm not sure I understand the change you're proposing. Are you suggesting to examine the file contents and try to infer whether it really is a test? That would require parsing (something we can't do in the extension) and might break test-wrapping packages like
package:test_reflective_loader.If this is just a one-off, we do now support overriding the debugger type (see #5535). Generally my preference is to improve heuristics where we can, but this might be a case where it's better to just override.
dcharkes commentedon Dec 23, 2025
Thanks for the lightspeed reply! 🙏
Ah yes, it's a typo. ☕ 🙃
Overriding would solve my issue. How to use it?
"DebuggerType"seems to not be a valid field?{ "name": "dart pkg/compiler/test/record_use/record_use_test.dart", "type": "dart", "request": "launch", "program": "pkg/compiler/test/record_use/record_use_test.dart", "args": [ "types_of_arguments", ], "cwd": "${workspaceFolder}", "debuggerType": 0, },DanTup commentedon Dec 23, 2025
Oh, it's possible I didn't add it to the manifest (in which case, VS Code doesn't know it's valid, but it will still work). The original request was from another extension so it wasn't being coded directly into
launch.json.So, just try it anyway and ignore the VS Code warning. If it works, we can use this issue for adding it to the manifest with some docs.
dcharkes commentedon Dec 23, 2025
Yep it works, without
LoadException (Failed to load "types_of_arguments": Does not exist.), with it works as expected 🙏Thanks @DanTup! One step ahead of me! 🚀
[-]Running a dart script ending in `test.dart` cannot be run as non-test[/-][+][doc] Document launch config `debuggerType": 0,`[/+][-][doc] Document launch config `debuggerType": 0,`[/-][+][doc] Document launch config `debuggerType": 0`[/+]DanTup commentedon Dec 23, 2025
Great, I'll add it to the manifest with suitable docs. Maybe we should make it a string enum so you get better autocomplete/values (but still support the numbers too, since we assign the enum values to it internally).
[-][doc] Document launch config `debuggerType": 0`[/-][+]Support (and document) launch config `debuggerType": 0` for both number and string[/+]Document debuggerType in launch config, and support string values