spatie / ray

Debug with Ray to fix problems faster
https://myray.app
MIT License
554 stars 102 forks source link

Editor link for vscode to detect file / remote from link #899

Open joshbmarshall opened 3 months ago

joshbmarshall commented 3 months ago

Background I have a mix of local and remote codebases I work on. So some will require the editor link for vscode to use vscode://file/ and some require vscode://vscode-remote/

Describe the bug Using "vscode" as the editor only uses vscode://file/ so only works with local files. If I change to a Custom URL and use vscode://vscode-remote/%path:%line then it works for remote codebases but not local files

Versions Ray version 2.7.5

You can use composer show to get the version numbers of:

To Reproduce Steps to reproduce the behavior: When using editor as VSCode:

  1. Click on a file:line link in the ray output from remote system
  2. See error that /ssh-remote+hostname... does not exist on this computer

When using editor with Custom URL vscode://vscode-remote/%path:%line

  1. Click on a file:line link in the ray output from local system
  2. See prompt that asks if I want to open vscode-remote:/home/... when I click Yes, nothing happens (does not open file)

Expected behavior The VSCode editor option should auto-detect when the ssh-remote+ or wsl+ etc are at the start of the local_path and use vscode://vscode-remote/ prefix instead of vscode://file/ prefix

Desktop (please complete the following information):

Additional Information I tried setting the Custom URL to be vscode://%path:%line and setting the local_path to be 'file/home/...' or 'ssh-remote+hostname...' but when I click on the link, it doesn't even bring up vscode