intellij-plugin-save-actions icon indicating copy to clipboard operation
intellij-plugin-save-actions copied to clipboard

'Execute an action' not working for Tailwind formatter

Open wimdeblauwe opened this issue 3 years ago • 3 comments

Describe the bug I am trying to use Save actions with the Tailwind formatter plugin (https://github.com/MyOutDeskLLC/Tailwind-Formatter). I created a quicklist with the run formatter action:

image

I configured Save actions to use that quick list:

image

When I have a file that needs to be reformatted, it will reformat the HTML (Due to the 'Reformat file' option), but the Tailwind formatter will not run. If I press the shortcut for the tailwind formatter separately, it does work.

What triggered the plugin Frame deactivation (window loses focus), CTRL+SHIFT+S, CTRL+S, etc. -> Does not seem to matter, I tried frame deactivation and CTRL+S

Versions In Intellij, go to "Help > About > Copy" and paste it here

IntelliJ IDEA 2020.2 (Ultimate Edition)
Build #IU-202.6397.94, built on July 27, 2020
Runtime version: 11.0.7+10-b944.20 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 10.15.6
GC: ParNew, ConcurrentMarkSweep
Memory: 1979M
Cores: 16
Non-Bundled Plugins: PlantUML integration, com.alicannklc.tailwind, CheckStyle-IDEA, com.dubreuia, com.myoutdesk.tailwind_formatter, name.kropp.intellij.makefile, org.toml.lang, ru.adelf.idea.dotenv, org.asciidoctor.intellij.asciidoc

I am using Save Actions 2.0.0.

The IntelliJ log file shows no exceptions:

020-08-17 15:40:10,463 [ 501289]   WARN - tions.ex.ConfigurableCardPanel - auto-dispose 'Plugins' id=preferences.pluginManager 
2020-08-17 15:40:13,955 [ 504781]   INFO - re.component.SaveActionManager - [+] Start SaveActionManager#beforeAllDocumentsSaving 
2020-08-17 15:40:13,955 [ 504781]   INFO - re.component.SaveActionManager - Locating psi files for 0 documents: [] 
2020-08-17 15:40:13,955 [ 504781]   INFO - re.component.SaveActionManager - End SaveActionManager#beforeAllDocumentsSaving 
2020-08-17 15:40:24,100 [ 514926]   INFO - re.component.SaveActionManager - [+] Start SaveActionManager#beforeAllDocumentsSaving 
2020-08-17 15:40:24,100 [ 514926]   INFO - re.component.SaveActionManager - Locating psi files for 0 documents: [] 
2020-08-17 15:40:24,100 [ 514926]   INFO - re.component.SaveActionManager - End SaveActionManager#beforeAllDocumentsSaving 
2020-08-17 15:40:25,709 [ 516535]   INFO - re.component.SaveActionManager - [+] Start SaveActionManager#beforeAllDocumentsSaving 
2020-08-17 15:40:25,709 [ 516535]   INFO - re.component.SaveActionManager - Locating psi files for 0 documents: [] 
2020-08-17 15:40:25,709 [ 516535]   INFO - re.component.SaveActionManager - End SaveActionManager#beforeAllDocumentsSaving 

wimdeblauwe avatar Aug 17 '20 13:08 wimdeblauwe

Hello @wimdeblauwe, I'm sorry for the delay, I didn't see this issue, thank you for sending it.

The "execute quick action" is quite experimental for now, I does work for some actions, but doesn't for others. What I'm doing is sending the action adding a bunch of context variables, hoping the action on the other side will take one of those variable (a shot in the dark, really).

So the Tailwind plugin uses the CommonDataKeys.VIRTUAL_FILE variable (see https://github.com/MyOutDeskLLC/Tailwind-Formatter/blob/master/src/main/java/TailwindAction.java#L16), which I'm not setting in save actions (see https://github.com/dubreuia/intellij-plugin-save-actions/blob/main/src/main/java/com/dubreuia/processors/BuildProcessor.java#L84).

I'll try adding it and see how it goes

dubreuia avatar Sep 10 '20 15:09 dubreuia

Tentative dodgy fix in 2.1.0, I have no idea if its gonna work

dubreuia avatar Sep 11 '20 22:09 dubreuia

This broke the plugin, reopening

dubreuia avatar Sep 16 '20 23:09 dubreuia