This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-05-28
Channels
- # babashka (29)
- # beginners (179)
- # bristol-clojurians (1)
- # calva (9)
- # chlorine-clover (47)
- # cider (57)
- # clj-kondo (1)
- # cljs-dev (13)
- # clojure (241)
- # clojure-europe (9)
- # clojure-nl (4)
- # clojure-norway (88)
- # clojure-spec (4)
- # clojure-uk (15)
- # clojurescript (211)
- # clojutre (1)
- # community-development (8)
- # core-async (1)
- # datomic (31)
- # figwheel-main (33)
- # fulcro (29)
- # ghostwheel (6)
- # graalvm (11)
- # graphql (12)
- # instaparse (4)
- # jobs (1)
- # jobs-discuss (17)
- # leiningen (7)
- # malli (6)
- # meander (38)
- # off-topic (208)
- # onyx (6)
- # re-frame (23)
- # reagent (8)
- # shadow-cljs (61)
- # spacemacs (10)
- # sql (5)
- # yada (5)
Hey fellow clojurians, not sure if this is the right place to ask, but I'm having a repl issue and since I use emacs + cider thought this might be the right place
The question is arguably better suited for #beginners channel as its not Cider specific.
sure, thanks for replying anyways just wasn't sure if it was an issue with the classpath that maybe wasn't available from a cider repl.
The root cause is not always obvious š
from within the repl I'm not able to read files from the resoures folder with http://clojure.java.io/resource
I'm using deps.edn and have added resources to the paths vector
interestingly io/file works
@dev-hartmann file and resource functions read from different starting paths in the project. I believe file is from the root of the project and resource is from resources/
so you will need to adjust the file path accordingly.
The following has an example, with the data files saved to the file space in /resources/data-sets/
so the path for resource
starts at data-sets/
https://github.com/practicalli/covid19-dashboard/blob/master/src/practicalli/data_gov_uk.clj
thanks for the pointer! I'm actually doing it exactly like that
(defn load-config [resource profile]
(-> resource
()
(read-config)
(get profile)))
read-config coming from juxt/aero
io/resource always returning null
so I guess I have something misconfigured
I'll post this to #beginners though, to not clutter up this thread
Just to expand further. io/resource is relative to any folders setup as class paths. Eg src, resources, test, clojure.jar, etc
Ah, I did think that might be the case, thanks for confirming.
heey guys, how I can configure cider to use .nrepl.edn
to shadow-cljs nrepl middleware?
I havenāt seen any instructions how to use it standalone (without shadow kicking off the nREPL server), so you might have to ask at their issue tracker.
Yeah, I think thatās the question. Normally youād do this either via your project config (e.g. project.clj
or nrepl.edn
).
but how I can jack-in shadow.api/repl
from mine cider repl, without jacking in first with shadow-cljs but with clj?
has anyone ever tried to get the *cider-test-report*
buffer to open in a new emacs frame instead of the current behavior (for me, splitting the current emacs buffer in two)?
I imagine you would have to do some overwriting of the functionality here: https://github.com/clojure-emacs/cider/blob/master/cider-test.el#L686
this is a pretty unfortunate bug: https://github.com/bbatsov/projectile/issues/1534 the only workaround is to switch to native mode (which then takes a long while to index and doesn't ignore .gitignore files, requiring repeating them in .projectile).
@johanatan I think Iāve commented on this many times, as the ticket has been duplicated through the years - itās not really a bug, itās a limitation. If we apply postprocessing to the files returned by an external command (alien mode) weāre killing most of the benefits of using it, as this filtering is very expensive in Emacs Lisp.
The native indexing is already slow, so the filtering isnāt that big a deal with it.
Btw, did you try hybrid mode as well? I think it was somewhere in the middle. I havenāt had much time for Projectile lately, so Iām starting to forget what iāve done there.
Well, I canāt see how this can happen - after all itās simply shelling out to git
. š
No, native mode just indexes the project in Emacs Lisp. Thatās why itās native (to Emacs).
Ok but thatās where I see it fail to respect gitignore. So what did you mean by āI canāt see how that could happen since it just shells out to gitā
I actually reject the premise that post processing on alien would be untenable. Alien presumably returns a short, relevant list and then to apply some additional pruning based on .projectile should be very fast.
But I guess thatās what āhybridā is supposed to be. However hybrid isnāt respecting gitignore for me
> Ok but thatās where I see it fail to respect gitignore. So what did you mean by āI canāt see how that could happen since it just shells out to gitā Thatās how the list of files is obtained https://github.com/bbatsov/projectile/blob/master/projectile.el#L624
> I actually reject the premise that post processing on alien would be untenable. Alien presumably returns a short, relevant list and then to apply some additional pruning based on .projectile should be very fast. In a small project - sure, in a huge project you might have to check thousands of files against the ignored patterns. In Emacs Lisp thatās anything but fast. š
i think if you're in the situation where the alien search didn't trim down the result set to something manageable, you're not in a situation to pick the final result yet and are most likely going to hit another key immediately thereafter, killing the first search and kicking off a new one. this process is going to repeat until you actually enter enough characters to begin to actually trim down the list to something manageable at which point a final post-process pass would not be burdensome at all.
all that you need for this to "feel" fast is the ability to kick off each search asynchronously and to kill earlier searches if keypresses are entered before they complete
and, sorry, i misspoke earlier, native does not exhibit any bugs (it's just really slow). hybrid and alien both have the same problem of .projectile ignores being ignored.
also, btw, SPC /
(which uses ag) to search inside every single file is faster than projectile's filename only searching. how is this even possible? with my 100s of MBs of node_modules, we can search inside them faster than searching merely for their names?
unfortunately for me, there is a much higher chance of collision between filenames in node_modules/ that I don't care about and filenames in my codebase than there is for content in node_modules and content in my codebase.
and btw yet another bug is making this entire ordeal more painful that one would hope: https://github.com/bbatsov/projectile/issues/1541