cursive

Issues at: https://git.io/cursive-issues
wilkerlucio 2021-06-04T01:51:10.090200Z

when editing large files I notice a significant performance hit when the LSP is active

wilkerlucio 2021-06-04T01:52:19.090500Z

I guess its verifying things as I type, while the file watcher only does it when I save

cfleming 2021-06-04T03:18:20.090700Z

More generally, there’s basically no way to do anything in IntelliJ without a project. The only thing you get without a project is the welcome splash screen.

cfleming 2021-06-04T03:19:52.090900Z

The only thing that’s really possible at the moment is the new LightEdit mode (https://blog.jetbrains.com/idea/2020/04/lightedit-mode/), but as far as I know that’s pretty experimental at this stage.

2021-06-04T09:02:48.091200Z

To be honest nice ways of showing more complex stuff in ways that can be expanded, using nav and datify would be cool. I've never really used REBL that much, but if it was to a degree available in cursive that would be amazing...

cfleming 2021-06-04T11:34:22.091500Z

I’m actually planning that soon, with inline rendering.

1
onetom 2021-06-04T11:51:15.102400Z

I keep experiencing a namespace loading issue, which seems to be sensitive to timing. I change a file and if I quickly press Cmd-Shift-L or M, not all my changes are reflected in the REPL process. It started to manifest more often lately, so I hooked up clojure.tools.namespace/refresh and kaocha to a Cursive REPL command and assigned a shortcut to it, hoping to improve the situation. The result is total chaos. If I use Cmd-Shift-L and refresh in alternation, my changes won't be reflected in the REPL anymore. Has anyone using ctnr/refresh successfully from Cursive? Has anyone experienced missed loading of changed files? How should I approach the problem of creating a minimal reproducible example?

cfleming 2021-06-07T03:17:01.123400Z

I’ll try to reproduce this - Cursive does save all files before executing these commands, but it’s possible that IntelliJ takes a while to flush to disk? I’m not sure.

cfleming 2021-06-07T03:25:57.123600Z

In terms of a repro test case, anything I can run would be helpful. Perhaps just a project set up like yours with a simple test (= "Hello" "Hello")? Then it should be possible to change one of the strings and run the test quickly to see the problem.

1👍
onetom 2021-06-07T07:57:57.125500Z

it seems the problem is that the current file is not always correctly identified as a modified file. so if my REPL command is configured to Before executing: Sync all modified files, then i modify my test source and run my (time ((requiring-resolve 'kaocha.repl/run) :unit)) REPL command, my current test state might not be loaded into the REPL process. the missing Loading test/ns/xxx_test.clj... done lines in the REPL tool window correctly reflect what happens.

onetom 2021-06-07T07:58:52.125700Z

so, this phenomena is observed without using ctnr/refresh

onetom 2021-06-07T08:22:26.125900Z

@cfleming i've emailed you a video recording which demonstrates the issue. i think for now i can work around the problem by just using the Before executing: Load current file and try to remember to press Cmd-Shift-M, if I modified dependent files, but haven't reloaded them manually.

onetom 2021-06-07T08:28:25.126200Z

pushed the repo, which I used to record the video demonstration here: https://github.com/onetom/cursive-reload-issue

onetom 2021-06-07T10:50:50.138100Z

I have one more suspicion; Kaocha itself, since it's not exactly a trivial piece of software. I'm also experiencing something which makes no sense at all. I previous version of my test runs somehow, when I'm only editing and letting the Cursive REPL command load the current file and run kaocha. after manually switching over to the test namespace an load it with Cmd-Shift-L, it finally gets updated in the REPL process. (and I'm not changing the name of the deftest; I know that's a common cause for phantom tests; this is a different situation)

onetom 2021-06-04T12:03:53.111600Z

we are at the point, where we have to keep restarting the REPL way too often, because we just can't trust test results anymore. this is the REPL command definition, which I used rather successfully for months, but exhibits a timing issue:

<repl-command name="ginoco Kaocha" executionType="EXPRESSION" commandText="(time ((requiring-resolve 'kaocha.repl/run) :unit))" executeBefore="SYNC_ALL" executionNs="REPL_CURRENT" inNamespace="" saveAll="true" />
I change a character in my test code, trigger the REPL command with a shortcut, but faster than ~700ms, then the changed file is not reloaded, but the tests still run with the previous version of the code, yielding misleading test results :(

onetom 2021-06-04T12:08:21.114700Z

the new REPL command looks like this:

<repl-command name="ginoco Kaocha" executionType="EXPRESSION" commandText="(do (try (require 'gini.kaocha) (catch Exception ex))
    (clojure.tools.namespace.repl/refresh)
    (time ((requiring-resolve 'kaocha.repl/run) :unit)))" executeBefore="SYNC_ALL" executionNs="REPL_CURRENT" inNamespace="" saveAll="true" />
they (require 'gini.kaocha) is just configuring the stack trace filters, but not available in every REPL, that's why the try-catch around it.

imre 2021-06-04T12:11:27.115300Z

I use ctnr/refresh-all but not as part of a repl command

imre 2021-06-04T12:15:00.116Z

however, I think you need to use the :after to execute something after the refresh

1👍
imre 2021-06-04T12:15:09.116200Z

(repl/refresh-all :after `start)

bnstvn 2021-06-04T14:29:59.119500Z

what does it take to have the Add dependency to project.clj command/action work? ( i believe i never saw anything in the search popup)

cfleming 2021-06-07T04:29:49.124200Z

You’re right, that seems to be broken, I’ll look at that.

bnstvn 2021-06-07T12:14:41.140Z

thank you

lspector 2021-06-04T15:49:20.119800Z

Thanks @cfleming. Should it be possible for me to get LightEdit mode working with a .clj file now? I tried dragging a projectless .clj file to IntelliJ in my MacOS dock, and it opened but I wasn't able to evaluate anything.