-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Make file names in error messages links to that file. #109841
Make file names in error messages links to that file. #109841
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @WaffleLapkin (or someone else) soon. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
This comment has been minimized.
This comment has been minimized.
These commits modify the If this was intentional then you can ignore this comment. |
After further inspection the terminal links standard is a little more involved. I've made some fixes. https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda We need to look into how the test is going to work. A correct file uri involves the hostname which isn't static in CI. I should also add a test for file names with non ascii characters. Not sure of the best way to do that as of now. |
This comment has been minimized.
This comment has been minimized.
Can't really get CI to pass right now. We will need more discussion on the correct way to do that. Perhaps the hostname could be replaced with |
The job Click to see the possible cause of the failure (guessed by this bot)
|
r? @estebank probably knows better how this works |
I tried to get this working on the original PR and I encountered the same issues you did, including terminals that worked without a host, but didn't support a host being set, and others that didn't work without a host. Additionally, when using VSCode SSHd to a remote desktop, the file URLs still try to open a local file. It seems like file path support is even lower than that of file paths :-/ I don't know if we should try to accomplish this today, and maybe instead pester upstreams to gain more support? |
Another option is to just leave out the hostname. That removes the need for extra dependencies and complexity at the cost of not working correctly in some terminals/situations. I think the cost of the link not working is fairly low (?) and it is a convenient feature. If it doesn't work correctly people will mostly understand why (if they are sshd to a remote machine). OTOH I'm not sure if this sort of kinda works attitude is in line with what Rust wants to do. Personally I made this PR becuase this is something I want myself while coding Rust and I would rather have it be available than not exist at all. We could also add another option or my options to the current option (e.g. |
It might make sense to make this a separate opt-in. In the terminals that I regularly use, they already recognize paths that can be resolved, turning them into links when pressing ctrl/command that open the file with whatever default application you have set up (and had the benefit of working with SSH + VScode). That's why I felt it wasn't necessary to spend too much time figuring that part out on the original PR :) |
Ok. What about making |
@Dragon-Hatcher that sounds reasonable to me. If |
☔ The latest upstream changes (presumably #109133) made this pull request unmergeable. Please resolve the merge conflicts. |
Switching to waiting on author for further design work (IIUC the context) . @Dragon-Hatcher Feel free to request a review with @rustbot author |
ping from triage - can you post your status on this PR? There hasn't been an update in a few months. Thanks! FYI: when a PR is ready for review, send a message containing |
I'm still interested in the feature but I don't have time to work on this right now. |
Ping from triage: I'm closing this due to inactivity, Please reopen when you are ready to continue with this. @rustbot label: +S-inactive |
#107838 Made error codes in error messages link to the webpage that explains the error code.
This change expands on that by making the file names in error messages link to the file. This makes it easy to open the file with the error by clicking the link to the file.