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
mauricio.szabo 2019-05-31T00:16:20.024200Z

Published a new version of Chlorine, fixing these problems with goto-var-definition. Also, added a test so hopefully there won't be regressions in the future 🙂

seancorfield 2019-05-31T00:25:02.024600Z

Go to var definition still doesn't work for me in most cases.

seancorfield 2019-05-31T00:26:09.025500Z

It'll go to Clojure core function definitions (where I get a Joker error, saying joker isn't on my path -- except it is and Joker works fine while I'm editing files).

seancorfield 2019-05-31T00:26:29.026Z

But it won't go to any definitions in files in my own code.

seancorfield 2019-05-31T00:28:58.027100Z

If I "inspect var" (sending #'<varname> to REBL), it shows the filename, line, and column in the metadata for the var correctly, so Clojure seems to know where the definition is, just not Chlorine. @mauricio.szabo

mauricio.szabo 2019-05-31T00:35:52.027800Z

Can you print the Joker error you're getting? (I'm not even using Joker btw...)

seancorfield 2019-05-31T01:02:21.028200Z

[Linter] Error running joker Error: Failed to spawn command `joker`. Make sure `joker` is installed and on your PATH
    at /Users/sean/.atom/packages/linter-joker/node_modules/atom-linter/lib/helpers.js:130:24
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)

seancorfield 2019-05-31T01:05:49.028700Z

Oh, I think that immediately follows this one

Uncaught Error: write EPIPE
    at _errnoException (util.js:1024:11)
    at WriteWrap.afterWrite (net.js:867:14)
from events.js 183.

seancorfield 2019-05-31T01:08:45.030100Z

Console actually shows three errors: that first one (Error running joker), then the EPIPE one, then the Error running joker again. And I do get two red popup errors that correspond to the Error running joker.

seancorfield 2019-05-31T01:09:55.030800Z

There's no error in the Console when Chlorine fails to go to a var def in my code (just the red popup Could not find definition for var).

seancorfield 2019-05-31T01:13:12.031600Z

If it helps debug the problem: I printed d and r(d) (from the compiled JS) and d is null.

seancorfield 2019-05-31T01:17:03.032200Z

Which, mapping back to the cljs code, seems to indicate the logic for finding the var returned nil...

seancorfield 2019-05-31T01:21:59.033300Z

Ah, narrowed it down a bit further! If I try it on a qualified symbol, it does work. It only doesn't work for unqualified symbols that are defined in the same namespace.

seancorfield 2019-05-31T01:22:30.034Z

If I do it on an unqualified symbol that has been referred in, I get to the correct source, but I do get the Joker error.

seancorfield 2019-05-31T01:22:51.034500Z

If I do it on a qualified symbol, I get to the correct source but I do not get the Joker error.

seancorfield 2019-05-31T01:24:58.035800Z

That's probably why the problem didn't show up in your testing. Guess it's not a major issue. I may try going back to a from-source build next week and adding some more debugging to see if I can figure out what's up (unless you figure it out before then).

mauricio.szabo 2019-05-31T01:58:07.037500Z

Oh, thanks for the detailed info! I'll look at this issue tomorrow, and see if I can find anything! Also, what version of Clojure are you using in this project? (What I find really strange is that there's no usage of Joker in Chlorine....)

seancorfield 2019-05-31T02:23:01.039700Z

I have joker lint installed, so I'd expect it to run when a change is made or when a new file is first loaded. However, if I load the file myself, instead of it being loaded by Chlorine's go-to-var, then Joker runs just fine. So maybe something weird about how Chlorine gets Atom to load files? And weirdly only for unqualified symbols (e.g., map from `clojure.core).

seancorfield 2019-05-31T02:24:31.040600Z

Clojure version is the latest: 1.10.1-rc1 (we already have it in production for several of our services).

mauricio.szabo 2019-05-31T16:18:34.040900Z

Okay, I was able to reproduce. Will check what's happening

mauricio.szabo 2019-05-31T16:19:05.041500Z

Thanks for the help! I'm thinking on enabling source maps on release builds, so these problems will be easier to debug too...