This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-01-24
Channels
- # aleph (1)
- # announcements (22)
- # atom-editor (11)
- # babashka (46)
- # beginners (60)
- # calva (44)
- # cider (18)
- # circleci (1)
- # cljdoc (12)
- # cljs-dev (5)
- # cljsrn (19)
- # clojars (3)
- # clojure (162)
- # clojure-dev (9)
- # clojure-europe (6)
- # clojure-italy (2)
- # clojure-losangeles (2)
- # clojure-nl (5)
- # clojure-spec (7)
- # clojure-uk (23)
- # clojureremote (1)
- # clojurescript (55)
- # community-development (14)
- # core-async (234)
- # cursive (14)
- # data-science (3)
- # datomic (32)
- # fulcro (5)
- # graalvm (20)
- # graphql (2)
- # hugsql (4)
- # jobs (11)
- # jobs-discuss (2)
- # joker (1)
- # juxt (3)
- # kaocha (1)
- # luminus (1)
- # off-topic (33)
- # pathom (3)
- # pedestal (1)
- # reagent (24)
- # remote-jobs (3)
- # shadow-cljs (38)
- # spacemacs (4)
- # specter (4)
- # speculative (54)
- # tools-deps (62)
- # vim (8)
- # vscode (14)
Hi guys. Has anyone maybe seen this error:
Running the contributed command: 'calva.replWindow.newLine' failed.
I'm on Ubuntu 18.04.3 LTS running Calva Jack-In. The annoying thing is the only way to make it go away is by closing & opening VS Code again.@pez at this stage it just starts happening by itself. i'll be working & then all of a sudden the next time i press enter it pops up this error message. from there on new-lines/enter key presses pops up this error every time, until i reopen VSCode. it also happens with my directional keys. is there maybe a way to get more detail on the error? maybe i can get some exception info somewhere in "VSCode diagnostics mode" or something
oh, i'm also using Calva on another machine, and i haven't seen the error on that Windows 10 one
@jacquesdpz Did you try to Close the repl Window and open it again?
@slack1038 no, i haven't tried closing the REPL window. i'll try this next time it pops up. i have disconnected from the REPL server & reconnected though & that didn't make a difference...
Very bad error to happen in the editor. Is this something you can repro, @brandon.ringe?
The problem seems to be that Calva thinks the REPL window is active. Why this would be so is strange and probably a vscode bug with Linux. Hard to fix unless we can reproduce it. It would be great if you had some time to look at it, @jacquesdpz. Do you? I have some time right now to zoom.
@pez ya, it's hard to reproduce, because thus far i haven't been able to establish a pattern or relate it with something specific that i'm doing - it just happens. also, it's not happening right now. but i won't have time today to zoom. let's see if we can do it next week sometime
I've seen this issue too on Linux @pez, more than once. But it seems very random and I haven't been able to repro, but haven't tried much either. Yeah, it does seem like Calva thinks the REPL window is active while the cursor is in the editor at that point, somehow. I think I've "fixed" it by clicking in the repl window and hitting enter then clicking back in the editor.
@jacquesdpz if you could create an issue (if you haven't yet) that would be much appreciated.
sure, will create an issue @brandon.ringe. yes, you are right, it's super random. i will give your workaround a try. anything's better than having to close & open VSCode 🙂
I’ve recently started using the Meander library and clj-kondo is highlighting the ?logic-variables. How do I tell it to ignore them? Or better yet when one is declared and not used?
@grounded_sage https://github.com/borkdude/clj-kondo/blob/master/doc/config.md#exclude-unresolved-symbols-from-being-reported
Damn that was fast haha
@borkdude thank you. I see.. it is treated outside of VScode/Calva.
I’m curious if there is a way to have it tell me when I declare one of these logic variables and don’t use if within the macro. Don’t expect that to be possible but if it is I will definitely apply it :p
Oh hang on... I remember why I asked now. I did look at this documentation.
The thing is the logic variables are made up on the fly. It’s not something refer’d in..
There's also an issue about core.match. Maybe it's the same? Again, don't know the lib
I’m on phone so it’s difficult to copy paste in a code block. This is the library link. https://github.com/noprompt/meander/blob/epsilon/README.md
Sorry. I know it’s not what you asked... I can only link to it at the moment
I’m guessing it would be a similar issue. As it is pattern matching libraries
so the first map introduces bindings and the last map is the where the bindings are used? I don't know a supported macro that is like this right now.
if this becomes a popular enough library, adding support for it is possible, but there isn't an issue for this right now, so people haven't asked for it yet
I'll wait for that. If enough people show interest, it might be added in the future.
if meander also accepts quoted maps, then you could try to use that. I guess the match thing could just be a normal function instead of a macro then
I mean:
(defn favorite-food-info [foods-by-name user]
(m/match {:user user
:foods-by-name foods-by-name}
'{:user
{:name ?name
:favorite-food {:name ?food}}
:foods-by-name {?food {:popularity ?popularity
:calories ?calories}}}
'{:name ?name
:favorite {:food ?food
:popularity ?popularity
:calories ?calories}}))
doesn't seem to work:
user=> (m/match {:food :a :price {:a 1 :b 2}} {:food ?food :price {?food ?price}} {:food ?food :price ?price})
{:food :a, :price 1}
user=> (m/match {:food :a :price {:a 1 :b 2}} '{:food ?food :price {?food ?price}} '{:food ?food :price ?price})
Execution error (ExceptionInfo) at user/eval6338 (REPL:1).
Yea I’ve only just started using it as of 2 days ago and only became aware of it around then aside from a little earlier in Defn podcast. It’s a minor inconvenience. So how do I ignore unresolved symbols that start with a ?
@grounded_sage clj-kondo doesn't support that (yet), it's either a fixed set of names in a specific call, or all names in a specific call
All good. Thanks for the insights and quick feedback @borkdude