Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'Execute an action' not working for Tailwind formatter #331

Open
wimdeblauwe opened this issue Aug 17, 2020 · 3 comments
Open

'Execute an action' not working for Tailwind formatter #331

wimdeblauwe opened this issue Aug 17, 2020 · 3 comments
Milestone

Comments

@wimdeblauwe
Copy link

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 
@dubreuia
Copy link
Owner

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
Copy link
Owner

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

@dubreuia
Copy link
Owner

This broke the plugin, reopening

@dubreuia dubreuia reopened this Sep 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants