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 does not have link detection #27713

Closed
alexdima opened this issue May 31, 2017 · 18 comments
Closed

Debug console does not have link detection #27713

alexdima opened this issue May 31, 2017 · 18 comments
Assignees
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues feature-request Request for new features or functionality release-notes Release notes issues verification-needed Verification of issue is requested verified Verification succeeded

Comments

@alexdima
Copy link
Member

Testing #26203

In the testplan item, we are instructed that the debug console should detect links, however it appears it does not.

Have a file with the following content:

function fib(n) {
    if (n === 1 || n === 0) {
        throw new Error('Unexpected');
    }
    return fib(n - 1) + fib(n - 2);
}
try {
    fib(3)
} catch(err) {
    debug;
}
  • press F5
  • the exception widget pops up inside the catch statement (which is nice)
  • in the debug console, evaluate err
  • Observe: the error stack trace is not clickable in the debug console.

screen shot 2017-05-31 at 11 09 19

@michelkaporin
Copy link
Contributor

michelkaporin commented May 31, 2017

@alexandrudima Apologise, I had to be more precise when saying that 'debug console' supports it. Link detection works only in the repl viewer-type part of debug console. Once err is requested, it is renderer as a tree, which is not supposed to go through the link detection mechanism. I doubt that it is helpful in the debug experience to navigate links through the object properties. Also this is the behaviour it used to be for the previous link detection in debug console.

Closing this for now. If people would like to have this feature, we can open it as a feature request.

@michelkaporin michelkaporin added the feature-request Request for new features or functionality label May 31, 2017
@alexdima
Copy link
Member Author

@michelkaporin @isidorn What is "the repl viewer-type part of debug console" and what steps does one need to do to see it ?

If I evaluate err.stack it also does not detect links:
image

@isidorn
Copy link
Contributor

isidorn commented May 31, 2017

I think @michelkaporin meant that link detection in the tree is not very useful and I agree on that. However if we evaluate err.stack the links should be detected -> reopening
Maybe there is already a duplicate for this, however @michelkaporin would know better since I forwarded some of those bugs to him

@isidorn isidorn reopened this May 31, 2017
@michelkaporin
Copy link
Contributor

@alexandrudima I was not adding link detection to the debug console in #26203, instead just amending an existing implementation by linking it to the better link detection mechanism. Hence, sorry for the naming confusion here. By "the repl viewer-type part of debug console" I meant only the simple output that is renderer in the REPL viewer. The example above is rendering an expression rather then simple output and it was not going through the link detection before.

I agree that expression evaluation probably should have detect links also, hence leave it as an open feature request.

@michelkaporin michelkaporin added this to the Backlog milestone Jun 1, 2017
@alexdima
Copy link
Member Author

alexdima commented Jun 1, 2017

@michelkaporin

Thank you for the explanations. I didn't know a string in the Debug Console is handled differently if it comes from evaluating an expression or if it comes from the stdout of the debuggee. Good to know for the future.

@admsteck
Copy link

Would the link detection in the debug console also apply to URLs? Currently when I launch a debugging session of my Django application, it outputs the URL for the running instance in the debug console and it would be great if I could click on it to open a browser, rather than copy paste.

@michelkaporin
Copy link
Contributor

@admsteck there is another issue on that #197

@rebornix
Copy link
Member

We already have link detection in integrated terminal so it makes sense that we have them in debug console or other panels.

@Tyriar is it an easy thing to make the link detecting sharable through all panels?

@michelkaporin
Copy link
Contributor

@rebornix we've thought about that in #24489 with follow up in #23917 (comment).

@rsweetland
Copy link

rsweetland commented Mar 7, 2018

Here is a workaround to get clickable file paths (alt + click) to work for debugging:

Start your debugger process in the integrated terminal. Attach the VS Code Debugger to the existing process. Voila! Debug output with clickable line numbers.

More detail (Node.js):

  • Inside the integrated terminal, run your debug command. For example: mocha -w --inspect-brk. This will return a url with a port number.
  • In the Debug Panel, Add a configuration for Node.js: Attach. Make sure the port matches what was returned from your debug command above.
  • In the Debug Panel, click green triangle to attach VS Code to the debugger.

@weinand weinand added the debug Debug viewlet, configurations, breakpoints, adapter issues label May 17, 2018
@vith
Copy link

vith commented Jun 14, 2018

@rsweetland thanks, alt+click works there! But a simpler way I found is to just use "console": "integratedTerminal" in the launch config while keeping "request": "launch" of using "attach".

@rsweetland
Copy link

Thanks @vith! Just updated to your method. Much better 👍

@jpike88
Copy link

jpike88 commented Aug 7, 2018

There should be special characters one can introduce to the debug output that linkify anything inside them.

That way link detection can be much faster, if performance is a concern.

@iansan5653
Copy link
Contributor

iansan5653 commented Dec 7, 2018

This would be a huge productivity boost for me if we could get something like this. A link markup (akin to markdown) would be fine or even better than automatic link detection. Currently I have to select the file path, copy it, Win+R, paste, and run to open a path.

To be clear, I'd like to be able to see file paths like images be clickable, not just debug statements with line numbers.

@orrgal1
Copy link

orrgal1 commented Dec 11, 2018

@rsweetland thanks, alt+click works there! But a simpler way I found is to just use "console": "integratedTerminal" in the launch config while keeping "request": "launch" of using "attach".

using this method but note that the integratedTerminal has some downsides compared to Debug Console. It's not coupled to the Callstack pane, and if you restart a process when the integratedTerminal for that process is not in focus, a new integratedTerminal opens. Also, I haven't found a way to name the terminal so they all just show up as Node Debug Console in the dropdown.

@iansan5653
Copy link
Contributor

iansan5653 commented Dec 11, 2018

The terminal also doesn't support evaluating expressions while debugging, colors, or quoted file paths, and it doesn't auto-clear and has extra text for every run, adding clutter.

@karlos231
Copy link

What about a clickable java exception stack trace in the debug console ? Could not find any extension or workaround.

@isidorn
Copy link
Contributor

isidorn commented Sep 13, 2019

This should be fixed now via #80502 thanks to @dgozman
We also plan to improve the link detection logic and are considering to turn on link detection in variables and watch pane. Feel free to share feedback - thanks!

To verify: make sure the initial comment works now for the debug console (the exception widget might not still work).

@isidorn isidorn closed this as completed Sep 13, 2019
@isidorn isidorn modified the milestones: Backlog, September 2019 Sep 13, 2019
@isidorn isidorn added the verification-needed Verification of issue is requested label Sep 19, 2019
@dbaeumer dbaeumer added the verified Verification succeeded label Oct 1, 2019
@isidorn isidorn added the release-notes Release notes issues label Oct 4, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Oct 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues feature-request Request for new features or functionality release-notes Release notes issues verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

No branches or pull requests