A file like this causes an indexoutofbounds exception in the VS Code extension:
(def ^:foo)
I can't put the newline there it seems. It needs to be an empty line after the form to repro the error.
I tried to repro it using the command line, but it didn't happen.
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)
Nice. Issue welcome here: https://github.com/borkdude/clj-kondo.lsp/issues Should be easy to fix probably
Probably happens here: https://github.com/borkdude/clj-kondo.lsp/blob/b72767efa23dda9f522edab9ec0f38f9afc61987/server/src/clj_kondo/lsp_server/impl/server.clj#L75
Thanks