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

Relative paths and paths without columns not linked in debug console #13370

Closed
felixfbecker opened this issue Oct 7, 2016 · 23 comments
Closed
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug candidate Issue identified as probable candidate for fixing in the next release debug Debug viewlet, configurations, breakpoints, adapter issues verified Verification succeeded
Milestone

Comments

@felixfbecker
Copy link
Contributor

  • VSCode Version: 1.5, 1.6 insider
  • OS Version: Windows 10

image

Paths from the stack trace are not clickable

@Tyriar Tyriar added feature-request Request for new features or functionality debug Debug viewlet, configurations, breakpoints, adapter issues labels Oct 7, 2016
@weinand weinand assigned isidorn and unassigned isidorn Oct 10, 2016
@felixfbecker
Copy link
Contributor Author

Btw this also affects relative paths:

image

I would consider this more of a bug than a feature request, as it works correctly on the other OS. This is really slowing down productivity, please please consider this for the next iteration. I imagine it is just a wrong regexp somewhere.

@weinand weinand assigned isidorn and unassigned weinand Nov 7, 2016
@weinand weinand added bug Issue identified by VS Code Team member as probable bug and removed feature-request Request for new features or functionality labels Nov 7, 2016
@isidorn
Copy link
Contributor

isidorn commented Nov 8, 2016

Here is a code pointer
PRs that fix this are welcome. If it turns out to be too complex I can look into fixing this in the future

@felixfbecker
Copy link
Contributor Author

felixfbecker commented Nov 8, 2016

Thanks @isidorn I will take a look at this! Are there tests for this?

@isidorn
Copy link
Contributor

isidorn commented Nov 8, 2016

@felixfbecker no but adding tests would be even more super awesome.
It should be possible to create a ReplExpressionsRenderer with a MockEditorService and test out the link detection. If this seems unintersting I can look into adding tests in one of our debt weeks.

P.S this is good documentation on how to run vscode out of source and immediatly try out your changes https://github.com/Microsoft/vscode/wiki/How-to-Contribute
This change should not break the existing OS X and linux behavior - not sure if you have those machines but I can check it on my VMs easily

@isidorn
Copy link
Contributor

isidorn commented Nov 8, 2016

Also a bit related #6301

And make sure to get the very latest - now I polished the imports in that file so you might end up in merge conflicts if you start on a pr on an older code base.

@felixfbecker
Copy link
Contributor Author

felixfbecker commented Nov 8, 2016

Fixed the regexp so that

  • relative paths are matched (the "root" path is optional now)
  • paths without a column are matched ("column" path is optional now, as PHP only reports line numbers)
  • no line breaks and colons are allowed inside the path (otherwise change 2 would cause unintended matches)

image

Need to build VS Code now and find out if the match groups that may now be undefined cause any problems. Also need to test URIs.

@felixfbecker felixfbecker changed the title Windows path not linked in debug console Relative paths and paths without columns not linked in debug console Nov 8, 2016
@felixfbecker
Copy link
Contributor Author

I also noticed only group 1, 3 and 4 are used. Can I remove capturing of group 2 (root component)?

@isidorn
Copy link
Contributor

isidorn commented Nov 8, 2016

@felixfbecker I believe that group is there for a reason. Though @bpasero originally added it
Since you are now being less strict about link detection try to verify if you introduced false positives.
Once your change is in a good shape just create a PR and ping me on it - thanks!

@felixfbecker
Copy link
Contributor Author

Well I checked this with Find all references and the regexp is only used in a single place, where only the capture groups I mentioned are used. But I'm gonna leave it out for now.

@bpasero
Copy link
Member

bpasero commented Nov 8, 2016

These regexes are literally taken from our Azure version I think and super old. Feel free to revisit them, but make sure to see the test cases and update them as well 👍

@roblourens
Copy link
Member

This is now not working in Insiders on MacOS, maybe from this change?

Stable, links underlined and clickable:
image

Insiders, highlighted in the error message but not the stack trace, and that one link tries to open as a path relative to the workspace, then shows an error message because it can't find the file:
image

@roblourens roblourens reopened this Dec 9, 2016
@roblourens roblourens added the verification-found Issue verification failed label Dec 9, 2016
@roblourens
Copy link
Member

Actually I see the same thing in Windows. I think it's just highlighting the first link it finds instead of all of them. On Windows the link is still clickable though.

@aeschli
Copy link
Contributor

aeschli commented Dec 9, 2016

Also no success for me. Shouldn't this work? No links for me (Windows 10)

console.error('C:\\Users\\aeschli\\workspaces\\samples\\main.js:1');
console.error('C:/Users/aeschli/workspaces/samples/main.js:1');
process.exit();

image

@roblourens
Copy link
Member

It seems like it's only supposed to work with paths in parens and with :#:# like you'd find in a stack trace

@felixfbecker
Copy link
Contributor Author

Yes, or line start / line end should work too. I have no idea though why only the first link is highlighted and don't have time currently to investigate

@roblourens
Copy link
Member

Investigated, and there are sort of two problems:

@isidorn
Copy link
Contributor

isidorn commented Dec 12, 2016

Thanks @roblourens for a great investigation. The first issue is introduced by the last PR. The second issue is introduced by a refactoring on my end where we try to handle new lines in the debug console better.

I have pushed a safest fix that takes care of those two problems - reverted only the last PR and disabled the grouping together of the output. This should now bring us to the same behavior of the last stable release (with potentialy some improvements by the first two PRs).

Our link handling has many flaws and I plan to tackle this in the January release.

@isidorn
Copy link
Contributor

isidorn commented Dec 12, 2016

After testing this out it seems we have regressed a bit. Namely when there is one large output event we only detect the first link. This is practice means when a stack trace is printed that only the top stack trace element can be clicked.
If there are mutliple stack traces printed to the console then the first link in each stack trace will be detected.

I am not sure how big of a regression this is. This was working before becuase we were actually not handling the output events properly and we were separting them in new lines wrongly.

@weinand can decide if it is ok to ship with this limitation. If it is not ok to ship with this then I propose we go back to the old spliting each output per line.
In any case I plan to revisit how we do this whole link detection in January

@felixfbecker
Copy link
Contributor Author

Why not split it at the time the regexp is applied?

@isidorn
Copy link
Contributor

isidorn commented Dec 12, 2016

@felixfbecker yeah that is also an option. But when there are multiple links detected on one element than the formating / newlines get screwed up. So there would some additional changes required which are never smart to do in last minue fixes such as this one :)

@kieferrm kieferrm added the candidate Issue identified as probable candidate for fixing in the next release label Dec 12, 2016
@isidorn
Copy link
Contributor

isidorn commented Dec 12, 2016

@felixfbecker unforuntetly had to revert all your prs because we decided to go back to the behavior we had in vscode stable.

Since we have polluted the history of this bug I have created a new one and assigned it to January so we can properly fix this in the next release. Here is the issue #17085

@isidorn
Copy link
Contributor

isidorn commented Dec 12, 2016

For verification:

Verify vscode insiders is handling links in the repl the same way vscode stable is doing right now

@roblourens
Copy link
Member

Thanks, looks good to me on MacOS in master (needs verification in a real build)

@roblourens roblourens added verified Verification succeeded and removed verification-found Issue verification failed labels Dec 12, 2016
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug candidate Issue identified as probable candidate for fixing in the next release debug Debug viewlet, configurations, breakpoints, adapter issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

8 participants