Fork me on GitHub
#lsp
<
2021-02-28
>
ericdallo20:02:02

@borkdude for some reason last clj-kondo release broke clojure-lsp tests

ericdallo20:02:18

it seems to be related with refers without position, row, col etc

borkdude20:02:00

repro welcome

ericdallo20:02:08

yes, I'm trying to understand how to repro

borkdude20:02:48

I did make an addition for standalone requires that now emit to the analysis data

borkdude20:02:58

They didn't before

ericdallo20:02:23

hum. probably that's the issue

ericdallo20:02:30

and clojure-lsp expect X analysis

ericdallo20:02:54

a fixed number of analysis

borkdude20:02:33

This fix was needed for deps-infer

borkdude20:02:41

To fix it with babashka scripts :)

ericdallo20:02:22

Np, I'll fix the tests, I just searched on analysis docs and saw no changes

ericdallo20:02:29

that's why I thought it could be a bug

borkdude20:02:34

I consider this a fix to the analysis data

borkdude20:02:57

It is part of the CHANGELOG

ericdallo20:02:06

The issue on clojure-lsp seems that the new var-usage of the refer does not contain a end-range

ericdallo20:02:29

I get this new analysis:

{
        "filename": "/tmp/sample.clj",
        "row": 2,
        "col": 35,
        "from": "foo",
        "to": "clojure.test",
        "name": "deftest",
        "macro": true,
        "varargs-min-arity": 1
      }
from:
(ns foo
  (:require [clojure.test :refer [deftest]]))

ericdallo20:02:57

other analysis have the: name-end-row and name-end-col

ericdallo20:02:24

repro:

clj -Sdeps '{:deps {clj-kondo {:mvn/version "2021.02.28"}}}' -m clj-kondo.main --config '{:output {:analysis true :format :json}}'  --lint /tmp/sample.clj |jq .

borkdude20:02:42

I see. I can have a look tomorrow, but if you will beat me to it with a PR, I'd he happy to accept it

ericdallo20:02:10

Yeah, I can try to fix on kondo 🙂

borkdude20:02:56

The change was done in clj-kondo.impl.analyzer.namespace. This was added to support linting unresolved vars in the :refer part of the libspec

ericdallo20:02:15

thanks for the start point 😉

borkdude21:02:19

This PR makes me wonder: why do we need metadata on the name again?

borkdude21:02:08

Ah, I see I get it

😅 3
borkdude21:02:18

Merged, thanks!

orestis10:03:47

Oh I made an issue about LSP rename being broken WRT refers, perhaps it's related to this?