When I submit a patchset for review, I don’t shut down and wait for the requisite shipits to roll in – I move on to the next item on my backlog. Unfortunately, I’ll probably need to go back to the files in that patchset and act on my peers’ feedback, which means I’ll have to clean up my workspace and reopen the files I had earlier. I’ll want to have my editor split, with the code on one side and the tests on the other, and when I’m done addressing the feedback, I’ll have to clean up again, start the other task’s work again, and cross my fingers that I don’t have revisit that original patchset.
Switching between tasks is taxing, but lucky for us, IntelliJ has Task Management built in. Here’s how you set it up, get started, and make your life easier.
- Hit cmd-shift-A and type in “Configure Servers”. There are multiple “Configure Servers” actions, so select the “Tasks & Contexts” one.
- Hit the + icon and select the issue tracking server where your bugs live. For this example, I’ll use a project on my personal GitHub account, but as shown below, all the major issue tracking systems are supported (I usually use my work’s JIRA instance)
- Enter your repo credentials and details, test it out, then hit OK.
- Now the fun starts. Hit option-shift-t, and the task switcher window will appear. Make sure “Open Task” is selected, and hit Return.
- Voila! All the open issues from your GitHub project will appear. Select the bug you want to work on and hit Return.
- You’ll get a few options on how to set up your workspace. I like to start each branch with a clean slate, so I select “Clear current context”, but uncheck it if you’d prefer to keep your current files open. With the “VCS Operations” checkboxes, you can switch to a new or existing branch for your code.
- Hit “OK” and do your work as normal. If you selected “Clear current context”, all the files that were previously open will be closed.
From now on, whenever you switch tickets, make sure to do “Open Task” from step 4. When you switch back to a ticket you worked on previously, IntelliJ will reopen the files that were open last time the ticket was active. They’ll be right where you left them – it’ll even remember if you had multiple panes open. No more tedious cleanup and setup!
This approach has made context-switching between tasks almost painless for me, and as a result of adopting it I have considerably increased my productivity. If you can relate to the frustration in the first paragraph, I highly recommend you try out the IntelliJ task management functionality. Enjoy!