Closed pehbehbeh closed 4 months ago
I don't think the placeholder would be a breaking change. Sure, it won't work on older versions and other places, but only if you use __ROOT__
and those places could be updated too. Isn't it correct? Could you please try a PR?
I think it would be breaking, because __FILE__
currently contains /app/path/to/file.ex
. It would then only contain path/to/file.ex
and users would have to add __ROOT__
(or an explicit value) to their PLUG_EDITOR
to get the full path.
We could introduce two new vars then? __RELATIVEFILE__
and __ROOT__
?
Sounds good. Personally, I would then only need __RELATIVEFILE__
to configure PLUG_EDITOR
as follows:
vscode://file//Users/Phil/Documents/Code/myproject/__RELATIVEFILE__:__LINE__
But it would certainly not be difficult to add __ROOT__
as well.
Only the relative one works for me too. PR welcome!
When running inside a Docker container, the path used to generate editor links to a file looks like this:
The file is actually located on my system under:
So all generated links by
Plug.Debugger
are broken in my editor. I have not found a way to customise the root path.Possible solution: ENV variable
Maybe introduce a new ENV like
PLUG_EDITOR_ROOT
which could be set to/Users/Phil/Documents/Code/myproject
in this case. By default the previous behaviour is used. Would be non breaking.Possible solution: Placeholder
Introduce a third placeholder like
__ROOT__
which is set to/app/
(previous behaviour) and can be omitted:This would be a breaking change.
I would be happy to discuss a solution and can also try to provide a PR.