Fork me on GitHub
#cursive
<
2019-11-04
>
sroller02:11:33

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

grierson13:11:23

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'

jumar13:11:48

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.

jumar13:11:19

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

jumar13:11:29

but frankly I don't need it that often

grierson13:11:20

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

grierson14:11:52

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

jumar14:11:28

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)

dmarjenburgh16:11:05

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.

cfleming01:11:52

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

cfleming01:11:23

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

cfleming01:11:45

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

borkdude13:11:03

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

sogaiu14:11:06

his screenshot doesn't show what he has for working directory btw, your screenshot on your editor-integration.md 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.

sogaiu14:11:51

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

sogaiu14:11:24

i didn't try with clojurescript though.

sogaiu14:11:01

may be he got it working?

henrik15:11:41

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

cjmurphy15:11:00

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.

henrik15:11:51

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?

cjmurphy15:11:17

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 http://book.fulcrologic.com/fulcro3/#_ide_integration.

henrik15:11:30

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.

cjmurphy16:11:49

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.

cfleming01:11:07

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

cfleming01:11:29

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

cfleming01:11:35

The other is symbol resolution, like this:

cfleming01:11:38

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.

borkdude15:11:53

@sogaiu It seems he was able to fix his problem

henrik15:11:19

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)

borkdude15:11:30

@U06B8J0AJ You can configure it to go less nuts with the macros using configuration: https://github.com/borkdude/clj-kondo/blob/master/doc/config.md

henrik15:11:48

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?

borkdude15:11:46

Very much so. If you could post the config that works for fulcro here: https://github.com/borkdude/clj-kondo/issues/559

henrik15:11:20

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

henrik15:11:47

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?

cfleming01:11:48

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