clojure-europe

For people in Europe... or elsewhere... UGT https://indieweb.org/Universal_Greeting_Time
2021-02-17T06:47:04.419500Z

Morning

RAMart 2021-02-17T07:07:59.419900Z

:spock-hand: ☀️

ordnungswidrig 2021-02-17T07:58:11.420500Z

Good morning. This day start nicely with a 10 people meeting about a production bug. It can only go uphill from here 😛

djm 2021-02-17T07:59:43.420700Z

👋

orestis 2021-02-17T08:03:02.420900Z

Morning

javahippie 2021-02-17T08:12:12.421100Z

Morgen!

dharrigan 2021-02-17T08:13:27.421400Z

@ordnungswidrig a bit like Sisyphus?

dharrigan 2021-02-17T08:14:13.421700Z

'morning all btw!

ordnungswidrig 2021-02-17T08:19:57.422200Z

@dharrigan yea. If if Kafka an Sisyphos had a child.

javahippie 2021-02-17T09:00:21.423100Z

I tried to find the joke about message brokers, there. Time for another coffee

slipset 2021-02-17T09:00:36.423500Z

@ordnungswidrig would be happy to know that I’ve been reading some liberator source-code this morning 🙂

ordnungswidrig 2021-02-17T09:01:04.424200Z

don’t do that. It’s basically the first clojure code I had ever written.

ordnungswidrig 2021-02-17T09:01:22.424700Z

😛

slipset 2021-02-17T09:01:28.424900Z

I know it is. And it’s such a wonderful journey into another way of writing Clojure 🙂

slipset 2021-02-17T09:01:46.425300Z

Reason being is that we’re switching from Compojure to Reitit while not throwing out Liberator.

slipset 2021-02-17T09:02:49.426300Z

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.

ordnungswidrig 2021-02-17T09:03:14.427Z

Well, liberator creates simple function that expect a request and return a response.

slipset 2021-02-17T09:03:24.427400Z

So our code base is littered with :handler ((liberator-resource foo bar baz) req)

ordnungswidrig 2021-02-17T09:03:25.427500Z

which is the ring-handler model

ordnungswidrig 2021-02-17T09:03:38.427900Z

hmm you can use run-resource

ordnungswidrig 2021-02-17T09:06:03.428500Z

e.g. :handler (run-resource req :exists? false)

slipset 2021-02-17T09:07:23.428700Z

Cool!

slipset 2021-02-17T09:09:23.429700Z

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))

slipset 2021-02-17T09:22:47.430300Z

Which I guess is basically a run-resource in disguise

borkdude 2021-02-17T09:24:36.431300Z

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.

1
🎉 1
thomas 2021-02-17T09:28:05.431500Z

morning

ikitommi 2021-02-17T10:52:52.433500Z

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”.

ordnungswidrig 2021-02-17T10:54:09.434600Z

> 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:

ikitommi 2021-02-18T11:34:18.460100Z

I’m not a liberator expert, but would assume you example would work too.

2021-02-17T12:12:28.438800Z

I'm setting up clojure-lsp (a bit mixed atm) and not sure how I turned on this

borkdude 2021-02-17T12:13:08.439300Z

@otfrom Disable lsp-ui. I find it too noisy

borkdude 2021-02-17T12:14:33.439700Z

@otfrom FWIW, here is my LSP config: https://github.com/borkdude/prelude/blob/master/personal/init.el#L356-L392

2021-02-17T13:02:35.440700Z

@borkdude thx. I thought it might have been that. I like some of the things from it, but overall it is a bit noisy

2021-02-17T13:02:47.440900Z

I bet is has all the configurations

2021-02-17T13:02:57.441400Z

👋 @ericdallo

👋 1
borkdude 2021-02-17T13:03:03.441600Z

I have turned off most of the noisy stuff

borkdude 2021-02-17T13:03:34.442200Z

I mostly use lsp for find-definition (navigates to definition) and find-references.

2021-02-17T13:14:44.443300Z

why did you turn off lens?

borkdude 2021-02-17T13:15:15.444200Z

noise

ericdallo 2021-02-17T13:15:21.444400Z

Yeah, recently we introduced some visual simple feedbacks in the modeline, so lsp-ui is kind of redundant for some features

borkdude 2021-02-17T13:15:55.445100Z

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

2021-02-17T13:16:11.445500Z

ah, that sounds good

borkdude 2021-02-17T13:16:20.445800Z

or actually it gives less info, but I'm not sure why not all the info is in there.

borkdude 2021-02-17T13:16:49.446200Z

e.g. the amount of usages, etc could also be inside describe-thing-at-point @ericdallo?

ericdallo 2021-02-17T13:18:04.447100Z

It could, it's not common for lsp-servers return that kind of info on the hover information though

ericdallo 2021-02-17T13:18:18.447500Z

But is something to think about

borkdude 2021-02-17T13:20:18.447900Z

I'm not talking about hover, just M-x lsp-describe-thing-at-point

borkdude 2021-02-17T13:20:36.448200Z

E.g. also show the docstring there (oh that already works!)

ericdallo 2021-02-17T13:23:07.449800Z

Yeah, I don't remember what lsp-describe-thing-at-point calls, I thought it was hover

borkdude 2021-02-17T13:37:47.450600Z

@ericdallo Ah I can just toggle lsp-lens-mode anyway, so never mind :)

ericdallo 2021-02-17T13:40:41.451900Z

Yes :) most lsp-mode features have their own minor-modes/lsp-*-enable flags to make almost everything opt-in/out

2021-02-17T13:57:00.452400Z

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

2021-02-17T14:08:46.452700Z

@ericdallo thx for clojure-lsp. Good docs

❤️ 1
2021-02-17T14:09:00.453100Z

and thx to @borkdude for the bits of kondo that make it more betterer

ordnungswidrig 2021-02-17T14:32:37.453500Z

I’m trying lsp now and I’m impressed and confused at the same time

2021-02-17T14:33:01.453900Z

I'm deffo still in the confused stage. The docs are helping me get through

2021-02-17T14:33:18.454200Z

I'm having lots of key clashes as well (esp w/ i3 wm)

ericdallo 2021-02-17T14:42:03.454600Z

Make sure to check this guide if you use Emacs 🙂 it should help https://emacs-lsp.github.io/lsp-mode/tutorials/clojure-guide/

2021-02-17T14:55:39.455300Z

so, I know it will place nicely with CIDER, but I'm wondering if I should get rid of clj-refactor

ericdallo 2021-02-17T15:05:43.456200Z

I haven't used clj-refactor for a while, IMO you can use clojure-lsp for most features

2021-02-17T15:53:15.456500Z

I shall give it and see what I miss

borkdude 2021-02-17T16:00:10.456800Z

@orestis how is Docker on M1 nowadays?

orestis 2021-02-17T17:55:58.457200Z

@borkdude I don’t use docker so I haven’t tried it yet

dharrigan 2021-02-17T18:05:00.457400Z

There's a tech preview available

val_waeselynck 2021-02-17T20:50:11.457700Z

Good evening

val_waeselynck 2021-02-17T20:50:27.458100Z

This has got to be the most beautiful voice I've heard in years: https://www.youtube.com/watch?v=6EyPVbGMC2Y

👍 1
👂 1
val_waeselynck 2021-02-17T20:50:54.458700Z

I wonder if the people who don't speak the language find it as moving as I do