Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@eval the code sent to the REPL inside of the module #95

Open
cstjean opened this issue Aug 2, 2020 · 2 comments
Open

@eval the code sent to the REPL inside of the module #95

cstjean opened this issue Aug 2, 2020 · 2 comments

Comments

@cstjean
Copy link

cstjean commented Aug 2, 2020

When I C-c C-d, it does

@doc MyFunction

which fails because MyFunction isn't exported in the module I'm working with.

@eval MyModule @doc MyFunction

would work a lot more often, for all (?) of the commands that send stuff to the REPL. I'm not sure if there's a clean way to get a file's module, but "look at the path for a src, then use the parent directory name" would at least work for packages when no submodules are involved, and it's something I would feel comfortable making a PR for.

What do you think?

@tpapp
Copy link
Owner

tpapp commented Jan 14, 2021

This would make sense.

We could factor out the logic from julia-repl-activate-parent to locate a project, and have it used by another function to find a relative src and grep MyModule.jl for module MyModule, with various fallbacks. It would catch the common use case at least.

@NightMachinery
Copy link

@tpapp we can even make this not automatic at all; Just have a variable that can be set to explicitly control the module the code will be evaluated in. The special value 'auto can then delegate detecting the module back to this extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants