chlorine-clover

About Chlorine for Atom and Clover for VS Code: https://atom.io/packages/chlorine and https://marketplace.visualstudio.com/items?itemName=mauricioszabo.clover
seancorfield 2020-03-10T00:17:54.119700Z

@mauricio.szabo If it helps with debugging that issue, the new tab that is opened is named filename... for an original file filename.clj -- note the ... -- so I'm wondering if whatever logic is finding the location of the definition is returning an invalid filename now sometimes?

seancorfield 2020-03-10T00:18:08.120Z

(I only just noticed that behavior)

seancorfield 2020-03-10T00:23:11.121100Z

(I have repro'd it on both Adopt OpenJDK 11 which I was using before and (Oracle) OpenJDK 14 which I'm using now -- so it's not related to the JDK)

seancorfield 2020-03-10T00:24:02.121500Z

(and it's the same behavior on 0.4.13 and 0.4.14)

mauricio.szabo 2020-03-10T00:59:52.123900Z

Yes, I don't think that it's an issue with the JDK. Java is only involved when the var is inside a jar file, and it opens a read-only editor...

mauricio.szabo 2020-03-10T01:01:47.127Z

If you could, can you tell me the filename that's giving problems? Or, maybe try to save the empty file and see what filename appears... I'm out of ideas (because I'm not seeing this issue on Linux and, as far as I remember, I just copy-pasted the code from a place to another)

mauricio.szabo 2020-03-10T01:02:08.127900Z

I'll diff the code and see if I can find anything strange.

seancorfield 2020-03-10T01:03:10.129100Z

It does seem to be just in certain files, which is weird, and I've just discovered that if I attempt 'go to def' in another file on one of the symbols in this notifications.clj file, I get the same weird notifications... behavior. So I'll try to narrow it down within this file.

seancorfield 2020-03-10T01:04:31.129900Z

So I saved the file and it is, indeed, called notifications... and it saves to the same folder as the original notifications.clj file.

seancorfield 2020-03-10T01:07:19.131700Z

I renamed it to notification_file.clj (and updated the ns to worldsingles.notification-file) and eval'd it, and I see the same wrong behavior: it opens a new, empty notification_f... file which saves to the same folder. Note that the filename is truncated: it's not notification_file...

seancorfield 2020-03-10T01:11:16.133200Z

OK, I experimented with a bunch of filenames... We have several files in different parts of the monorepo that have notification in their names and all of these seem to behave the same weird way. If I rename them to pretty much anything that doesn't have notification in it, things work as expected.

mauricio.szabo 2020-03-10T01:12:16.134Z

Ok, I'll look at it. Thanks, I think you helped a lot already :)

seancorfield 2020-03-10T01:13:04.134600Z

notificatio triggers the behavior, notificati is fine.

mauricio.szabo 2020-03-10T01:20:21.135100Z

Ok, the issue is... UNREPL elisions. I didn't copy-paste the old code correctly. I'll issue a fix right now 🙂

seancorfield 2020-03-10T01:23:52.135900Z

Pesky old unrepl! 🙂

mauricio.szabo 2020-03-10T01:27:14.137900Z

Yes, it helped me a lot in the beginning of the project, but currently is giving me trouble. I'll look into a way to not get in the way, there are some new features I want to add on Chlorine and UNREPL is currently on the way of these too.

seancorfield 2020-03-10T01:29:47.139100Z

I think the main "benefits" it brings, over having just a bare prepl, are: chunking of results so you don't crash the system by eval'ing a very, very large data structure; the ability to interrupt execution. Anything else?

mauricio.szabo 2020-03-10T01:38:31.141Z

Ability to parse (keyword "foo bar") and non-edn results (like Java objects) is another. It's harder than it seems (I'm trying to replicate it in ClojureScript, and it's kinda complicated).

mauricio.szabo 2020-03-10T01:38:53.141500Z

Also, some java objects behave like EDN structures but are not (for example, Datomic query results)

mauricio.szabo 2020-03-10T01:40:39.142400Z

Just published a new version. This version fixes the error (I was able to replicate it here on my machine after your help debugging). I hope I didn't miss anything 🙂

seancorfield 2020-03-10T02:32:35.142600Z

Confirmed fixed! Thank you!

🦜 2
mauricio.szabo 2020-03-10T02:36:55.143100Z

Great, thanks for helping me debug the problem!

seancorfield 2020-03-10T02:39:05.143500Z

So why was it just that one filename pattern seemingly?

mauricio.szabo 2020-03-10T13:44:12.146Z

Probably because the path of that filename was too large - then when Chlorine runs (meta #'var-name), it'll give a filename path too large, and UNREPL will cut it to:

#unrepl/string ["/path/to/filename/too-la" #unrepl/... (some-function <some-id)]

mauricio.szabo 2020-03-10T13:47:23.147900Z

To be able to parse it, Chlorine will generate a type IncompleteStr that reimplements toString to "/path/to/filename/too-la..."

seancorfield 2020-03-10T16:48:53.149900Z

I'm surprised I haven't tripped over it with other files then since we have quite a few things with longer paths. Anyways, good to know the cause (and have the fix so quickly -- thank you!).

mauricio.szabo 2020-03-10T17:35:47.152100Z

Well, the bug happened at version 0.4.13 and 0.4.14. Older versions were using another structure. I'm trying to unify everything so it becomes easier to test (and also to migrate to VSCode, for example)

seancorfield 2020-03-10T18:16:40.153Z

Ah, yeah, that's a small enough window I might just have missed it on other files. I've been working hard on a new notification-related feature for the last week or so 🙂