-
-
Notifications
You must be signed in to change notification settings - Fork 227
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
"Require REPL Utilities" command is broken #451
Comments
Update: It works if I have the cursor in the repl window when I run this command, but shouldn't it work also if I have the cursor in the editor? I'm wondering if there is something wrong with the session returned here: Line 204 in fdc5d2e
If I put the CLJ_FORM below the above line into my editor and evaluate it, then I can use |
From the screenshot it looks like you are trying to evaluate |
The problem is that the REPL window and the editor do not share the same session. If you execute the command the tools will immediately work in the editor that was active while executing the command (only in this namespace the tools are aquired). In the current implementation the REPL window is only used to determine the session type (strange enough) but the session of the REPL window is not used to aquire the tools there as well. |
Yes you are absolutely wright. One way to make it work as well is to close the REPL window. Execute the command and then open the REPL window (which will clone the editor session with the aquired tools for the new REPL window) then change the namespace of the REPL window to that of the editor and then the tools will work. gg |
Actually I think this works as intended. No need to close and reclone any sessions. Sessions share definitions. If the utilities are required to namespace |
If a REPL Window exists shouldn't the command not be executed in both sessions? REPL Window and editor? |
Ok... so this was not working as you say it should above when I tried it in an existing leiningen clj project. However, I just created a Also I realized my namespace error in the image, but I corrected this in the existing project and it still would not work correctly. Not sure what the difference in projects could be, but I can't look into it more at the moment. |
That's odd. But at least it is consistent. Make a copy of that non-working project, so that you can use it for debugging the issue. 😄 |
Okay ~ ... At the risk of seeming crazy... I have some repro steps and a test repo. I don't really know how to make sense of the effects as of yet. The repo: The steps (with eval on save turned on, but can probably do the same with eval commands)
Now... the above always works with the core.clj file, however, in each of the Furthermore, if you avoid step 3 and add It's a very subtle difference in order of operations, but it is consistent when I try both ways. Besides the core.clj file, one way always works, the other way always does not work. |
I created a PR which fixes the issue in my tests. One critical point was to ensure that the namespace of the file exists in the REPL. If the namespace exists (even in case of the "empty" files Thanks! |
Ah that makes sense! Thanks! |
I was looking into #433 and I realized this command doesn't work, at least for me. I run the jack-in command, the repl window opens, and then I run the Require REPL Utilities command. I see
REPL utilities (like apropos, dir, doc, find-doc, pst, and source) are now available.
in the Calva says window, but I get an error when I try to usedoc
:The text was updated successfully, but these errors were encountered: