lsp

:clojure-lsp: Clojure implementation of the Language Server Protocol: https://clojure-lsp.io/
ericdallo 2021-02-28T00:28:23.296700Z

@jkrasnay lastest clojure-lsp release should not fix the parsing issue but should avoid the exception during the code actions retrieval 🙂

2021-02-28T00:34:59.296900Z

Cool I'll give it a try. Moving house this weekend though so I might not get to it for a bit.

👍 1
ericdallo 2021-02-28T20:11:02.298100Z

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

orestis 2021-03-01T10:29:47.305200Z

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

borkdude 2021-03-01T10:43:02.305400Z

Could be

ericdallo 2021-02-28T20:11:18.298200Z

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

borkdude 2021-02-28T20:11:30.298400Z

yikes :)

borkdude 2021-02-28T20:12:00.298600Z

repro welcome

ericdallo 2021-02-28T20:12:08.298800Z

yes, I'm trying to understand how to repro

borkdude 2021-02-28T20:14:48.299Z

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

borkdude 2021-02-28T20:14:58.299200Z

They didn't before

ericdallo 2021-02-28T20:15:23.299400Z

hum. probably that's the issue

ericdallo 2021-02-28T20:15:30.299600Z

and clojure-lsp expect X analysis

borkdude 2021-02-28T20:15:41.299800Z

X?

ericdallo 2021-02-28T20:15:48.300Z

N*

ericdallo 2021-02-28T20:15:54.300200Z

a fixed number of analysis

borkdude 2021-02-28T20:16:08.300400Z

ah

borkdude 2021-02-28T20:16:33.300600Z

This fix was needed for deps-infer

borkdude 2021-02-28T20:16:41.300800Z

To fix it with babashka scripts :)

ericdallo 2021-02-28T20:17:22.301Z

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

ericdallo 2021-02-28T20:17:29.301200Z

that's why I thought it could be a bug

borkdude 2021-02-28T20:17:34.301400Z

I consider this a fix to the analysis data

borkdude 2021-02-28T20:17:57.301600Z

It is part of the CHANGELOG

ericdallo 2021-02-28T20:21:06.301800Z

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

ericdallo 2021-02-28T20:21:29.302Z

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]]))

ericdallo 2021-02-28T20:21:57.302200Z

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

ericdallo 2021-02-28T20:22:24.302400Z

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 .

borkdude 2021-02-28T20:22:42.302600Z

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

ericdallo 2021-02-28T20:23:10.302800Z

Yeah, I can try to fix on kondo 🙂

borkdude 2021-02-28T20:23:56.303Z

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

ericdallo 2021-02-28T20:24:15.303200Z

thanks for the start point 😉

ericdallo 2021-02-28T21:13:18.303400Z

:reviewplease: https://github.com/clj-kondo/clj-kondo/pull/1182

borkdude 2021-02-28T21:47:19.303700Z

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

borkdude 2021-02-28T21:53:08.303900Z

Ah, I see I get it

😅 1
borkdude 2021-02-28T21:54:18.304100Z

Merged, thanks!