clj-kondo

https://github.com/clj-kondo/clj-kondo
pez 2020-10-11T12:38:05.158100Z

A file like this causes an indexoutofbounds exception in the VS Code extension:

(def ^:foo)

pez 2020-10-11T12:39:40.158900Z

I can't put the newline there it seems. It needs to be an empty line after the form to repro the error.

pez 2020-10-11T12:41:10.159100Z

I tried to repro it using the command line, but it didn't happen.

pez 2020-10-11T12:41:39.159300Z

The output from the extension:

[Error - 2:40:39 PM] java.lang.IndexOutOfBoundsException
	at clojure.lang.PersistentVector.arrayFor(PersistentVector.java:158)
	at clojure.lang.PersistentVector.nth(PersistentVector.java:162)
	at clojure.lang.RT.nth(RT.java:896)
	at clj_kondo.lsp_server.impl.server$finding__GT_Diagnostic.invokeStatic(server.clj:75)
	at clj_kondo.lsp_server.impl.server$lint_BANG_$fn__11576.invoke(server.clj:132)
	at clojure.core$mapv$fn__8445.invoke(core.clj:6912)
	at clojure.lang.PersistentVector.reduce(PersistentVector.java:343)
	at clojure.core$reduce.invokeStatic(core.clj:6827)
	at clojure.core$mapv.invokeStatic(core.clj:6903)
	at clj_kondo.lsp_server.impl.server$lint_BANG_.invokeStatic(server.clj:124)
	at clj_kondo.lsp_server.impl.server.LSPTextDocumentService.didChange(server.clj:153)
	at jdk.internal.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:567)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:65)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.notify(GenericEndpoint.java:152)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleNotification(RemoteEndpoint.java:220)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:187)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:194)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94)
	at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:835)

borkdude 2020-10-11T12:47:35.159500Z

Nice. Issue welcome here: https://github.com/borkdude/clj-kondo.lsp/issues Should be easy to fix probably

pez 2020-10-11T12:53:49.160100Z

Issue: https://github.com/borkdude/clj-kondo.lsp/issues/11

borkdude 2020-10-11T13:15:21.160400Z

Thanks