FromFile.jl's @from should be recognized by the julia-vscode extension

mkitti
Mon, 23 Oct 2023 00:01:26 +0000
VS Code

FromFile.jl fans are pushing to integrate FromFile.jl functionality integrated into Julia itself. Part of the motivation is to improve compatability of the VSCode extension with FromFile.jl.

There was pull request to do so by MariusDrulea:

github.com/julia-vscode/StaticLint.jl

support for FromFile imports, @from "file.jl" using mymodule

julia-vscode:master ← MariusDrulea:master

opened 02:51PM - 18 Nov 21 UTC

MariusDrulea

+74 -0

Support for FromFile imports, @from "file.jl" using mymodule. https://github.co…m/Roger-luo/FromFile.jl This PR solves the following issue: https://github.com/julia-vscode/julia-vscode/issues/2548 ``` """ FromFile @from includes: @from "a.jl" using am @from "a.jl" using am: myfun_a, myfun_a2 @from "a.jl" import am @from "a.jl" import am: myfun_a, MyStruct_a See: https://github.com/Roger-luo/FromFile.jl Implementation summary: transform: @from "a.jl" using am into: include("a.jl") using .am We call the followinclude method for include("a.jl"). The "using .am" expression will be traversed later and will be therefore evaluated at that point in time. """ ``` Sample auto-complete of symbols imported with @from: ![image](https://user-images.githubusercontent.com/27725572/142495295-c3ce19a2-a753-47d3-a8eb-f8738cf722a4.png)

Recently, support for Revise.includet was added to the VSCode extension. I know this is slippery slope, but I think this should be strongly considered even if through a prototype unstable plugin mechanism.

This harkens back to @ChrisRackauckas’s question of when does a package become part of Julia?

Basically, at the moment we have a circular situation.

“I don’t think we should start to support such specialized things that are not in Julia base and are really package specific.” - @davidanthoff

Meanwhile the debate in PR 4600 and the Implicitly loaded moduels continues on without clear resolution.

I am personally not a FromFile.jl user. I actually prefer to explictly order includes.

However, I do think it would be easier to add support for FromFile.jl in the vscode extension than it would be to incorporate this into the langauge. Given that this was recently done for Revise.jl, I think this should be reconsidered. Meanwhile, we should also consider Chris’s question in order to give better guidance to the vscode extension developers.

7 posts - 5 participants