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
So, this is an old quirk, that I don't think have been reported yet. Calva's methods for selecting the current form, and the top level form, do not account for syntax with characters in front of lists and maps (and vectors, even if that is less problematic, I think).
Some examples are '(:foo), @foo, #?(:cljs :foo :clj :bar), #{:foo :foo}
The user should be able to place the cursor adjacent to these forms to be able to evaluate them with a command. And if they are top level forms, the cursors could be placed anywhere adjacent, or inside them, for the top level eval command to work as well. Instead:
(comment
'(1)|
;; => Execution error (ClassCastException) at nrepl-pprint-datomic.core/eval9432 (form-init7429449344366744362.clj:12).;; class java.lang.Long cannot be cast to class clojure.lang.IFn (java.lang.Long is in module java.base of loader 'bootstrap'; clojure.lang.IFn is in unnamed module of loader 'app')
'|(1)
;; => Execution error (ClassCastException) at nrepl-pprint-datomic.core/eval9440 (form-init7429449344366744362.clj:16).;; class java.lang.Long cannot be cast to class clojure.lang.IFn (java.lang.Long is in module java.base of loader 'bootstrap'; clojure.lang.IFn is in unnamed module of loader 'app')
|'(1)
;; => Syntax error reading source at (REPL:20:1).;; EOF while reading
@foo|
;; => Syntax error compiling at (core.cljc:1:8100).;; Unable to resolve symbol: foo in this context
|@foo
;; => Syntax error reading source at (REPL:28:1).;; EOF while reading
#?(:cljs:foo:clj:bar)|
;; => Execution error (IllegalArgumentException) at nrepl-pprint-datomic.core/eval7999 (form-init7514181033060422158.clj:32).;; Wrong number of args passed to keyword: :cljs
|#?(:cljs:foo:clj:bar)
;; => Syntax error reading source at (REPL:36:1).;; EOF while reading character
#{:foo:foo}|
;; => {:foo :foo}
|#{:foo:foo}
;; => Syntax error reading source at (REPL:43:1).;; EOF while reading character
)
(| marks the cursor position).
Top level evals all behave like the examples with the cursor adjacent to the right of the forms.
The text was updated successfully, but these errors were encountered:
So, this is an old quirk, that I don't think have been reported yet. Calva's methods for selecting the current form, and the top level form, do not account for syntax with characters in front of lists and maps (and vectors, even if that is less problematic, I think).
Some examples are
'(:foo)
,@foo
,#?(:cljs :foo :clj :bar)
,#{:foo :foo}
The user should be able to place the cursor adjacent to these forms to be able to evaluate them with a command. And if they are top level forms, the cursors could be placed anywhere adjacent, or inside them, for the top level eval command to work as well. Instead:
(
|
marks the cursor position).Top level evals all behave like the examples with the cursor adjacent to the right of the forms.
The text was updated successfully, but these errors were encountered: