Morning
:spock-hand: ☕ ☀️
Good morning. This day start nicely with a 10 people meeting about a production bug. It can only go uphill from here 😛
👋
Morning
Morgen!
@ordnungswidrig a bit like Sisyphus?
'morning all btw!
@dharrigan yea. If if Kafka an Sisyphos had a child.
I tried to find the joke about message brokers, there. Time for another coffee
@ordnungswidrig would be happy to know that I’ve been reading some liberator source-code this morning 🙂
don’t do that. It’s basically the first clojure code I had ever written.
😛
I know it is. And it’s such a wonderful journey into another way of writing Clojure 🙂
Reason being is that we’re switching from Compojure to Reitit while not throwing out Liberator.
Liberator plays nicely with Compojure (since Compojure expects a ring-handler), but Reitit just wants a simple function that accepts a request as a handler.
Well, liberator creates simple function that expect a request and return a response.
So our code base is littered with :handler ((liberator-resource foo bar baz) req)
which is the ring-handler model
hmm you can use run-resource
e.g. :handler (run-resource req :exists? false)
Cool!
I played around with a new defresource
which accepts a request
so something like this:
(defresource field-search [{:keys [system ctx parameters] :as request}]
:allowed-methods [:get]
:available-media-types ["application/json"]
:handle-ok (component-service/search-components (:component-service system)
ctx parameters))
Which I guess is basically a run-resource
in disguise
Morning. In about 9.5 hours from now (20:00 GMT+1) @ericdallo will present clojure-lsp at the Dutch (online) Clojure meetup. All welcome.
morning
doesn’t this work (reitit + liberator)?
["/my-resource" field-search]
… which expands to:
["/my-resource {:handler field-search}]
… which mean “all requests to /my-resource
handled by ring-handler, defined as field-search
”.> So our code base is littered with `:handler ((liberator-resource foo bar baz) req)`
I’m not an retit expert but looking at this again this is weird. I had expected :handler (liberator/resource foo bar baz)
do be sufficient. :thinking_face:
I’m not a liberator expert, but would assume you example would work too.
I'm setting up clojure-lsp (a bit mixed atm) and not sure how I turned on this
@otfrom Disable lsp-ui. I find it too noisy
@otfrom FWIW, here is my LSP config: https://github.com/borkdude/prelude/blob/master/personal/init.el#L356-L392
@borkdude thx. I thought it might have been that. I like some of the things from it, but overall it is a bit noisy
I bet is has all the configurations
I have turned off most of the noisy stuff
I mostly use lsp for find-definition (navigates to definition) and find-references.
why did you turn off lens?
noise
Yeah, recently we introduced some visual simple feedbacks in the modeline, so lsp-ui is kind of redundant for some features
You can also do lsp-describe-thing-at-point which will give you the same info a lens, but then on request. I prefer that
ah, that sounds good
or actually it gives less info, but I'm not sure why not all the info is in there.
e.g. the amount of usages, etc could also be inside describe-thing-at-point @ericdallo?
It could, it's not common for lsp-servers return that kind of info on the hover information though
But is something to think about
I'm not talking about hover, just M-x lsp-describe-thing-at-point
E.g. also show the docstring there (oh that already works!)
Yeah, I don't remember what lsp-describe-thing-at-point calls, I thought it was hover
@ericdallo Ah I can just toggle lsp-lens-mode anyway, so never mind :)
Yes :) most lsp-mode features have their own minor-modes/lsp-*-enable flags to make almost everything opt-in/out
I think
(setq lsp-ui-sideline-show-code-actions nil)
got rid of the bit that I found extra annoying. I quite like the rest of the chrome@ericdallo thx for clojure-lsp. Good docs
and thx to @borkdude for the bits of kondo that make it more betterer
I’m trying lsp now and I’m impressed and confused at the same time
I'm deffo still in the confused stage. The docs are helping me get through
I'm having lots of key clashes as well (esp w/ i3 wm)
Make sure to check this guide if you use Emacs 🙂 it should help https://emacs-lsp.github.io/lsp-mode/tutorials/clojure-guide/
so, I know it will place nicely with CIDER, but I'm wondering if I should get rid of clj-refactor
I haven't used clj-refactor for a while, IMO you can use clojure-lsp for most features
I shall give it and see what I miss
@orestis how is Docker on M1 nowadays?
@borkdude I don’t use docker so I haven’t tried it yet
There's a tech preview available
Good evening
This has got to be the most beautiful voice I've heard in years: https://www.youtube.com/watch?v=6EyPVbGMC2Y
I wonder if the people who don't speak the language find it as moving as I do