dprint / dprint-intellij

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

It looks like dprint auto reformat on save is not working on WSL #55

Open SirMishaa opened 1 year ago

SirMishaa commented 1 year ago

Hello,

I'm using the latest version of the plugin and when I'm on WSL, the autosave is not working. But it's working good on my Mac.

Configuration files seems to be here, but I'm not sure how to get log from the daemon.

hexa-node/.idea on  main [!?] on   (eu-central-1)
❯ bat dprintProjectConfig.xml
───────┬────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       │ File: dprintProjectConfig.xml
───────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1   │ <?xml version="1.0" encoding="UTF-8"?>
   2   │ <project version="4">
   3   │   <component name="DprintProjectConfiguration">
   4   │     <option name="enabled" value="true" />
   5   │   </component>
   6   │ </project>
───────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────

hexa-node/.idea on  main [!?] on   (eu-central-1)
❯ bat dprintUserConfig.xml
───────┬────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       │ File: dprintUserConfig.xml
───────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1   │ <?xml version="1.0" encoding="UTF-8"?>
   2   │ <project version="4">
   3   │   <component name="DprintUserConfiguration">
   4   │     <option name="runOnSave" value="true" />
   5   │   </component>
   6   │ </project>
───────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────

hexa-node/.idea on  main [!?] on   (eu-central-1)
❯

Could you look at it a bit? Regards

ryan-rushton commented 1 year ago

Thanks for the report, sorry it took me a bit to get back to you. I will have a look into it over the next couple of weeks.

ryan-rushton commented 1 year ago

Just musing about this, and @dsherret being a windows user for development you might know better than me, but since WSL and windows in general are using different file systems it could be possible that communication between the dprint daemon that this intellij plugin uses and the wsl filesystem don't work correctly.

@SirMishaa, to get logs, I need the IntelliJ logs in general just after you have tried to format, or alternatively there is a tool window with logs for dprint only, make sure to enable verbose logging in the dprint plugin settings.

Secondly, you might need to specify the base path of the project specifically in settings. The plugin will use the .idea/ folder to get a base path if one is not specified. By setting it explicitly you might be able to get around this.

In any case, I will get wsl installed and have a go at this myself during the week.