lsp

:clojure-lsp: Clojure implementation of the Language Server Protocol: https://clojure-lsp.io/
Karol Wójcik 2021-04-15T09:32:59.069300Z

Does anybody experience the same wrong warning from clj-kondo?

(defn ^:export init! <-- unused init! public fn
  []
  (mount!))

borkdude 2021-04-15T09:33:26.069700Z

this is not a warning from clj-kondo, but from an additional linter in clojure-lsp

Karol Wójcik 2021-04-15T09:38:04.069900Z

Ahh. Sorry @borkdude. You're right. I thought that clojure-lsp relies on clj-kondo entirely when it comes to code checking! Thanks!

Karol Wójcik 2021-04-15T09:39:32.071100Z

Found another bug in clojure-lsp. When moving the cursor to (:require) line, the namespace line vanishes.

ericdallo 2021-04-15T12:23:42.071700Z

Yes, check clojure-lsp docs about how to disable public linters

ericdallo 2021-04-15T12:25:37.072200Z

This is not a clojure-lsp bug, probably some issue with lsp-ui from emacs

👍 1
ericdallo 2021-04-15T12:25:38.072400Z

You can ask for help on Emacs-lsp discord channel

ericdallo 2021-04-15T12:26:04.072600Z

https://discord.gg/swuxy5AAgT

anonimitoraf 2021-04-15T14:34:32.073300Z

Hmm, I'm getting a lot of failed tests in the master branch

anonimitoraf 2021-04-16T08:45:05.077700Z

Right. Thanks @jr0cket I'll try out kaocha

practicalli-john 2021-04-16T08:54:04.078Z

Ah yes, the Makefile simply calls clojure -M:test which is an alias that runs kaocha via Clojure.main So you can also run clojure -M:test directly or if using my user level aliases, clojure -M:test/runner

👍 1
anonimitoraf 2021-04-17T07:56:58.078700Z

Thanks @jr0cket. I changed kaocha to eftest because it felt faster. I'll give koacha another try

practicalli-john 2021-04-17T11:16:36.079800Z

@nicdaoraf Running eftest using the :multithred? false setting does run the clojure-lsp tests successfully, so it does seem that the lsp unit tests should be run in in sequence, rather than the default parallel mode that eftest uses. I added a :test/eftest-sequential alias to practicalli/clojure-deps-edn that works with clojure-lsp test

anonimitoraf 2021-04-17T23:26:49.081400Z

Ahhh, I see. That makes sense

anonimitoraf 2021-04-15T14:35:02.073900Z

I'm on this commit:

commit 8a294181096a151cd4ee845a127b6e7306805800 (HEAD -> master, upstream/master)
Author: Eric Dallo <ericdallo06@hotmail.com>
Date:   Tue Apr 13 22:02:27 2021 -0300

    Improve resolve-macro-as command to check and log if couldn't resolve the macro.

ericdallo 2021-04-15T14:35:08.074Z

is it integration or unit tests?

ericdallo 2021-04-15T14:37:09.074400Z

It passes on my machine and in the CI, so it seems something with your machine 😅

anonimitoraf 2021-04-15T14:37:10.074600Z

Hmm, I'm not sure how to answer that. I run clojure -M:test/runner where

:test/runner
  {:extra-paths ["test"]
   :extra-deps  {eftest/eftest {:mvn/version "0.5.9"}}
   :main-opts   ["-e"  "(require,'[eftest.runner,:refer,[find-tests,run-tests]]),(run-tests,(find-tests,\"test\"))"]}

ericdallo 2021-04-15T14:37:21.074800Z

try just make test

anonimitoraf 2021-04-15T14:38:28.075Z

Interesting, yea it's all fine with make test

anonimitoraf 2021-04-15T14:39:01.075400Z

Do you know how

:test/runner
  {:extra-paths ["test"]
   :extra-deps  {eftest/eftest {:mvn/version "0.5.9"}}
   :main-opts   ["-e"  "(require,'[eftest.runner,:refer,[find-tests,run-tests]]),(run-tests,(find-tests,\"test\"))"]}
is different? (I just stole this alias off https://app.slack.com/team/U05254DQM's config)

Karol Wójcik 2021-04-15T14:41:24.075700Z

Thank you @ericdallo

ericdallo 2021-04-15T14:42:32.075900Z

it seems the same, not sure how it's affecting the tests :thinking_face:

1
practicalli-john 2021-04-15T15:59:39.076200Z

@nicdaoraf It's probably the -e option in the :main-opts as that approach is a bit of a hack. I will check to see if there is a better way to make an alias for eftest. I do prefer using lambdaisland koacha as a test runner (or cognitect labs runner)

👍 1
practicalli-john 2021-04-15T16:01:03.076400Z

Or it could be eftest running unit tests in parallel when the tests aren't happy being run in parallel, especially if make test doesn't use eftest

ericdallo 2021-04-15T16:58:48.076700Z

clojure-lsp test alias already uses kaocha runner

👍 1
zane 2021-04-15T20:11:31.077Z

Is this the right default behavior? It seems common for (non-private) functions to be unused within a namespace.

ericdallo 2021-04-15T20:13:36.077200Z

yes, it's the default behaviour, there are corner cases like API public functions and datomic functions I think but user can disable for some namespaces like in the docs