Fork me on GitHub

found it under File->Settings->Keymap->Plug-ins->Cursive


How do I get Cursive to ignore a deftest? Tried commenting it out but it still gets picked up by Cursive when running 'Run all tests in namespace'


I don't know how cursive is doing that but I guess the problem is that you've evaluated the namespace and didn't restart the repl after commeting out the test definition so it's still present.


[i'm using spacemacs] I normally use remove-ns for this.


but frankly I don't need it that often


Ive tried load file and sync file with REPL but still happending


Just restarted REPL and it worked. But if I uncomment test then comment again I get the same issue.


Yep, as I suspected, it keeps the reference to the old test which is expected - not Cursive related I think, just a usual "gotcha" you get with REPL. You actually need to explicitly remove the definition from the running system, for which you can, e.g., use remove-ns (and then "load file" again)


As a workaround, I comment out the testing forms using #_s. I guess you could make a repl command that refreshes the ns and bind it to a shortcut.


@U3G3MBL9H Yes, @U06BE1L6T is correct I think, Cursive uses load-file which doesn’t completely remove the test NS and just loads the new state of the file on top of it. You can use remove-ns manually to do that. There’s an issue somewhere talking about this I think.


Actually, I can’t find one specific to tests, there’s one talking about using it for “Load file in REPL”.


It’s definitely been discussed before, perhaps in here or on the mailing list.


^ someone following instructions on how to use clj-kondo (a Clojure linter) in Cursive, but he's not able to get it all working. Maybe some of you could help.


his screenshot doesn't show what he has for working directory btw, your screenshot on your file has a value for scope (All Places) that appears inconsistent with the text description (Current File). Petrus Theron has the value corresponding to the text. in my tests, that value (Current File) works at least on some flavors of linux.


you did mention the working directory, but he didn't seem to respond to that?


i didn't try with clojurescript though.


may be he got it working?


I’m entirely new to Cursive (trying it out, finally!). What do I do with the unresolved typos?


You can alt-enter when your cursor is at the typo, then there will be an option to add the word to the project level dictionary. Another option is to turn the checking off.


So, this dictionary is separate to namespace resolution? I.e., they can be resolved OK, and there’s still a typo because the word itself is unknown?


Yes that's it. I can't remember seeing defsc as a typo, and I guess ideally it would not be if you have resolved it to the fulcro namespace. But I assume you've already done that, as described


Yeah, indeed, and I’ve verified that the resolutions are set up in preferences. Unfortunately, this doesn’t seem to actually resolve the symbol in question.


Yes, doesn't add it to the dictionary at the same time. But it is a minor thing to add words to the dictionary and only takes a few seconds really. But it is quite powerful to have cursive know the special Fulcro symbols. For instance any defsc component can be searched for by name with ctrl-shift-alt-N, just as you would search for any other symbol.


Yes, there are two types of thing that get marked - one is just spell checking, like:


Those you can just add to IntelliJ’s dictionary assuming you think the spelling is ok.


The other is symbol resolution, like this:


The fix for those is case-specific, sometimes you can use Resolve as…, sometimes it’s something being misconfigured, and sometimes it’s just something that Cursive doesn’t understand that I still need to fix - CLJS is particularly bad for this last category, I’m planning to work on that soon.


@sogaiu It seems he was able to fix his problem


This was fortuitous as it prompted me to set up clj-kondo for Cursive, which works well 🙂 (it goes a bit nuts with all the Fulcro macros, but I love it nonetheless)


@U06B8J0AJ You can configure it to go less nuts with the macros using configuration:


Ah, neat. Seeing as more than one person is likely to use Fulcro etc., would you be open to PRs for “templates” of configuration for stuff like Fulcro?


Very much so. If you could post the config that works for fulcro here:


Sure, I’ll just work out what that config would be first 🙂


A question regarding running multiple REPLs. I’ve set it up like follows: start an external REPL, courtesy of shadow-cljs, connect two REPLs to it, one in which I run (shadow/repl :client) to target CLJS. The other one is for CLJ. This works well enough, though it requires switching to the correct REPL when jumping between CLJ and CLJS. Is it possible to set this up to target the correct REPL automatically given the current file type?


Currently no, but I’m working on some REPL changes which will allow this (i.e. there will be a dual CLJ/CLJS REPL type).

👍 16