This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-09-15
Channels
- # announcements (51)
- # beginners (65)
- # calva (44)
- # cider (6)
- # clara (3)
- # clj-kondo (30)
- # cljsrn (5)
- # clojure (63)
- # clojure-australia (7)
- # clojure-dev (7)
- # clojure-europe (43)
- # clojure-gamedev (1)
- # clojure-nl (6)
- # clojure-uk (7)
- # clojurescript (51)
- # conjure (1)
- # cursive (9)
- # datascript (16)
- # datomic (14)
- # depstar (20)
- # events (1)
- # exercism (17)
- # figwheel-main (6)
- # fulcro (9)
- # graphql (3)
- # gratitude (2)
- # honeysql (4)
- # jobs (7)
- # leiningen (3)
- # lsp (107)
- # meander (7)
- # minecraft (3)
- # off-topic (16)
- # other-languages (4)
- # pathom (4)
- # pedestal (26)
- # practicalli (4)
- # re-frame (3)
- # reitit (7)
- # remote-jobs (1)
- # shadow-cljs (26)
- # tools-deps (67)
- # vim (19)
- # vscode (1)
An announcement of somewhat lesser scope.. https://github.com/johanthoren/julian is a tiny library to convert between https://en.wikipedia.org/wiki/Julian_day and common time as we know it (year, month, day, etc.). The library supports two-way conversion and is available for both Clojure and ClojureScript.
Addendum to yesterday's announcement about #clj-kondo https://clojurians.slack.com/archives/C06MAR553/p1631634221275000, following up on the release of Clojure 1.11.0-alpha2:
clj-kondo 2021.09.15 now supports :as-alias
🎉
Does it also recognize update-keys
and update-vals
?
(and I guess there will need to be a clojure-lsp
release using this in order for it to benefit Calva users @UKFSJSM38?)
@U04V70XH6 it should recognize this automatically when you lint clojure 1.11
Yes @U04V70XH6 it's already on clojure-lsp master, it should be available on next release
@UKFSJSM38 can you check if update-vals
is recognized in a project with clojure 1.11?
Thanks @UKFSJSM38 -- I asked because, for some reason, clojure-lsp
had stopped running in my VS Code instance so I had to reload the "window" to restart it, and that made me curious as to which version is running: 2021.09.13-22.25.35, which uses clj-kondo
2021.08.07-SNAPSHOT
And that shows:
Unresolved symbol: update-keys
Tested with clojure-lsp master and it's working @U04V15CAJ
@U04V70XH6 even that version should work with update-keys
iff you have .clj-kondo
directory in that project so clj-kondo can save a cache of your linted deps
@U04V15CAJ even so, if the user change the deps to use a newer clojure (1.11), clojure-lsp would scan the analysis with clj-kondo
I did this test with clojure-lsp and it worked, finding update-keys and update-vals
@UKFSJSM38 How does LSP run the scan? Does it need to know about aliases? I have a monorepo and everything is behind a couple of aliases so, right now LSP doesn't always seem to startup, until I refresh the VS Code window, and it isn't scanning. I even deleted .lsp/sqlite.db
to try to force that.
For multiple custom aliases, the best would be to configure th :project-specs
in LSP
{:cljfmt {:indents {#re ".*" ns [[:inner 0] [:inner 1]]}}
:auto-add-ns-to-new-files? false
:project-specs [{:project-path "deps.edn"
:classpath-cmd ["clojure" "-A:dev" "-Spath"]}]}
Yeah, just trying to set that up... So I have a monorepo where the Clojure code is in a subdirectory so it looks like this:
<root>
.clj-kondo/
.lsp/
clojure/
deps.edn
So I guess :project-path
should be "clojure/deps.edn"
but how would I get it to run :classpath-cmd
in the clojure
project or will that :project-path
be sufficient to tell it that?is your clojure code inside clojure folder? if so why not import the clojure folder as the project root?
No, we have lots of other stuff in the root of the repo so the "project root" is as shown above, and we run the REPL in the clojure
folder.
and then under clojure
we have lots of subproject folders, each containing src
, test
, etc. Those are brought in via the aliases. Here's my config.edn
right now:
{:project-specs [{:project-path "clojure/deps.edn"
:classpath-cmd ["clojure" "-Spath" "-M:build:dev:everything:runner:test"]}]}
If I specify :source-aliases
instead of :classpath-cmd
will that help?@U04V70XH6 I checked the clojure-lsp code, and it will probably don't work as we run the clojure
command in the project-root: https://github.com/clojure-lsp/clojure-lsp/blob/master/src/clojure_lsp/crawler.clj#L27
so maybe we could improve clojure-lsp to accept an optional path to run the classpath lookup command
otherwise that would just work if for clojure you import the clojure folder for now
How about if I add a shell script that cd
's to clojure
and then runs the clojure -Spath ...
command and tell LSP that's the :classpath-cmd
?
maybe we could improve clojure-lsp to check if the project-file is inside another subfolder not on root and run the classpath-cmd
from that folder
That would also solve the problem 🙂
yeah, feel free to open an issue about that :) Also, let me know if the script that cd into the folder and run the clojure command works as well
OK, well that did seem to work. LSP started and -- after a much longer initialization period this time! -- reports problems that make more sense. And, in particular, update-vals
and update-keys
are no longer flagged as unresolved /cc @U04V15CAJ
I'm pleased to announce the release of martian 0.1.18 🎉 martian is the http abstraction library for Clojure/script with support for various http libraries, Swagger/OpenAPI, generative testing, VCR recording/playback and more! https://github.com/oliyh/martian This release improves: • Errors thrown using the `hato` client are now handled by the interceptor chain This release changes: • An exception is now thrown if the route name is not found when calling an endpoint function https://github.com/oliyh/martian/pull/120 - thanks https://github.com/AndreaCrotti • The `hato` dependency is updated to `0.8.2`
@U076R6N1L This a great library that I'm already using! Thank you for it! Do you maybe plan to use lighter version of http client for Clojurescript? I would rather not include clojure.core.async
, 🙏
@UJ1339K2B thanks! do you know of any ring-compatible cljs http clients (apart from cljs-http, which as you point out uses core.async)?
Unfortunetely no. Which means you would have to write such library yourself
Yeah. But probably you would have to release a new artifact for it
There is https://github.com/lambdaisland/fetch but I guess it is not ring-compatible, whatever that means
@UJ1339K2B i did some hacking last night: https://github.com/oliyh/cljs-http-promise
This is so awesome! Thank you!!
tools.build v0.4.0 801a22f is now available • uber - TBUILD-2 - add support for configurable conflict handlers • uber - TBUILD-11 - detect file and dir with same name in uber • uber - TBUILD-16 - expand default exclusions • uber - add support for custom exclusions