dprint / dprint-intellij

A dprint plugin for Intellij.
https://plugins.jetbrains.com/plugin/18192-dprint
MIT License
12 stars 2 forks source link

Executable error on Windows #22

Closed prescience-data closed 2 years ago

prescience-data commented 2 years ago

I get a string of IDE errors when trying to use the plugin with WebStorm/PhpStorm on Windows.

I may be pointing the plugin at the incorrect executable, but so far I've tried the following:

Errors


Dprint config error
Unable to retrieve a valid dprint executable path.

Dprint config error
Could not find a dprint executable

Dprint config error
The configured dprint executable is invalid

Context

Additional Troubleshooting

I have removed all Node copies and installed via scoop as per the documentation instructions, and get this IDE error: (note: I also got this error when using the .exe via Node)


java.nio.BufferUnderflowException
    at java.base/java.nio.Buffer.nextGetIndex(Buffer.java:651)
    at java.base/java.nio.HeapByteBuffer.getInt(HeapByteBuffer.java:402)
    at com.dprint.services.DprintService.readInt(DprintService.kt:202)
    at com.dprint.services.DprintService.canFormat(DprintService.kt:263)
    at com.dprint.services.FormatterService$format$1.invoke(FormatterService.kt:63)
    at com.dprint.services.FormatterService$format$1.invoke(FormatterService.kt:45)
    at com.dprint.services.FormatterService$executeUnderProgress$task$1.run(FormatterService.kt:143)
    at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:442)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:114)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsynchronously$5(CoreProgressManager.java:493)
    at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3(ProgressRunner.java:244)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:189)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:608)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:683)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:639)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:607)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
    at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:176)
    at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:244)
    at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
    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)
ryan-rushton commented 2 years ago

@prescience-data did you manage to fix this (based on your newer issue)? I mainly work on mac/linux but I do have a windows computer I can set up and try debug this if you are still having the issue. I don't think I have included any system specific code.

prescience-data commented 2 years ago

Yes it was a configuration error in that I'd included a "dockerfile" json node (which is not valid).

For reference, this was reported when running via the CLI, so if there is a way to pass these more verbose messages through to the IDE notification it would help a lot (as the existing "The configured dprint executable is invalid" message is a bit vague by comparison).

ryan-rushton commented 2 years ago

Ah awesome, I will try see if I can pass something better through. One thing to note is there is likely the information you need in the IDE log, I will see if I can get that to surface up without being too noisy.