brcosta/clj-extras-plugin

Built-in clj-kondo does not work

Closed this issue · 8 comments

Clojure Extras does not lint my code with built-in clj-kondo since some version.
It was installed from the file firstly (and worked), then disabled (because was too annoying due to linter warnings), then enabled after installing from marketplace (and upgraded twice) — and it does not lint anymore after enabling it.

Removed then installed again — no changes.
Disabled clj-kondo inspections in the settings then enabled — no changes.
Invalidated caches — no change.
There are also no relevant records in event log.

If I specify executable path in the settings — it works.

I'm testing it against (inc :foo) expression.

=== About ===
Build version: IntelliJ IDEA 2021.3.1 Build: #IU-213.6461.79 December 28, 2021
JRE: 11.0.13+7-b1751.21, JetBrains s.r.o.
JVM: 11.0.13+7-b1751.21, OpenJDK 64-Bit Server VM, JetBrains s.r.o.
Operating System: Windows 10 10.0 (amd64)

=== Plugins ===
Custom plugins: [Yaml-Config Autocomplete (0.0.3), Ligatures Limited (1.0.3), Clojure Namespace Sort (1.7), File Watchers (213.6461.19), PostCSS (213.5744.190), Json Parser (1.4.2), Wrap to Column (1.8.0), Tailwindcss (1.4.6), AsciiDoc (0.36.13), String Manipulation (8.25.203.5981.1), Statistic (4.1.7), Shifter (1.9.6), Scratch (1.10), IdeaVim (1.9.3), HighlightBracketPair (1.3.2), Grep Console (12.1.211.6086.0), Scala (2021.3.18), Handlebars/Mustache (213.5744.190), Cursive (1.12.2-eap1-2021.3), Integrant (0.1.1), Clojure Extras (0.5.1), EDN-JSON Converter (0.0.5), CMD Support (1.0.5)]

Found the problem, bad handling of backslashes on windows in some cases, my bad! Will upload a fix soon :)

Fixed on master, we just need to wait for jetbrains to approve it (v 0.5.2)

v 0.5.2 still does not work in my case

Maybe this stacktrace is relevant:


java.lang.RuntimeException: Unsupported escape character: \U
	at clojure.lang.Util.runtimeException(Util.java:221)
	at clojure.lang.EdnReader$StringReader.invoke(EdnReader.java:457)
	at clojure.lang.EdnReader.readDelimitedList(EdnReader.java:757)
	at clojure.lang.EdnReader$VectorReader.invoke(EdnReader.java:672)
	at clojure.lang.EdnReader.readDelimitedList(EdnReader.java:757)
	at clojure.lang.EdnReader$MapReader.invoke(EdnReader.java:680)
	at clojure.lang.EdnReader.read(EdnReader.java:145)
	at clojure.lang.EdnReader.read(EdnReader.java:111)
	at clojure.lang.EdnReader.readString(EdnReader.java:67)
	at clojure.edn$read_string.invokeStatic(edn.clj:46)
	at clojure.edn$read_string.invokeStatic(edn.clj:37)
	at clojure.edn$read_string.invoke(edn.clj:37)
	at clojure.lang.Var.invoke(Var.java:384)
	at clojure.java.api.Clojure.read(Clojure.java:93)
	at com.github.brcosta.cljstuffplugin.extensions.CljKondoAnnotator.lintWithBuiltinLinter$lambda-1(CljKondoAnnotator.kt:112)
	at com.github.brcosta.cljstuffplugin.util.ClasspathUtilKt.runWithClojureClassloader(ClasspathUtil.kt:17)
	at com.github.brcosta.cljstuffplugin.util.ClasspathUtilKt.runWithClojureClassloader$default(ClasspathUtil.kt:10)
	at com.github.brcosta.cljstuffplugin.extensions.CljKondoAnnotator.lintWithBuiltinLinter(CljKondoAnnotator.kt:106)
	at com.github.brcosta.cljstuffplugin.extensions.CljKondoAnnotator.doAnnotate(CljKondoAnnotator.kt:69)
	at com.github.brcosta.cljstuffplugin.extensions.CljKondoAnnotator.doAnnotate(CljKondoAnnotator.kt:31)
	at com.intellij.codeInsight.daemon.impl.ExternalToolPass.doAnnotate(ExternalToolPass.java:218)
	at com.intellij.codeInsight.daemon.impl.ExternalToolPass.doAnnotate(ExternalToolPass.java:212)
	at com.intellij.codeInsight.daemon.impl.ExternalToolPass$1.lambda$run$0(ExternalToolPass.java:190)
	at com.intellij.codeInsight.daemon.impl.ExternalToolPass.runChangeAware(ExternalToolPass.java:287)
	at com.intellij.codeInsight.daemon.impl.ExternalToolPass$1.lambda$run$2(ExternalToolPass.java:190)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:188)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:624)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:698)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:646)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:623)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:66)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:175)
	at com.intellij.openapi.progress.util.BackgroundTaskUtil.runUnderDisposeAwareIndicator(BackgroundTaskUtil.java:277)
	at com.intellij.openapi.progress.util.BackgroundTaskUtil.runUnderDisposeAwareIndicator(BackgroundTaskUtil.java:255)
	at com.intellij.codeInsight.daemon.impl.ExternalToolPass$1.run(ExternalToolPass.java:189)
	at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:333)
	at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:323)
	at com.intellij.util.ui.update.MergingUpdateQueue.lambda$flush$1(MergingUpdateQueue.java:273)
	at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:287)
	at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:241)
	at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:240)
	at com.intellij.util.Alarm$Request.runSafely(Alarm.java:385)
	at com.intellij.util.Alarm$Request.run(Alarm.java:374)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at com.intellij.util.concurrency.SchedulingWrapper$MyScheduledFutureTask.run(SchedulingWrapper.java:220)
	at com.intellij.util.concurrency.BoundedTaskExecutor.doRun(BoundedTaskExecutor.java:246)
	at com.intellij.util.concurrency.BoundedTaskExecutor.access$200(BoundedTaskExecutor.java:32)
	at com.intellij.util.concurrency.BoundedTaskExecutor$1.execute(BoundedTaskExecutor.java:225)
	at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:213)
	at com.intellij.util.concurrency.BoundedTaskExecutor$1.run(BoundedTaskExecutor.java:214)
	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.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
	at java.base/java.lang.Thread.run(Thread.java:829)

Sometimes it works then stop.
Please check if having namespaces with names like app.$-example.core can affect plugin functionality.

This stacktrace must be from the older version, I was not handling backslashes correctly so \Users was being handled as a escape char. I'll test namespace with 'special' chars

This stacktrace must be from the older version, I was not handling backslashes correctly so \Users was being handled as a escape char. I'll test namespace with 'special' chars

Nopes, my bad again, I managed to reproduce it on a windows machine following the same versions, should be fixed by next version, can I send you a build before uploading it to Jetbrains? :)

can I send you a build before uploading it to Jetbrains?

sure

Fixed on master!