Skip to main content

Intelligently using IntelliJ

Overview

IntelliJ is the IDE that we recommend for robot programming on YETI. This page will go over how to use IntelliJ to effectively and efficiently.

Fuzzy Find

Fuzzy Find in IntelliJ lets you quickly find files, classes, or symbols. It guesses what you are looking for by keywords or parts of words to find what you are looking for. This can make coding faster because you don't have to spend time browsing files for something you want.

You can use fuzzy find in IntelliJ by double-clicking the Shift key. When you do this, the following search bar will pop up:

image.png

Then just type a keyword or part of the item you are looking for and IntelliJ will find it for you.

Gradle Stuff

You can access this Gradle tasks menu by hitting the (tootin') elephant on the top-right side of your screen:

image.png

The ones you'll likely use the most are listed below:

  • build: This is under the build dropdown in the menu. This compiles the code.
  • deploy: This is under the deployutils dropdown in the menu. This deploys the code to the roboRIO.
  • spotlessCheck: This is under the verification dropdown in the menu. This checks to see if the code is formatted correctly.
  • spotlessApply: This is under the verification dropdown in the menu. This automatically fixes all formatting errors in the code.

The Gradle refresh lets you refresh your project to sync up any changes to your Gradle config settings. You can do this by hitting this button in the top-left corner of your Gradle menu:

image.png

Renaming Things

When you're renaming symbols, make sure you don't make the fatal (and suuuuuper goofy) mistake of only renaming one instance. This will lead to problems that can only be solved by throwing a magic ring into a volcano. Instead, right-click whatever you want to rename and hit Refactor. Then, hit Rename and type whatever you want the symbol to be renamed to. This will rename all instances of the symbol and ensure that you don't have to go on a whimsical adventure involving a cool archer elf. Below is the menu you will need to use:

image.png

Ctrl-Click

One of the most powerful tools IntelliJ will bestow upon you is the Ctrl-click. If you hold Ctrl while clicking on a piece of code, it will take you to its definition and show usages of it. Below is an example:

image.png Before the ctrl-click

image.png While holding Ctrl

image.png It takes you to the definition!

image.png Ctrl-clicking the definition shows the usages!

Now you can Ctrl-click to your heart's content!

 

Coming Soon!

Git Stuff

So you wanna work with other programmers on a project? On YETI, we use Git and GitHub for organizing contributions between programmers. You can access some Git actions from the IntelliJ icons, but some things are easier to do with the terminal. The following list will go over how we do some Git actions that you'll probably use a lot.

  • Pulling
  • Commiting
  • Pushing

Structure