Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug Console location metadata doesn't appear when not running in debug mode #4768

Closed
osaxma opened this issue Oct 3, 2023 · 8 comments
Closed
Labels
in debugger Relates to the debug adapter or process of launching a debug session in testing Relates to test execution of Dart/Flutter tests for end users is bug relies on sdk changes Something that requires changes in the Dart/Flutter SDK to ship before it will become available
Milestone

Comments

@osaxma
Copy link

osaxma commented Oct 3, 2023

Describe the bug

Issue 1: The URI on the right hand side of the Debug Console doesn't work (screenshot 1)
Issue 2: The URIs printed in the Debug Console and Test Results work but the line number isn't a part of the URI -- i.e. cannot jump to the line using the URIs (screen shot 1 & 2)

Please see the screenshots below:

1- Screenshot 1

Screen Shot 2023-10-03 at 3 35 41 PM

2- Screenshot 2

Screen Shot 2023-10-03 at 3 36 03 PM

To Reproduce
Steps to reproduce the behavior:

  1. create test/some_test.dart
  2. add the following snippet:
import 'package:test/test.dart';
void main() {

    void failure() => throw UnimplementedError();
    test('fail', () {
      failure();
    });
}

Please complete the following information:

  • Operating System and version: 12.6 (21G115)
  • VS Code version: 1.82.2
  • Dart extension version: v3.74.0
  • Dart/Flutter SDK version: Dart SDK version: 3.1.2 (stable) (Tue Sep 12 16:26:23 2023 +0000) on "macos_x64"

sorry if this is already reported or should be filed elsewhere -- please let me know

@osaxma osaxma added the is bug label Oct 3, 2023
@DanTup
Copy link
Member

DanTup commented Oct 9, 2023

The links on the right not working looks like the issue in #4573 which should be fixed in the latest builds/betas (works for me on a 3.2 build).

I think the second one is because VS Code doesn't handle links very well in Test Results (maybe slightly related to microsoft/vscode#150702, as the Peek Error window and Test Results both use terminals). The reason you can click on it when you hold Ctrl, is that that basically lets you click anything (for ex. UnimplementedError gets underlined when you hold Ctrl and hover it) and will try to open it. I think once they implement link providers there, we can contribute scanning for paths/lines in there.

Edit: Yeah, I verified our TerminalLinkProvider does not currently fire for that Test Results pane so we can't influence the links there yet.

@DanTup DanTup added the awaiting info Requires more information from the customer to progress label Oct 9, 2023
@osaxma
Copy link
Author

osaxma commented Oct 10, 2023

The links on the right not working looks like the issue in #4573 which should be fixed in the latest builds/betas (works for me on a 3.2 build).

I am mainly on stable now... so I will just wait until it gets there...

Feel free to close the issue unless you'd like to track it

Cheers

@DanTup
Copy link
Member

DanTup commented Oct 10, 2023

Will close as I don't think there's anything to do, but do shout if you see issues after you get the fix for #4573.

If microsoft/vscode#157500 gets implemented in VS Code, I'll add support for the other part - though it's probably not worth tracking in an open issue until that happens since sometimes things don't 🙃

@DanTup DanTup closed this as completed Oct 10, 2023
@DanTup DanTup added duplicate and removed is bug awaiting info Requires more information from the customer to progress labels Oct 10, 2023
@osaxma
Copy link
Author

osaxma commented Oct 11, 2023

Hi @DanTup

I just tried at a recent main (96ae2c3) in my local build and I noticed that it works for Debug

Screen Shot 2023-10-11 at 2 05 48 PM

... But the right-side links are not available anymore when I do Run without Debugging which seemes like a regression ..

Screen Shot 2023-10-11 at 2 06 03 PM

@DanTup DanTup changed the title Test Result URIs issues Debug Console location metadata doesn't appear when not running in debug mode Oct 11, 2023
@DanTup
Copy link
Member

DanTup commented Oct 11, 2023

Hmm, on the surface that doesn't feel right. I would expect we might fail to map package: URIs when not running under the debugger (because we use the debugger to map them), but it doesn't seem like these would be packages.

I presume you're testing with a simple Dart test, no Flutter involved?

@DanTup DanTup reopened this Oct 11, 2023
@DanTup DanTup added in debugger Relates to the debug adapter or process of launching a debug session in testing Relates to test execution of Dart/Flutter tests for end users and removed duplicate labels Oct 11, 2023
@DanTup DanTup added this to the v3.76.0 milestone Oct 11, 2023
@DanTup DanTup added the is bug label Oct 11, 2023
@osaxma
Copy link
Author

osaxma commented Oct 11, 2023

I presume you're testing with a simple Dart test, no Flutter involved?

Yeah, just Dart.

The screenshot is from a scratch project where the test file is exactly as the sample code in the original issue.

@DanTup
Copy link
Member

DanTup commented Oct 11, 2023

Thanks - I can repro and have found the issue. Working on a fix :-)

https://dart-review.googlesource.com/c/sdk/+/330140

@DanTup DanTup added the relies on sdk changes Something that requires changes in the Dart/Flutter SDK to ship before it will become available label Oct 11, 2023
copybara-service bot pushed a commit to dart-lang/sdk that referenced this issue Oct 12, 2023
…n stack traces

We only need a VM Service / thread to map dart/package URIs. We should always map file:// URIs.

Fixes Dart-Code/Dart-Code#4768

Change-Id: I19c1fdeae9c9ef66e276121bba22504e8bc9d094
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330140
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Helin Shiah <helinx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
@DanTup
Copy link
Member

DanTup commented Oct 12, 2023

Fixed by dart-lang/sdk@b706bfc. The fix ships in the SDK debug adapter, so it'll show up in a future SDK release.

@DanTup DanTup closed this as completed Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in debugger Relates to the debug adapter or process of launching a debug session in testing Relates to test execution of Dart/Flutter tests for end users is bug relies on sdk changes Something that requires changes in the Dart/Flutter SDK to ship before it will become available
Projects
None yet
Development

No branches or pull requests

2 participants