announcements

Project/library announcements ONLY - use threaded replies for discussions. Do not cross post here from other channels. Consider #events or #news-and-articles for other announcements.
ericdallo 2021-07-01T14:23:04.380400Z

Hello clojurians! :clojure-lsp: Released https://clojure-lsp.github.io/clojure-lsp/ with fixes and exciting new features, clojure-lsp is not a editor only tool anymore, it has its own API and CLI 🎉 It's possible now to run clojure-lsp via terminal telling to clean all ns forms of your project, removing unused vars, sorting required/refers/imports 🚀 For more information, check #lsp.

9348😱
borkdude 2021-07-01T14:33:07.381200Z

Excellent, I can now deprecate carve? :)

3😂
ericdallo 2021-07-01T14:35:17.381500Z

hahah I expect carve to have a better configurability ATM, but it's easy to improve on clojure-lsp 🙂 carve seems a valid another approach not using the LSP protocol so having both options sounds good for community 😄

ericdallo 2021-07-01T14:35:40.381700Z

Also, not sure all features carve provide, if all of them are alreday included in the clean-ns refactoring

borkdude 2021-07-01T14:35:49.381900Z

Does clojure-lsp also offer a REPL API?

ericdallo 2021-07-01T14:36:25.382100Z

Yes @borkdude with that release, the clojure-lsp.api should provide those features 🙂 https://clojure-lsp.github.io/clojure-lsp/api/

1👍1🎉
rafaeldelboni 2021-07-01T15:02:21.383700Z

This is quite cool! For some reason I need to do this clojure-lsp -p ./ clean-ns to manage the clean-ns work in my repos, is that intended?

ericdallo 2021-07-01T15:04:39.384Z

the default of the -p flag is the current dir, what error you were getting @rafaeldelboni?

rafaeldelboni 2021-07-01T15:05:53.384200Z

no errors, is just not doing anything

rafaeldelboni 2021-07-01T15:06:31.384500Z

I use zsh btw

ericdallo 2021-07-01T15:08:52.384800Z

it's correct, it have no namespaces to clean 😅 Maybe a Cleaned! print is missing 🙂

rafaeldelboni 2021-07-01T15:09:02.385Z

hahaa

ericdallo 2021-07-01T15:09:08.385200Z

it will print the namespace cleaned only if it needs to clean anything

ericdallo 2021-07-01T15:09:30.385400Z

you can confirm that, adding a unused var or sorting differently

rafaeldelboni 2021-07-01T15:10:00.385600Z

yeah it only shows up when I use -p

1
rafaeldelboni 2021-07-01T15:10:22.385900Z

instead it just prints 0ms

rafaeldelboni 2021-07-01T15:11:01.386200Z

but this is such a good tool, thanks a lot https://github.com/parenthesin/microservice-boilerplate/pull/13/files

1
rafaeldelboni 2021-07-01T15:11:03.386400Z

haha

ericdallo 2021-07-01T15:12:10.386800Z

Thanks! will investigate further more soon your project issue

borkdude 2021-07-01T15:13:12.387200Z

Perhaps it's related to not having an .lsp/config.edn ?

rafaeldelboni 2021-07-01T15:15:12.387400Z

I do have only an ~/.lsp/config.edn and just the ./clj-kondo/config.edn at projects level

borkdude 2021-07-01T15:15:30.387600Z

yes, I meant the project level

borkdude 2021-07-01T15:15:48.387800Z

could be related, dunno. I think it should be optional

ericdallo 2021-07-01T15:16:28.388Z

I don't think so, it probably some issue with the -p default value, in this case (io/file (System/getProperty "user.dir"))

rafaeldelboni 2021-07-01T15:17:59.388200Z

I copied my personal .lsp/config.edn at project level and still having the same behaviour

ericdallo 2021-07-01T15:19:54.388400Z

yeah, it's not related with the config

rafaeldelboni 2021-07-01T15:22:17.388700Z

Want me to open a issue?

ericdallo 2021-07-01T15:59:01.389Z

Sure!

rafaeldelboni 2021-07-01T16:36:41.389300Z

https://github.com/clojure-lsp/clojure-lsp/issues/463

1🔨
borkdude 2021-07-01T18:50:30.391Z

@ericdallo Sorry to interrupt your release Eric, but I don't think your recent commits fixed anything :)

borkdude 2021-07-01T18:50:41.391200Z

The problem is that you are capturing values at build time

borkdude 2021-07-01T18:51:24.391600Z

(System/getProperty "user.dir") should work, but not when you put it in a top level def

borkdude 2021-07-01T18:51:55.391800Z

This is because static initializers are initialized at build time in graalvm native image with the --initialize-at-build-time option

ericdallo 2021-07-01T18:52:06.392Z

Hum, it makes sense, but I tested with the @rafaeldelboni project, let me double check

borkdude 2021-07-01T18:52:18.392200Z

Perhaps your commit fixed something because the path is relative now, but this is the real reason it was broken

borkdude 2021-07-01T18:53:19.392400Z

I guess the commits do work, but I was surprised you were still using top level defs, which is probably not a good idea

ericdallo 2021-07-01T18:53:36.392600Z

you are right, it's missing running it in a function, or using default-fn instead of default

borkdude 2021-07-01T18:54:07.392800Z

I mean for storing values that can be different over systems

ericdallo 2021-07-01T18:54:15.393Z

yeah, it's probably a good idea I change that cli-options to be a function

borkdude 2021-07-01T18:54:53.393200Z

The CLI options are alright, but the defaults should just be handled dynamically, probably not using tools.cli itself

borkdude 2021-07-01T18:55:03.393400Z

just using or in the main function or so

ericdallo 2021-07-01T18:55:42.393600Z

why it's a problem handling in tools.cli if that cli-options would be a function?

borkdude 2021-07-01T18:56:14.393800Z

that works too

ericdallo 2021-07-01T18:57:15.394Z

alright, I'll improve that to be a function, thanks for the heads up 🙂

borkdude 2021-07-01T18:58:05.394200Z

a delay works too

ericdallo 2021-07-01T18:59:02.394400Z

yes, but I think changing

:default (io/file "")
to
:default-fn #(io/file "")
is enough

ericdallo 2021-07-01T18:59:15.394600Z

what is best, change to that ☝️ or change cli-optiosn to be a function?

borkdude 2021-07-01T19:00:04.394800Z

oh I didn't know you vould provide a function for :default-fn, yeah that works too

ericdallo 2021-07-01T19:00:36.395Z

yeah, that looks better 🙂 I just need to remember for every new option 🤦

borkdude 2021-07-01T19:01:02.395300Z

maybe make a note ;)

1😹
ericdallo 2021-07-01T20:22:47.395700Z

Released the fix!

Jonas 2021-07-01T21:13:54.399600Z

Hey all! I've been working in the last weeks on a https://github.com/sauercrowd/clojureflare to make it easy to use Clojurescript with Cloudflare workers It's super experimental right now, but four lines are enough to get your worker up and running! Check it out

(ns new-worker.core
  (:require [clojureflare.core :as clfl]))

(clfl/worker
  (clfl/route "GET" "/worker" "hello from my worker"))

7👍14
Jonas 2021-07-01T21:21:25.399900Z

A full walk-through is available in https://github.com/sauercrowd/clojureflare/tree/main/example-worker