Significance of Current Module in VS Code

The code I’m developing is in a module RBSilly, which is what shows as the Current Module on the lower right of my VS Code window.

But when I enter code in the Julia REPL window at the bottom, it does not seem to be evaluating in that context. The module defines a function fit and to access it from the REPL I must say RBSilly.fit; the unqualified name is not known.

So I’m guessing the Current Module setting is only intended for code open in the editors. Is that correct?

And if I’d like to be in the RBSilly namespace in the REPL, what can I do? I suppose I could using RBSilly in the REPL (although maybe it would need to find the file?), but then I worry this would not stay current as I made edits to the file.

I am using Revise.

1 Like

If I understand correctly, your package is already in scope in the REPL as you can use “RBSilly.fit”, an additional “using RBSilly” wouldn’t help.
Are you exporting your function with “export fit” in your module?

1 Like

The module has no exports. I thought the meaning of the VS Code indication that I’m in the RBSilly module is that I have access to the names as if I were inside the module.

I am executing the commands in the REPL after telling VS Code to run the file with the module in the REPL.

1 Like

The current module is only set for inline evaluation. Juno for example also changes it for the REPL, but many users found that confusing.

1 Like

Thanks for the info. I don’t know if it’s possible, but it might be nice not to display the “current” module when focus is in the REPL. I noticed it changed when I moved from editing one file to another, and so this seems in the same spirit.
Ross

1 Like

I just had the same confusing moment

If the “Current Module” does not affect the REPL, as described above, I think it would be a proper visual feedback to make it switch back to “Main” when REPL is in focus, as @Ross_Boylan suggested

PS
I went to the official documentation and searched for this but could not find it. Maybe add just a mention somewhere?

1 Like