lsp

:clojure-lsp: Clojure implementation of the Language Server Protocol: https://clojure-lsp.io/
ericdallo 2020-04-13T00:07:57.031Z

@snoe The update looks great for the schema.core fixes, thanks for that. About the midje support, two points: • It's super common to require midje as :require [midje.sweet :referr :all] , this way, clojure-lsp keeps to not find the fact/facs/=> macros 😔 • The assertion works only for => macro, midje has currently 5 macros for test assertion: https://github.com/marick/Midje/wiki/Checkable-arrows

snoe 2020-04-13T14:07:22.032100Z

@ericdallo it works for me 😕 Is midje in the classpath given to lsp? i.e. lein classpath ? You could also try deleting your .lsp/sqlite.1.db

ericdallo 2020-04-13T14:08:00.032500Z

Oh, gonna try that!

snoe 2020-04-13T14:17:04.032800Z

There could be an ordering problem where a user namespace with a refer all is parsed before the referred namespace, but I don't think that should happen when the referred namespace is in a jar.

ericdallo 2020-04-13T14:17:21.033Z

Sorry, I was testing in a old release 🤦

snoe 2020-04-13T14:17:28.033200Z

no worries

ericdallo 2020-04-13T14:17:34.033400Z

It works!

snoe 2020-04-13T14:17:58.033600Z

sweet 😉 O

snoe 2020-04-13T14:18:07.033800Z

I've got a release with the arrows going out

ericdallo 2020-04-13T14:18:50.034Z

Nice! Sorry for noticing this only now, but it looks like the tabular macro is not fully supported yet 😔

ericdallo 2020-04-13T14:19:05.034200Z

I think is the last midje problem

ericdallo 2020-04-13T14:19:13.034400Z

I'll post a example here

ericdallo 2020-04-13T14:22:28.034600Z

With tabular macro, you can use this ? symbols...

ericdallo 2020-04-13T14:22:43.035Z

Again, sorry for reporting this only now

ericdallo 2020-04-13T14:23:04.035200Z

I think this problem is the same for datalog / datomic queries

snoe 2020-04-13T14:35:15.035400Z

my understanding is that datalog uses quoted queries, so it's a bit different. So fact effectively does a let of left side ? -prefixed bindings to be used on the right side?

ericdallo 2020-04-13T14:39:55.035600Z

no, this is a tabular thing... it's just common to use a fact to describe the kind of test and the assertion... but the support for ?variables is from tabular

ericdallo 2020-04-13T14:41:22.035800Z

you can invert and do something like this too

snoe 2020-04-13T15:15:22.036200Z

is that right? it seems the tabular form would still include the headings and body?

snoe 2020-04-13T15:20:13.036400Z

also, the explicit syntax seems far easier to parse might just support that https://github.com/marick/Midje/wiki/Tabular-facts#explicit-syntax

ericdallo 2020-04-13T15:21:54.036600Z

Sorry, i didn't know about that, but I think it's better too

ericdallo 2020-04-13T00:09:00.031100Z

In Nubank, we have a bunch of tests that use this pattern for tests

ericdallo 2020-04-13T00:11:54.031300Z

ericdallo 2020-04-13T00:17:18.031700Z

Is there any way where we can make clojure-lsp add all functions/macros from a :refer :all to a workspace? Or maybe just some config to accept some functions/macros like #clj-kondo does https://github.com/borkdude/clj-kondo/blob/master/doc/config.md#exclude-unresolved-symbols-from-being-reported