IntelliJ IDEA 2018.1 EAP: Partial Git commits and more

It’s time for our next IntelliJ IDEA 2018.1 EAP build with all its shiny new features. We encourage you to download the new EAP build from our website, or make an update via the Toolbox App.

First of all, the upcoming IntelliJ IDEA 2018.1 supports partial Git commits (git add -p). Starting with this latest EAP, the IDE commits only selected changes from the file and skips all other changes.

You can include code chunks into a commit using the checkboxes in the Diff pane of the Commit Changes dialog.

Additionally, the IDE now provides the ability to associate the code chunks, not the whole file, with a changelist, and track them separately. Code chunks can be quickly moved between changelists using the Move to another changelist action which is available from the context menu of the Diff pane in the Commit Changes dialog.

Alternatively, you can add code chunks to a changelist right from the editor – click on a change marker in the gutter. In the pop-up which appears you can choose from the available changelists or create a new one.

We plan to publish a dedicated blog post about the support for the Git partial commit feature as soon as possible. Stay tuned!

With the upcoming IntelliJ IDEA 2018.1 you can choose how to display your local changes by grouping them according to their: directory, module or repository with the new Group by icon, available in the Local Changes tab in the Version Control Tool Window. Previously the IDE only allowed you to group or ungroup your local changes simultaneously by directory and module. Now you can select one of the grouping options or all three at once if needed. Please note that grouping by the repository will only be available when you have 2 or more roots configured in your project.

Postfix code completion enhancements

The upcoming IntelliJ IDEA 2018.1 has had improvements made to the postfix code completion. The IDE now provides the ability to define the custom postfix Java templates at Preferences | Editor | General | Postfix Completion.

You can now create your own Java templates or edit and rename some of the predefined Java templates.

The IDE now also provides the .arg postfix completion that wraps an object with a method call.

In other news, the Kotlin plugin bundled with the IDE has been updated to v1.2.30-eap-60.

We’re very excited about these new features, and we hope that you’ll find these improvements useful. Give this new build a try and share your feedback with us in our discussion forum, issue tracker or twitter.

Hi, thank you for new features. My only concern is that this is not partial staging support, but hunk staging support. Is it correct to say you can only stage complete hunk, not just specific lines? E.g. in vscode you can stage individual lines, which is very useful.

Checkboxes, ohrly? Guys, I realize you want to show a unified VCS view, but until you really embrace the index and realize that staging and committing are separate actions, this issue will not be solved satisfactorily.

Eclipse had this right several years ago (and coincidentally is the only thing I sorely miss after having switched). I would love to see a proper visual index view in IntelliJ, that would let us stage lines, hunks or whole files and additionally diff either way (workspace/index, index/HEAD) with full editing support, just like Eclipse does. With proper staging support, you would not need third party git clients like GitKraken any more.

IntelliJ should show me files that are changed that are staged and not staged for commit separately. I was actually very surprised that IntelliJ did not do this already (recently went to a new team that uses git)

I usually move files which I don’t want to commit to the separate changelist. This is even better, as with git you essentially have only two changelists (staged/not staged), while in IDEA you may have as many changelists as you want: like staged; not staged; some side bug fix which I postponed, but may stage tomorrow; etc. Are you using many changelists in your everyday work?

Hi, the Rest Based Editor is a cool feature that I think deserves a lot of attention as well, basically I think there are many of us wanting to replace postman with it completely, do you plan on adding more features to it?

To me the REST client is the most exciting addition to IntelliJ in the last two years. I am closely watching it since I know about it and my immediate thought about it was, that it could well replace the dreaded Postman at some time. But I think that it is not quite there yet.

Here’s what’s missing, highly opinionated, of course:

It lacks some essential usability features. I have to select an environment each time I execute a test. A simple dropdown to make my selected environment permanent for my session would be appreciated. Can I define suites? Can I define a “global” section in the environments definition? Key bindings for REST client actions are only partially possible.

Then the REST client is not as highly integrated as other test features. For example, there are no run configurations to share. “Rerun last test” ignores REST client tests completly.

Another thing is continous integration. If we are going to invest in creating a REST client suite, then we need the ability to integrate this suite into our CI. There are many ways to do this, one could be to provide a maven plugin that plays well with the maven report plugin.

Please keep it up. I am looking forward to the day when we can really replace Postman as a development and testing tool.

I would agree that a complete support of git would be better, I recently found myself editing the staged hunk because the added line was incorrect. So I think this would be useful although I don’t know how many would use this advanced staging / index actions.

However “just” un/staging lines, may appeal to many more developers. Please do it

Hello! I believe you guys need to update the bintray kotlin gradle plugin to avoid warnings with this EAP. The latest version in bintray is 1.2.30-eap-47 but it seems that the IDE uses eap-60. Note that the following exists:

The partial commit feature is cool. HOWEVER, when I select one or more specific files from local changes, then right click -> Commit, it now shows the selected files only briefly before selecting every current change regardless. I am constantly accidentally committing many files when I wanted to only commit one or two and having to undo-redo. This is a non-trivial usability regression from IDEA 2017.3.

Reproduction:

1. Have a git repo with files A, B, and C.
2. Modify all three files, see that they appear in the Local Changes list in the Version Control tool window.
3. Select the file A, right click it, and choose Commit…
4. The commit Changes dialog will have all three files selected with all changes included in the commit to be made. Desired behavior: Only the file(s) that were selected will have their changes included in the commit.
5. Cancel the commit, select files A and C, and repeat step 4, observing that once again file B is included in the commit.

> You can include code chunks into a commit using the checkboxes in the Diff pane of the Commit Changes dialog.

Only works in “Side-by-side viewer” Diff mode. Having to switch from convenient “Unified viewer” mode to inconvenient “Side-by-side” just for commit individual lines/hunks is… how to say… against the very idea of IntelliJ IDEA of being convenient, isn’t it?

I just tried 2018.1 and 2018.2 EAP and I don’t see the checkboxes in my gutter for partial hunk commits.. And it’s not in the commit dialog box either. Could someone point me in the right direction? Thanks