Open folmert opened 7 years ago
It seems that PHPstorm doesn't have a PsiUtil class, use PsiUtilCore class instead.
Frankly, these problems are gone when I use built-in plugin, it appears you don't have to download it. When I go to Plugins > Browse repositories > IntelliJ Stylelint Plugin I can see I don't have it installed and yet I still have Stylelint under Languages > Stylesheets > Stylelint. I wonder what's the difference between those two.
There seems to be a bug with the built-in Stylelint for PhpStorm, which is why I tried this plugin. But I'm having similar issues.
It's attempting to read ../dist/cli.js
in the stylelint directory in node_modules
but at least in the current version of Stylelint, there is no dist
folder (rather, there's a lib/cli.js
instead).
@niutech I just did one (probably last) push. It adds a configuration dialog to select the executable path (since you were the one who actually published this to the plugins repository :) ). @folmert @mmiller42: I just tested PhpStorm and it doesn't work either with a different error. I may retire from this since there is a newly released built-in version.
I have just built the latest version 1.3 and pushed to the JetBrains Plugin Repository.
Installed your version 1.3, but still not work in Win10Pro, PHPStorm 2016.3.2
OK, I got another Error after reinstalled Stylelint plugin and Stylelint npm package. After reinstalled all stuffs now I see the setting for stylelint.cmd which was hidden in configuration before, I selected right path for stylelint.cmd and after PHPStorm restart I see new error:
com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 7 path $ com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 7 path $ at com.google.gson.JsonParser.parse(JsonParser.java:65) at com.google.gson.JsonParser.parse(JsonParser.java:45) at com.jokerzoid.intellij.plugin.stylelint.ProcessManager.getOutput(ProcessManager.java:79) at com.jokerzoid.intellij.plugin.stylelint.ProcessManager.runStylelint(ProcessManager.java:42) at com.jokerzoid.intellij.plugin.stylelint.StylelintAnnotator.doAnnotate(StylelintAnnotator.java:41) at com.jokerzoid.intellij.plugin.stylelint.StylelintAnnotator.doAnnotate(StylelintAnnotator.java:19) at com.intellij.codeInsight.daemon.impl.ExternalToolPass.c(ExternalToolPass.java:212) at com.intellij.codeInsight.daemon.impl.ExternalToolPass.access$500(ExternalToolPass.java:44) at com.intellij.codeInsight.daemon.impl.ExternalToolPass$1.run(ExternalToolPass.java:160) at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:337) at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:327) at com.intellij.util.ui.update.MergingUpdateQueue.lambda$flush$1(MergingUpdateQueue.java:277) at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:291) at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:246) at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:223) at com.intellij.util.Alarm$Request$1.run(Alarm.java:387) at com.intellij.util.Alarm$Request.run(Alarm.java:398) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at com.intellij.util.concurrency.SchedulingWrapper$MyScheduledFutureTask.run(SchedulingWrapper.java:237) at com.intellij.util.concurrency.BoundedTaskExecutor$2.run(BoundedTaskExecutor.java:210) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 7 path $ at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1574) at com.google.gson.stream.JsonReader.checkLenient(JsonReader.java:1423) at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:546) at com.google.gson.stream.JsonReader.peek(JsonReader.java:429) at com.google.gson.JsonParser.parse(JsonParser.java:60) ... 23 more
@standus This is not the config option for this plugin, but for the built-in Stylelint support.
The setting for this plugin looks like this:
Your exception means that the JSON output from Stylelint executable is malformed. Can you run stylelint -f json
in the console from your project directory?
Hi, I'm trying to configure the stylelint plugin (version 1.3) in phpStorm 2016.3. I've installed stylelint globally and specified the path to the executable in preferences:
After IDE restart I got this error:
This is not a JSON Array. java.lang.IllegalStateException: This is not a JSON Array. at com.google.gson.JsonElement.getAsJsonArray(JsonElement.java:106) at com.jokerzoid.intellij.plugin.stylelint.ProcessManager.getOutput(ProcessManager.java:79) at com.jokerzoid.intellij.plugin.stylelint.ProcessManager.runStylelint(ProcessManager.java:42) at com.jokerzoid.intellij.plugin.stylelint.StylelintAnnotator.doAnnotate(StylelintAnnotator.java:41) at com.jokerzoid.intellij.plugin.stylelint.StylelintAnnotator.doAnnotate(StylelintAnnotator.java:19) at com.intellij.codeInsight.daemon.impl.ExternalToolPass.c(ExternalToolPass.java:212) at com.intellij.codeInsight.daemon.impl.ExternalToolPass.access$500(ExternalToolPass.java:44) at com.intellij.codeInsight.daemon.impl.ExternalToolPass$1.run(ExternalToolPass.java:160) at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:337) at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:327) at com.intellij.util.ui.update.MergingUpdateQueue.lambda$flush$1(MergingUpdateQueue.java:277) at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:291) at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:246) at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:223) at com.intellij.util.Alarm$Request$1.run(Alarm.java:387) at com.intellij.util.Alarm$Request.run(Alarm.java:398) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at com.intellij.util.concurrency.SchedulingWrapper$MyScheduledFutureTask.run(SchedulingWrapper.java:237) at com.intellij.util.concurrency.BoundedTaskExecutor$2.run(BoundedTaskExecutor.java:210) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)
Did I do something wrong?
same problem here. please provide some workaround or info.
When I run PhpStorm:
However, the plugin works, but only with CSS files. SCSS, PCSS seem to be ignored in PhpStorm. In Webstorm it highlights errors in all 3 file types: CSS, SCSS and PCSS, and no error appears.