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
FYI: I was testing with the latest release and the fix did not quite work the way I expected for our particular use case. After experimenting with this briefly, I think the feature works as expected when you require the corresponding namespace which contains the var when you want to refer to it with a symbol. For example, here in the test.
Our use case looks more like (pseudo-code, might not compile):
(nssome-ns.with-vars
(:require [... a bunch of stuff ...])
(defnsome-function []
"I do something")
;; elsewhere..
(nssome-ns.program;; No require for `some-ns.with-vars` here!
(:gen-class))
(defoperations {"foo" 'some-ns.with-vars/some-function})
(defnmain- [& args]
(when-let [s (get operations (first args))]
((requiring-resolve s)))
Is your feature request related to a problem? Please describe.
We sometimes use a combination of a datastructure +
requiring-resolve
to lazy-load and invoke functions/vars. The datastructures might look likeWith #1446 we can navigate from the datastructure to the var. But not the other way around:
some.namespace/foo-fn
back to the datastructure ("No references") andclojure-lsp
will report thatsome.namespace/foo-fn
is an "Unused public var"The latter can be quite problematic, as you might accidentally be tempted in removing the var as it's "unused code".
Describe the solution you'd like
Quoted qualified symbols should work like var-quote (
#'some.namespace/foo-fn
). Assuming of course the symbol points to an actual var somewhere.The text was updated successfully, but these errors were encountered: