Ability to force save on a file

Issue #122 resolved
Zoran Žunko created an issue

If a file is opened but no edits are made, save can't be triggered. Enter needs to be pressed and the file saved then.

I'm raising this as an error since latest build takes very long time to deploy a file if it has any errors and the IDE needs to be restarted top break the loop. Once opened again i need to make a dummy edit in order to take the roundtrip to sfdc.

Comments (8)

  1. Scott Wells repo owner

    You know, it's funny that you opened this. I was working on exactly this last week as these "dummy edits" are quite annoying. Unfortunately I can't really hook a force save into the standard Save functionality in IntelliJ IDEA. IDEA really wants to manage when files are saved into the file system and there's no way to determine whether a save event was due to an explicit user action or one of many implicit operations in IDEA. What I'm likely going to have to do is add a new action for Force Save that uses a different key binding such as CTRL+SHIFT+S.

    Regarding your comment "since latest build takes a very long time to deploy a file", have you activated conflict detection? If not, it should be the exact same code path as before the latest build with no additional server calls required. Please let know if you're seeing a performance regression in deploy-on-save without conflict detection enabled. I'll need to look into that.

    Thanks!

  2. Scott Wells repo owner

    This will be in the next release. I've added a new action, Force Save, that is by default bound to CTRL+ALT+SHIFT+F12 but can be safely bound to CTRL+S/CMD+S as an extension to IDEA's default "Save All" behavior. It first performs a Save All and then force deploys the current editor's file (if it's an Illuminated Cloud file) if it wasn't automatically-deployed by "Save All".

  3. Zoran Žunko reporter

    " Regarding your comment "since latest build takes a very long time to deploy a file", have you activated conflict detection? If not, it should be the exact same code path as before the latest build with no additional server calls required. Please let know if you're seeing a performance regression in deploy-on-save without conflict detection enabled. I'll need to look into that. "

    I think i was experimenting with that setting... It was just one of many "odd" things when trying to have two separate modules eg. one for dev and one for deployment in the same project (with or without separate connections).

  4. Scott Wells repo owner

    Gotcha. Yeah, I'm going to release a new build today that has selective deployment. Next will be selective retrieval. After that I'll be tackling deployment to another connection which should resolve that oddity by having it as a first-class feature.

  5. Scott Wells repo owner

    Delivered in 1.6.1.0. As noted above, default binding is CTRL+ALT+SHIFT+F12 but can be safely bound to CTRL+S/CMD+S as an augmented form of the default "Save All" action.

  6. Vivek M. Chawla

    @RoseSilverSoftware It looks like "Force Save" will not deploy a metadata file if the "save" action setting for that metadata type (eg. Apex) is not set to something like "Deploy with Tooling API" or "Deploy with Metadata API".

    This is unfortunate, because what I would really, really like is something akin to the Force.com IDE's "offline mode".

    The most common development pattern I've seen over the last four years is multiple developers working in the same sandbox. Overwriting other developer's code is painfully commonplace. For that reason, almost everyone works "offline", and pushing code to the org is done with real intent (ie. a little more than a casual CMD+S keystroke).

    At the same time, you need to be sure that you're saving your files locally in case your editor / computer / whatever crashes. Not only that, you may be taking local "snapshots" in a local VCS as you develop (even when you haven't deployed those changes yet). Once you're "sure" you want to deploy, you explicitly invoke "Save to Server". It's worth noting this command is completely unambiguous as to it's purpose.

    I think it's important to offer similar functionality in IC.

    The easiest way to do this could be to piggyback on the "Force Save" concept. (see screenshot)

    2015-12-19_06-29-18.png

    It's funny...IDEA as an IDE gives an incredible amount of control over how we interact with the IDE. It's an awesome feeling.

    On the other hand, the deployment and retrieval of metadata in IC feels...strange. I very rarely feel like I have a say in what IC may (or may not) actually do when it comes to pushing / pulling metadata.

    I know a lot of these "deploy and retrieve" requests may seem inconsequential, but I think they all go a long way towards making IC "feel" better...especially for those of us who are migrating from Eclipse, which is likely going to be your biggest market.

    Thanks, Vivek

  7. Scott Wells repo owner

    Thanks for the feedback, Vivek. I had another user hit this just the other day, and it's not working as intended. I expect force save to work even if you've disabled On Save behavior here. I'll look at the most straightforward way to do this.

    As for the more general feedback on deployment and retrieval, I have some improvements in the works right now that should address that. I definitely don't think these comments/requests are at all inconsequential because the fundamental difference between Force.com development and other development is the need for deployment and retrieval vs. just compiling/interpreting locally. The more you can make that fade into the background, the better the user experience. Getting to that goal of making deployment and retrieval simple and intuitive (if not transparent) is very important to me.

  8. Log in to comment