03juan

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:

  1. Windows host browser, as tested in Chromium-based Edge and Opera GX, and Firefox
  2. Windows VSCode with Visual Studio Code Remote - WSL extension
  3. 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 :confetti_ball:

Where Next?

Popular in Discussions Top

sergio
There’s a new TIOBE index report that came out that shows Elixir is still not in the top 50 used languages. It also goes on to call Elix...
New
AstonJ
I’ve just started the Phoenix part of the utterly brilliant online course by @pragdave. On generating the Phoenix app he uses the --no-ec...
New
und0ck3d
Hello everyone! A few days ago I’ve created a topic here about how people were creating CMSs with Elixir and Phoenix. I’ve been studying...
New
chulkilee
Here are the list of HTTP client libraries/wrappers, and some thoughts on HTTP client in general. I’d like to hear from others how they w...
New
slashdotdash
Phoenix Live View is now publicly available on GitHub. Here’s Chris McCord’s tweet announcing making it public.
New
tomekowal
Hey guys! I want to create a toy project that shows a chart of temperature over time and updates every 5 seconds. I feel LiveView is per...
New
Fl4m3Ph03n1x
Background A few days ago I was listening to The future of Elixir from Elixir Talks, with Dave Thomas (@pragdave ) and Brian Mitchell. I...
New

Other popular topics Top

KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 36654 110
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
985 44532 311
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New

We're in Beta

About us Mission Statement