-
Notifications
You must be signed in to change notification settings - Fork 110
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
includet and include don't actually do the same thing, and they should. #682
Comments
I don't think there's a way for |
If I can create a way, and make a pull request, would you merge it?
…On Tue, May 17, 2022 at 3:51 PM Sebastian Pfitzner ***@***.***> wrote:
I don't think there's a way for includet to stay a function *and* get its
caller's scope. You can of course already use includet(@__MODULE__,
"myfile.jl").
—
Reply to this email directly, view it on GitHub
<#682 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEVLQ5SMM5X6QDS2AF3RPPTVKNFYXANCNFSM5WBF4JHA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Impossible to say in the absence of the PR. But we merge PRs all the time here and in other packages. Good PRs include a test and a clear motivation, and in this case the fact that you can use |
Also LanguageServer doesn't track functions included in As for the simplest MVP/fix is to change every includet to include and LanguageServer linkings will work, so LS navigations will work again. This is a serious issue, I don't know if the two are connected, or I should just open a separate issue. |
That's funny because VSCode bundles Revise. So it knows about |
We could just make an |
Sure, but I still don't quite see the motivation for this. |
I don't think this should be closed. |
Issue
include() evaluates the contents of the input source in the global scope of the module you're in.
includet() evaluates the contents of the input source in the Main module only.
This is a major source of issues, as users like me will expect includet() to be a "tracking" version of include, otherwise the same.
I just spent 3 hours debugging an issue where if I included code using Genie (which used a different Module than Main), the included methods were nowhere to be found, but if I included the code directly from the REPL it worked fine. It was challenging to figure out what's going on.
Request
Can we change the behavior of includet to use the module it's in instead of Main all the time? Should be as easy as using @MODULE() I hope?
The text was updated successfully, but these errors were encountered: