Fork me on GitHub

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.


Not seen that. When does it happen? Can you describe some repro?


@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?


Does it happen in the REPL window or also in the editor?


@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...


@pez it only happens in the editor


just to make sure, when you guys say the REPL window, are you referring to this one?


Yes, that one.


Very bad error to happen in the editor. Is this something you can repro, @brandon.ringe?


i'll double check, but the REPL window's fine. it's the editor that freaks out


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


Cool. Let me know when you have some time.


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.

👍 4

@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?


Damn that was fast haha


@borkdude thank you. I see.. it is treated outside of VScode/Calva.


yeah, it's just some configuration that applies to clj-kondo independent of editor


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


depends. can you show a code snippet? I don't know meander


it depends = if it's very much like an existing macro


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.


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.


For now you can use the config to disable the unresolved symbols


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


if it doesn't you could try to ask the lib maintainer to add support for it


I mean:

(defn favorite-food-info [foods-by-name user]
  (m/match {:user user
            :foods-by-name foods-by-name}
     {: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