You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using Visual Studio Code under WSL remote. To build the URL for the editor link scheme I need to access an environment variable for the current distro being used. This works as an initializer, but I was hoping to contribute a patch to the KNOWN_EDITORS.
if defined?(BetterErrors)
BetterErrors.editor = "vscode://vscode-remote/wsl+#{ENV['WSL_DISTRO_NAME']}%{file_unencoded}:%{line}"
end
Thanks for this @coezbek! I see that you added it to the wiki page already, which is what I would have recommended rather than adding to KNOWN_EDITORS, especially since your case uses an environment variable to assemble the URL. However, I would also recommend that you change your snippet to only be executed when that environment variable is set. i.e.
One downside of this solution is that is isn't compatible with multiple
users using different editors on the same codebase. That's why I asked..
(I updated the wiki with the improved snippet. Thank you!)
I am using Visual Studio Code under WSL remote. To build the URL for the editor link scheme I need to access an environment variable for the current distro being used. This works as an initializer, but I was hoping to contribute a patch to the
KNOWN_EDITORS
.Discussion on SO for building the URL path for VS code remote: https://stackoverflow.com/questions/66582696/url-for-opening-vscode-in-file-in-wsl-workspace?noredirect=1#comment124115062_66582696
The text was updated successfully, but these errors were encountered: