You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In some situations like mixed Clojure / Java projects with Virgil
(see: PR #2724 )
we need to re-evaluate the ns macro of the current ns more often then in "usual Clojure coding",
as the (:import ...) of changed java classes needed to be re-evaluated in some situations to pickup changes.
Having a dedicated command which does so, and does not change cursor position, could be very useful.
The text was updated successfully, but these errors were encountered:
I think it could be good for discoverability to have such a command.
For anyone who sets out to implement it. Calva has dev utilities for finding the current ns form. Currently I think it will find the closest ns or in-ns from the cursor and towards the beginning of the document. We would probably need a version of this that only finds ns forms.
behrica
changed the title
add command to eval teh ns macro of current ns
add command to eval the ns macro of current ns
Feb 11, 2025
Just to clarify more the "use case".
When working with Virgil, and some Java changes do not "refresh",
(I saw it on change of method signatures)
the simplest for the user would be to re-eval all "import" expressions of Java classes
which can be spread across the ns.
(instead of searching the one for the Java code he has changed, which is an other option)
I am not sure, if there is a way "to find those..." and dynamically re-evaluate them.
(so then we would talk about a Calva feature of 're-eval all import' statements
The second best practice is therefore to have all imports in the ns macro, and re-eval only that, when something in Java is not refreshed on Clojure side.
In some situations like mixed Clojure / Java projects with Virgil
(see: PR #2724 )
we need to re-evaluate the
ns
macro of the current ns more often then in "usual Clojure coding",as the (:import ...) of changed java classes needed to be re-evaluated in some situations to pickup changes.
Having a dedicated command which does so, and does not change cursor position, could be very useful.
The text was updated successfully, but these errors were encountered: