Git Product home page Git Product logo

Comments (91)

dubreuia avatar dubreuia commented on May 28, 2024 5

save-actions.zip

Unzip, inside you have a .jar that you can import by hand in Intellij (Settings > Plugins > Import from jar). It is version 0.12-RC, it is based on 0.10 (not the latest available, you have probably on 0.11 right now).

from intellij-plugin-save-actions.

dubreuia avatar dubreuia commented on May 28, 2024 5

Added WebStorm in https://github.com/dubreuia/intellij-plugin-save-actions/releases/tag/v0.23

  • IntelliJ IDEA (OK)
  • PhpStorm (OK)
  • PyCharm (OK)
  • AndroidStudio (OK)
  • WebStorm (OK)
  • Rider (todo)
  • AppCode (todo)
  • CLion (todo)
  • DataGrip (todo)
  • RubyMine (todo)

from intellij-plugin-save-actions.

dubreuia avatar dubreuia commented on May 28, 2024 4

Hey @ptr1120, would you mind testing it? Download the jar at https://github.com/dubreuia/intellij-plugin-save-actions/releases/tag/v0.26, then "File > Settings > Plugins > Install plugin from disk..." and import the jar, restart and see if it works for you.

If it works, I'll add it to the supported products and you'll see it in "Browse Repository" in Intellij. Thanks.

from intellij-plugin-save-actions.

dubreuia avatar dubreuia commented on May 28, 2024 4

Ok I'll check Rider dans Clion before releasing 1.1.0, which should be by the end of the month

from intellij-plugin-save-actions.

bobvandevijver avatar bobvandevijver commented on May 28, 2024 4

I'm also looking forward to Rider support, but you say it's not supported? How come?

Edit: Adding missing not

from intellij-plugin-save-actions.

dubreuia avatar dubreuia commented on May 28, 2024 4

I've created 3 issues for each of Rider, AppCode and CLion. Can you guys go vote and post in the issues to see which is needed?

I'm closing this issue. Thanks

from intellij-plugin-save-actions.

dubreuia avatar dubreuia commented on May 28, 2024 3

New version 0.18 should work in PyCharm and PhpStorm

from intellij-plugin-save-actions.

dubreuia avatar dubreuia commented on May 28, 2024 2

Thanks, I'll add that, but I'll need to test it in all intellij products.

from intellij-plugin-save-actions.

dubreuia avatar dubreuia commented on May 28, 2024 2

Thanks you for testing @ptr1120, I'll have to debug it. I'm updating:

  • IntelliJ IDEA (OK)
  • PhpStorm (OK)
  • PyCharm (OK)
  • AndroidStudio (OK)
  • WebStorm (OK)
  • RubyMine (OK)
  • Rider (settings OK - reformat KO)
  • AppCode (todo)
  • CLion (todo)
  • DataGrip (todo)

from intellij-plugin-save-actions.

bbakermmc avatar bbakermmc commented on May 28, 2024 2

I looked for Save Actions in the marketplace and it doesnt exist? Does this support rider?

image

from intellij-plugin-save-actions.

dubreuia avatar dubreuia commented on May 28, 2024 2

@ned1988 Thanks for testing. The option "No action if compile errors" requires a compiler, and since it is platform specific (java, python, etc.) I haven't coded this already outside the Java ecosystem. There's a "core" plugin, used everywhere, and a "java" plugin, used for java products. We'll need "language" plugin for each product we want to fully support, Rider included. If it woks fine I'll mark it as supported then.

from intellij-plugin-save-actions.

dubreuia avatar dubreuia commented on May 28, 2024 2

I'm thinking of splitting this issue for each products, this issue is 4 years old...

from intellij-plugin-save-actions.

dubreuia avatar dubreuia commented on May 28, 2024 1

Thanks for your feedback, I'll make that available on the Jetbrains plugin repository.

from intellij-plugin-save-actions.

thiagotalma avatar thiagotalma commented on May 28, 2024 1

Ok with PHPStorm!

from intellij-plugin-save-actions.

F21 avatar F21 commented on May 28, 2024 1

Doesn't work with Gogland 1.0 EAP (163.10615.6) for golang using 0.12. Would be awesome if it could be supported 😄

from intellij-plugin-save-actions.

dubreuia avatar dubreuia commented on May 28, 2024 1

Hey @afwlehmann I'll try to repackage it with a recent version of the plugin. Honestly, not much changed for non-Java languages in recent versions.

I won't release it on the official plugin repository, I don't have time to maintain the plugin for Intellij IDEA, if I support all product I'll have thousand of new users I don't have time to support

from intellij-plugin-save-actions.

dubreuia avatar dubreuia commented on May 28, 2024 1
  • AppCode (todo)
  • CLion (todo)
  • DataGrip (todo)
  • IntelliJ IDEA (OK)
  • PhpStorm (OK)
  • PyCharm (OK)
  • Rider (todo)
  • RubyMine (todo)
  • WebStorm (todo)

from intellij-plugin-save-actions.

dubreuia avatar dubreuia commented on May 28, 2024 1

@bobvandevijver Rider is not supported because I don't have time to write the code. You can submit a PR to add Rider support anytime.

from intellij-plugin-save-actions.

dubreuia avatar dubreuia commented on May 28, 2024 1

@bobvandevijver Thank you for the debug. I'm pretty sure the reformat in Rider and PyCharm (maybe others) is not done by ReformatCodeProcessor. We'll need to provide specific implementation for those products (like META-INF/plugin-java.xml for Java), and call the proper formatter on save.

from intellij-plugin-save-actions.

bobvandevijver avatar bobvandevijver commented on May 28, 2024 1

Not sure, what do you mean about vcs changed code.

@van800 To reformat only changed lines according to your VCS (eg. git) (which is one of the options of the ReformatCodeProcessor, which uses the CodeStyleManager internally)

from intellij-plugin-save-actions.

denys-meloshyn avatar denys-meloshyn commented on May 28, 2024 1

@hwangjr @dubreuia looks like it works fine in AppCode 2019.1, tomorrow will test it more

from intellij-plugin-save-actions.

dubreuia avatar dubreuia commented on May 28, 2024

From twitter: "Hi there, I just installed Save Actions on phpstorm 9.0.2 but cannot find the settings as described in the documentation."

from intellij-plugin-save-actions.

dubreuia avatar dubreuia commented on May 28, 2024

Lots of demand for this:

  • PyCharm (#22)
  • Android Studio #31
  • PHPStorm #32

from intellij-plugin-save-actions.

XXChester avatar XXChester commented on May 28, 2024

Guess the php webstorm support never made it in? Was really excited when I found this plugin and it installed fine, just cannot find the settings anywhere.

from intellij-plugin-save-actions.

dubreuia avatar dubreuia commented on May 28, 2024

Hey @XXChester I'm working on bringing the plugin to all products right now, PhpStorm will soon be supported. I closed specific issues because they are duplicate with this one (I'll release it for all products at the same time).

from intellij-plugin-save-actions.

XXChester avatar XXChester commented on May 28, 2024

👍 Awesome. I thought it was abandoned date, glad to hear it is not.

from intellij-plugin-save-actions.

sgeier avatar sgeier commented on May 28, 2024

Glad to hear you are working on making it work on a variety of platforms. Is it possible to release a port as soon as its finished instead of waiting for release until all other platforms are done? This would help so much. I personally feel that my quality of codes degrades without SaveActions. I really want this on Android Studio.

from intellij-plugin-save-actions.

dubreuia avatar dubreuia commented on May 28, 2024

Is Android Studio a JetBrains product? I'm testing for:

  • Intellij IDEA
  • PhpStorm
  • WebStorm
  • PyCharm
  • RubyMine
  • AppCode
  • CLion
  • DataGrip (maybe?)

from intellij-plugin-save-actions.

dubreuia avatar dubreuia commented on May 28, 2024

The branch all-products works, I just haven't properly tested it yet

from intellij-plugin-save-actions.

sgeier avatar sgeier commented on May 28, 2024

Dubreuia, Android Studio is based on Intellij IDEA. So practically the IDEA extension/plugins should work but it doesn't - in fact, and this is where the troubles com in, it cant even be downloaded as a plugin from the Plugin repository browser inside Android Studio. Its just not listed. I just verified this. Appears in Idea (version 15) but doesnt in Android Studio (lastest) 2.1.1. As its entirely based on Idea I would assume its not too much effort to enable it for Android Studio. Anyway I keep waiting :) Keep up the good work!

from intellij-plugin-save-actions.

krasa avatar krasa commented on May 28, 2024

You need to put <depends>com.intellij.modules.platform</depends> into plugin.xml .
edit: nevermind, you already did in that branch :)

from intellij-plugin-save-actions.

dubreuia avatar dubreuia commented on May 28, 2024

@krasa Thanks already done! The problem is that I have Java specific elements, so I need to split the plugin in two parts so it doesn't crash on startup with PyCharm, etc.

@sgeier OK it is not a JetBrains product but it should work too, note to self : https://developer.android.com/studio/index.html

I should release the all-product version this weekend if all goes well

from intellij-plugin-save-actions.

rmgrimm avatar rmgrimm commented on May 28, 2024

@dubreuia Any update on the release of the all-product branch? We'd like to start using it across the dev team here as soon as it's ready

I'm happy to support in any testing as well, let me know. 👍

from intellij-plugin-save-actions.

dubreuia avatar dubreuia commented on May 28, 2024

Actually it's already ready, but I don't have time to test it so I didn't release it. I'll send you the jar so you can test if you want.

from intellij-plugin-save-actions.

Tuupertunut avatar Tuupertunut commented on May 28, 2024

@dubreuia I can confirm that zipped version works on WebStorm 2016.2.3.

from intellij-plugin-save-actions.

manojvignesh avatar manojvignesh commented on May 28, 2024

The zip file works fine in WebStorm 2016.2.4. Thanks for this awesome plugin.

from intellij-plugin-save-actions.

spencero91 avatar spencero91 commented on May 28, 2024

Any way we could get this added to the Jetbrains' plugin repository for PhpStorm?

from intellij-plugin-save-actions.

dubreuia avatar dubreuia commented on May 28, 2024

Hey @spencero91, try the save-actions zip I uploaded in this issue, you can import it directly in PhpStorm.

I don't want to upload it to the plugin repository just now, I haven't tested it in all products, and I don't have time to correct all the issues that are opened only for intellij...

The code is on branch master-all-product.

Keep me posted if that works for you

from intellij-plugin-save-actions.

dubreuia avatar dubreuia commented on May 28, 2024

Check #69 for licences to test in all products

from intellij-plugin-save-actions.

bentemple avatar bentemple commented on May 28, 2024

For AS 2.3 I was able to download the latest version from https://plugins.jetbrains.com/plugin/7642-save-actions and then just install from within android studio:

Android Studio (Menu) -> Preferences -> Plugins -> Install plugin from disk...

Works just fine for me. The settings for it can be found under Other Settings

from intellij-plugin-save-actions.

dubreuia avatar dubreuia commented on May 28, 2024

Yeah it works as-is for Android Studio because it is a Java IDE. The other products will need the zip that is packaged in this issue.

from intellij-plugin-save-actions.

matthewadams avatar matthewadams commented on May 28, 2024

Just tested in WebStorm 2017.1. Appears to work. Suggestions:

  • Include an option to reformat when the editor autosaves. The behavior I'm currently seeing is that reformatting is only taking place if I hit Ctrl-S/Cmd-S.
  • Place language-specific configuration options in language-specific sections. For example, "Organize Imports", "Rearrange fields ..." and "Compile File" only make sense for compiled languages (Java, TypeScript, etc), but they don't make any sense for JavaScript files.

Great plugin, especially for large teams! 👍

from intellij-plugin-save-actions.

dubreuia avatar dubreuia commented on May 28, 2024

Hey @matthewadams thanks for the testing and the tweet I appreciate it.

Include an option to reformat when the editor autosaves. The behavior I'm currently seeing is that reformatting is only taking place if I hit Ctrl-S/Cmd-S.

Actually, that should work. The autosave in Intellij is somewhat finicky, the easiest way to force it is by losing focus. Try (1) change a formatting or add unused import (2) click on another non-intellij window. It should reformat. That's the whole point of the plugin: not to think about it.

Place language-specific configuration options in language-specific sections. For example, "Organize Imports", "Rearrange fields ..." and "Compile File" only make sense for compiled languages (Java, TypeScript, etc), but they don't make any sense for JavaScript files.

There is already a classification, the version you are using doesn't have the Java quick fixes. The one I left are, for me, available for all languages. It is based on the langage-based processors in the Intellij platform.

It is also very hard to classify language like this, for instance vanilla ES6 have imports but not the previous versions...

from intellij-plugin-save-actions.

matthewadams avatar matthewadams commented on May 28, 2024

Yes, it worked when WebStorm lost focus. Maybe you should open an issue with JetBrains to get more consistent notification of autosave so that the behavior is consistent, but that's up to you. Is there a more standard place from which to download the plugin than this issue now that it's been confirmed to work on other JetBrains products? Thanks again!

from intellij-plugin-save-actions.

afwlehmann avatar afwlehmann commented on May 28, 2024

Any chance getting a recent version of the plugin with the patch? I'm looking for support in pycharm and CLion. Sorry if I've overlooked something, but IMO the link provided above refers to a patched v11 of the plugin.

from intellij-plugin-save-actions.

afwlehmann avatar afwlehmann commented on May 28, 2024

@dubreuia Thanks a lot!

from intellij-plugin-save-actions.

dubreuia avatar dubreuia commented on May 28, 2024

@afwlehmann I repackaged the plugin for all products on version 0.17. This time I merged the code to master, but didn't activate the plugin for all product (the line is commented in the plugin.xml file). It is not in the plugin repository yet but I might add it soon.

I tested in PyCharm and it seems to work. Keep me posted if it works for you.

save-actions_0.17.jar.zip

edit: you need to unzip the jar, then import in pycharm or other

from intellij-plugin-save-actions.

dubreuia avatar dubreuia commented on May 28, 2024

Currently tested:

  • PyCharm: OK
  • AndroidStudio: OK (BUT exception quick fixes do not work, offending line META-INF/plugin.xml:73 do not load the java xml)

from intellij-plugin-save-actions.

afwlehmann avatar afwlehmann commented on May 28, 2024

@dubreuia That's very much appreciated! I'll give it a try as soon as possible and let you know. Thanks :)

from intellij-plugin-save-actions.

afwlehmann avatar afwlehmann commented on May 28, 2024

Works like a charm, thank you very much for your time and effort! (Tested on PyCharm / Linux, I'll give it another try on CLion in a couple of days)

from intellij-plugin-save-actions.

dubreuia avatar dubreuia commented on May 28, 2024

Thanks @afwlehmann I'll slowly add supported products then. I'll add PyCharm for now

from intellij-plugin-save-actions.

celogeek avatar celogeek commented on May 28, 2024

I can confirm it work as expected on the latest PyCharm on MacOS

from intellij-plugin-save-actions.

dubreuia avatar dubreuia commented on May 28, 2024

Version 0.21 (https://github.com/dubreuia/intellij-plugin-save-actions/releases/tag/v0.21) adds official support to AndroidStudio. I'd like to do WebStorm after

  • IntelliJ IDEA (OK)
  • PhpStorm (OK)
  • PyCharm (OK)
  • AndroidStudio (OK)
  • WebStorm (todo)
  • Rider (todo)
  • AppCode (todo)
  • CLion (todo)
  • DataGrip (todo)
  • RubyMine (todo)

If you are using that plugin, could you rate it on https://plugins.jetbrains.com/plugin/7642-save-actions

from intellij-plugin-save-actions.

markiewb avatar markiewb commented on May 28, 2024

@dubreuia: 0.21 works in

WebStorm 2017.2.3
Build #WS-172.3968.27, built on August 29, 2017
JRE: 1.8.0_152-release-915-b11 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Mac OS X 10.12.6

Except #110

from intellij-plugin-save-actions.

dubreuia avatar dubreuia commented on May 28, 2024

OK I'll correct #110 and add support for WebStorm when I have time

from intellij-plugin-save-actions.

studgeek avatar studgeek commented on May 28, 2024

Is there a hurdle to just adding CLion also?

from intellij-plugin-save-actions.

dubreuia avatar dubreuia commented on May 28, 2024

Hey @studgeek I've given up on testing the plugin on all Jetbrain's products, I let users do that and report it here.

You can install the plugin in CLion by downloading the latest version from https://github.com/dubreuia/intellij-plugin-save-actions/releases and then doing "File > Settings > Plugins > Install plugin from disk" and choosing the jar you downloaded.

from intellij-plugin-save-actions.

d4rky-pl avatar d4rky-pl commented on May 28, 2024

Just tested and it seems to work fine in RubyMine :)
(too bad it's not the plugin I was looking for 😂)

from intellij-plugin-save-actions.

dubreuia avatar dubreuia commented on May 28, 2024

Hey @d4rky-pl, thank you for telling us! I hope you'll find what you are looking for :)

I'll add RubyMine support when I release next version

from intellij-plugin-save-actions.

dubreuia avatar dubreuia commented on May 28, 2024

Added RubyMine in https://github.com/dubreuia/intellij-plugin-save-actions/releases/tag/v0.25

  • IntelliJ IDEA (OK)
  • PhpStorm (OK)
  • PyCharm (OK)
  • AndroidStudio (OK)
  • WebStorm (OK)
  • RubyMine (OK)
  • Rider (todo)
  • AppCode (todo)
  • CLion (todo)
  • DataGrip (todo)

from intellij-plugin-save-actions.

dubreuia avatar dubreuia commented on May 28, 2024

It seems it works in CLion too (https://twitter.com/LlewellynFalco/status/957228926719463424). I'm adding support in next version https://github.com/dubreuia/intellij-plugin-save-actions/releases/tag/v0.26

from intellij-plugin-save-actions.

pablogarciamiranda avatar pablogarciamiranda commented on May 28, 2024

It's not working for me on WebStorm 2017.2.5

from intellij-plugin-save-actions.

dubreuia avatar dubreuia commented on May 28, 2024

Hey @pablogarciamiranda thanks for the update. I'll check it out.

from intellij-plugin-save-actions.

dubreuia avatar dubreuia commented on May 28, 2024

Hey @pablogarciamiranda thanks for the update. I'll just tested in "WebStorm 2017.3.4 Build #WS-173.4548.30, built on January 30, 2018" and it works. What is the problem?

from intellij-plugin-save-actions.

ptr1120 avatar ptr1120 commented on May 28, 2024

Rider support would be great since this plugin is very helpful.

from intellij-plugin-save-actions.

ptr1120 avatar ptr1120 commented on May 28, 2024

Thanks, @dubreuia, installed the plugin, plugin settings are available, but nothing happens during save action execution. The idea log says:

10:19:18.884 | INFO  | FileBasedIndexProjectHandler   | Reindexing refreshed files: 0 to update, calculated in 26ms
10:19:38.861 | DEBUG | SaveActionManager              | Running SaveActionManager on DocumentImpl[file://<myFolder>/MyFile.cs]
10:19:38.871 | DEBUG | SaveActionManager              | Running processors [RearrangeCode (true), OptimizeImports (true), ReformatAllText (true)], file RIDER_SOURCE_CODE_FILE, project Project '<myFolder>' NopCommerce
10:19:41.178 | INFO  | ProjectRootManagerComponent    | project roots have changed
10:19:42.140 | INFO  | PerformanceWatcher             | Pushing properties took 431ms; general responsiveness: ok; EDT responsiveness: 1/1 sluggish
10:19:42.280 | INFO  | PerformanceWatcher             | Indexable file iteration took 139ms; general responsiveness: ok; EDT responsiveness: ok
10:19:42.280 | INFO  | UnindexedFilesUpdater          | Unindexed files update started: 1 files to update
10:19:42.576 | INFO  | PerformanceWatcher             | Unindexed files update took 296ms; general responsiveness: ok; EDT responsiveness: ok
10:19:43.905 | INFO  | SolutionLifecycleHost          | Full warm solution load with caches took 34889 milliseconds.
10:19:47.571 | DEBUG | SaveActionManager              | Running SaveActionShortcutManager on com.intellij.openapi.actionSystem.AnActionEvent@7398727d
10:19:47.818 | DEBUG | SaveActionManager              | Running SaveActionShortcutManager on com.intellij.openapi.actionSystem.AnActionEvent@4c84eb97
10:19:47.988 | DEBUG | SaveActionManager              | Running SaveActionShortcutManager on com.intellij.openapi.actionSystem.AnActionEvent@6c8722f
10:19:48.138 | DEBUG | SaveActionManager              | Running SaveActionShortcutManager on com.intellij.openapi.actionSystem.AnActionEvent@15f1dda4
10:19:48.270 | DEBUG | SaveActionManager              | Running SaveActionShortcutManager on com.intellij.openapi.actionSystem.AnActionEvent@5f20dfe0
10:19:48.391 | DEBUG | SaveActionManager              | Running SaveActionShortcutManager on com.intellij.openapi.actionSystem.AnActionEvent@41a33d8e
10:19:48.512 | DEBUG | SaveActionManager              | Running SaveActionShortcutManager on com.intellij.openapi.actionSystem.AnActionEvent@5309b51
10:19:48.639 | DEBUG | SaveActionManager              | Running SaveActionShortcutManager on com.intellij.openapi.actionSystem.AnActionEvent@75104dcf
10:19:48.753 | DEBUG | SaveActionManager              | Running SaveActionShortcutManager on com.intellij.openapi.actionSystem.AnActionEvent@1aa13d13
10:19:48.894 | DEBUG | SaveActionManager              | Running SaveActionShortcutManager on com.intellij.openapi.actionSystem.AnActionEvent@111d84c5
10:21:55.025 | INFO  | ShowFilePathAction             | 
Exit code 1
` ` ` 

I obfuscated folder and filename, but the original values where correct.

from intellij-plugin-save-actions.

van800 avatar van800 commented on May 28, 2024

I tried the Rider support also. Settings are shown fine, but nothing except https://youtrack.jetbrains.com/issue/DEXP-381630 happends on Save.

from intellij-plugin-save-actions.

qayshp avatar qayshp commented on May 28, 2024

For me, using Rider on macOS, after downloading and pointing it at the jar, (unlike above) I don't get any errors in the Event Log, and I see the preference pane and it saves fine (like above).
Unfortunately it also seems not to change anything on save, regardless of the settings I enable.

from intellij-plugin-save-actions.

findpikachu avatar findpikachu commented on May 28, 2024

this plugin doen't work for clion.

from intellij-plugin-save-actions.

dubreuia avatar dubreuia commented on May 28, 2024

CLion works. A bit too well since it deletes used imports but formatting is OK. See #180.

from intellij-plugin-save-actions.

dubreuia avatar dubreuia commented on May 28, 2024

Actually, Rider is not officially supported and CLion works so we're good for 1.1.0, no regression.

from intellij-plugin-save-actions.

MartinX3 avatar MartinX3 commented on May 28, 2024

"ist not"
Maybe in 1.2.0?

from intellij-plugin-save-actions.

bobvandevijver avatar bobvandevijver commented on May 28, 2024

Right. I mistakenly assumed you meant not supported from JetBrains, as you wrote "officially". I might take a look (although I've never touched JetBrains plugins before)

from intellij-plugin-save-actions.

dubreuia avatar dubreuia commented on May 28, 2024

Sorry for the mixup, I meant "If it is not in https://github.com/dubreuia/intellij-plugin-save-actions#compatibility, it might work but I haven't tested it"

Documentation on development environment setup: https://github.com/dubreuia/intellij-plugin-save-actions#contributing

from intellij-plugin-save-actions.

bobvandevijver avatar bobvandevijver commented on May 28, 2024

It seems that the plugin is doing it's job in Rider as you should expect, as it calls the run method of com.intellij.codeInsight.actions.ReformatCodeProcessor. The call itself simply doesn't do the formatting (it doesn't throw anything either), and I do not see anything weird during it's execution, so I'm stuck 😞

from intellij-plugin-save-actions.

bobvandevijver avatar bobvandevijver commented on May 28, 2024

I tried some more with the plugin, and it seems that the whole CodeStyleManager simply doesn't work in Rider. It has probably something to do with the backend connection with ReSharper, which is responsible for the formatting/optimizations.

I can trigger the reformat with the following, ugly hack:

ActionManager.getInstance().getAction("ReformatCode")
    .actionPerformed(new AnActionEvent(null, DataManager.getInstance().getDataContext(),
        ActionPlaces.UNKNOWN, new Presentation(), ActionManager.getInstance(), 0));

This triggers the following logging in the frontend, which is the same when triggered from the menu/shortcut:

23:05:45.647 | INFO  | RiderActionOverride            | Executing ReSharper action 'RiderReformatCode'
23:05:45.647 | INFO  | RiderActionHandlers            | >> Begin backend 'RiderReformatCode' action session
23:05:45.649 | INFO  | RiderActionHandlers            | << End backend 'RiderReformatCode' action session

It does not play nice with any other action being executed simultaneously (such as "OptimizeImports"), so it is in no way an suitable solution.

So, it looks like the ReSharper action is simply not triggered/created when the CodeStyleManager is used. Do we really need to create a ReSharper plugin, which communicates with the frontend? (see https://www.jetbrains.com/help/resharper/sdk/Products/Rider.html). I cannot find really relevant documentation on this issue.

There are also some other issues when compiling the plugin with the Rider SDK, mostly missing classes, so I'm not sure if it's even possible to compile the current plugin for Rider. See bobvandevijver@0a1d0af for the classes I needed to remove in order to being able to build for Rider.

Edit: I also created a ticket at JetBrains: https://youtrack.jetbrains.com/issue/RIDER-20225

(btw, if you want to open an another issue for this discussion just let me know)

from intellij-plugin-save-actions.

van800 avatar van800 commented on May 28, 2024

@bobvandevijver
I guess it should be something like:
val actionId = ActionManager.getInstance().getAction(IdeActions.ACTION_EDITOR_REFORMAT)

var component  =  project.getComponent<EditorImpl>().component
var dataContext = DataManager.getInstance().getDataContext(component)
fun executeAction(actionId: String, dataContext: DataContext) {
    frameworkLogger.info("Execute action: '$actionId'")
    val actionManager = ActionManagerEx.getInstanceEx()
    val action = actionManager.getAction(actionId)
    //requireNotNull(action) { "action is null" }

    val event = AnActionEvent.createFromAnAction(action, null, "", dataContext)
    action.beforeActionPerformedUpdate(event)

    //require(event.presentation.isEnabled) { "presentation.isEnabled is false for $actionId" }

    actionManager.fireBeforeActionPerformed(action, event.dataContext, event)
    action.actionPerformed(event)
    actionManager.fireAfterActionPerformed(action, event.dataContext, event)
}

I will ask colleagues about calling reformat and OptimizeImports simultaneously.
I assume you are calling OptimizeImports with similar code above.
Surprisingly "OptimizeImports" is not listed in IdeActions, so just hardcode it.

from intellij-plugin-save-actions.

bobvandevijver avatar bobvandevijver commented on May 28, 2024

Yes, I used the same structure for "OptimizeImports".

I just used your examples (needed to retrieve the editor component with JComponent component = FileEditorManager.getInstance(myProject).getSelectedTextEditor().getComponent(); though), the result is the same: only one action is executed, which is the once that is called later.

Another thing noteworthy is the fact that your example triggers the save action handlers twice, while the version I posted earlier didn't... not sure what causes that though.

Another question I have with this solution: it probably doesn't support VCS changed code either... I really hope that JetBrains will just implement the CodeStyleManager in Rider 😅

from intellij-plugin-save-actions.

van800 avatar van800 commented on May 28, 2024

@bobvandevijver I have asked about multiple commands but no workaround for now.
Not sure, what do you mean about vcs changed code. If you want to reformat everything in solution, you need to put solutionNode of SolutionExplorer to context like:

        val viewPane = SolutionExplorerViewPane.getInstance(project)
        val solutionNode = viewPane.model.root.children.filterIsInstance<SolutionExplorerModelNode>().single()

        val contextData = mapOf(
            Pair(PlatformDataKeys.SELECTED_ITEM.name, solutionNode),
            Pair(PlatformDataKeys.PROJECT.name, project),
            Pair(ProjectModelDataKeys.SOLUTION_VIEW.name, viewPane))

        var dataContext= SimpleDataContext.getSimpleContext(contextData, null)

from intellij-plugin-save-actions.

dubreuia avatar dubreuia commented on May 28, 2024

@van800 @bobvandevijver If you have an almost-working solution (or various possible solutions), could you post a PR with "WIP" prefix so we keep that code somewhere.

Also I'm creating an issue for Rider (see #198)

from intellij-plugin-save-actions.

hwangjr avatar hwangjr commented on May 28, 2024

Any plan to support GoLand IDE? It would be awesome to support GoLand IDE.

from intellij-plugin-save-actions.

dubreuia avatar dubreuia commented on May 28, 2024

Hey @hwangjr, would you mind downloading the latest jar in the release section (https://github.com/dubreuia/intellij-plugin-save-actions/releases/tag/v1.2.0) and test it in GoLang IDE. It might actually work. Can you report back on that? Thanks.

  • IntelliJ IDEA (OK)
  • PhpStorm (OK)
  • PyCharm (OK)
  • AndroidStudio (OK)
  • WebStorm (OK)
  • RubyMine (OK)
  • Rider (settings OK - reformat KO)
  • AppCode (todo)
  • CLion (todo)
  • DataGrip (todo)
  • GoLand IDE (todo)

from intellij-plugin-save-actions.

hwangjr avatar hwangjr commented on May 28, 2024

@dubreuia yes, it works. Can you add to jetbrains plugin center? we can download from repositories directly.

from intellij-plugin-save-actions.

dubreuia avatar dubreuia commented on May 28, 2024

Ok @hwangjr I've added GoLand IDE to the list of compatible IDEs. You should uninstall the local plugin and reinstall it from the plugin repository so you get updates. Thanks!

  • IntelliJ IDEA (OK)
  • PhpStorm (OK)
  • PyCharm (OK)
  • AndroidStudio (OK)
  • WebStorm (OK)
  • RubyMine (OK)
  • GoLand IDE (OK)
  • Rider (settings OK - reformat KO)
  • AppCode (todo)
  • CLion (todo)
  • DataGrip (todo)

from intellij-plugin-save-actions.

hwangjr avatar hwangjr commented on May 28, 2024

OK, Thanks.

from intellij-plugin-save-actions.

denys-meloshyn avatar denys-meloshyn commented on May 28, 2024

is it possible to vote for AppCode? 😄 I would be also happy to test it

from intellij-plugin-save-actions.

hwangjr avatar hwangjr commented on May 28, 2024

is it possible to vote for AppCode? 😄 I would be also happy to test it

you can test it then tell @dubreuia the test result.

from intellij-plugin-save-actions.

denys-meloshyn avatar denys-meloshyn commented on May 28, 2024

Found that some options are not available, I especially miss "No action if compile errors".
Screenshot 2019-05-16 at 10 36 49

from intellij-plugin-save-actions.

bobvandevijver avatar bobvandevijver commented on May 28, 2024

@bbakermmc I've created a plugin which "works" (is sometimes errors, only has the basic capabilities), which you can find here: https://github.com/dubreuia/intellij-plugin-save-actions/files/2449110/Save.Actions-0.0.1.zip. See #198 for more information.

from intellij-plugin-save-actions.

keyvchan avatar keyvchan commented on May 28, 2024

Any update?

from intellij-plugin-save-actions.

dubreuia avatar dubreuia commented on May 28, 2024

Hello @keyvchan ! I don't have time to work on this, but PRs are welcomed. Which product do you use?

from intellij-plugin-save-actions.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.