03juan
Get Plug.Debugger to render vscode file links that open to WSL distro
The Plug.Debugger docs describe setting the PLUG_EDITOR environment variable to generate links to your text editor.
Unfortunately the example given, vscode://file/__FILE__:__LINE__, won’t work when the development environment is structured as:
- Windows host browser, as tested in Chromium-based Edge and Opera GX, and Firefox
- Windows VSCode with Visual Studio Code Remote - WSL extension
- Files in WSL distro
The VSCode docs Developing in WSL show how to force open a file from the windows command prompt
code --file-uri vscode-remote://wsl+Ubuntu/home/ubuntu/fileWithoutExtension but the browser complains that vscode-remote:// is not a registered protocol.
What does work is the format suggested in Issue #108257 · microsoft/vscode, exporting the envar before starting the dev server in either the integrated terminal or your favourite external terminal.
export PLUG_EDITOR=vscode://vscode-remote/wsl+[DISTRO]__FILE__:__LINE__
iex -S mix phx.server
Replace [DISTRO] with your distro’s name, e.g. wsl+Ubuntu, and note there is no / between it and __FILE__
Happy debugging ![]()
Popular in Discussions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #hex










