Google-guava checkNotNull and IntelliJ IDEA’s “may produce java.lang.NullPointerException”

Through a combination of @Contract annotations and the External Annotations feature, you can now annotate Preconditions methods such that IntelliJ applies the correct static analysis to calls to these methods. Let’s say we have this example public void doSomething(Object someArg) { Preconditions.checkArgument(someArg != null); someArg.doSomethingElse(); //currently gives NPE warning if (someArg != null) { //no … Read more

Move file from one editor window to another (split mode)

Goto File->Settings Then Keymap Type in the searchbox “Move To Opposite Group” Assign a shortcut Also useful is “Goto Next Splitter” which allows you to switch between your Splitter. But you’ll hardly find a shortcut which is not already occupied. I used Ctrl + NumPad+ for “Move To Opposite Group” and Ctrl + ArrowRight for … Read more

Intellij IdeaVim change keys

As of IdeaVim 0.35 (released 2014-05-15), key mappings in ~/.ideavimrc are supported. You can put source ~/.vimrc in that file if you want to include mappings from ~/.vimrc. Release announcement VIM-288 (Note: This question could probably be considered a duplicate of this other StackOverflow question.)

How to provide standard library sources for IntelliJ IDEA’s Rust project?

As commented, the supported approach is to use rustup: Navigate to https://rustup.rs/ and follow the installation instructions for your platform. Add the rust-src component by running: rustup component add rust-src Create a new Rust project in IntelliJ and choose your existing Rust project source. If the folder already contains previous IntelliJ project files, you may … Read more

Attaching Gradle sources in IntelliJ IDEA

To improve on @anon58192932 answer you can use only gradleVersion and distributionType fields of Wrapper task and don’t need to manually create distributionUrl which is more error prone since you could change gradle version in one place, but not in the other. task wrapper(type: Wrapper) { gradleVersion = ‘4.2’ distributionType = Wrapper.DistributionType.ALL } @edit gradle … Read more

How to create named code blocks in Intellij?

They have implemented region-support now! From http://youtrack.jetbrains.com/issue/IDEA-80636 Currently Intellij IDEA supports two basic types of custom folding comments: NetBeans-like: //<editor-fold desc=”…”> … code … //</editor-fold> And VisualStudio-like: //region <…> … code … //endregion Note that line commenting symbols for “region…endregion” can be changed from “//” to “#” if the ‘#’ character is supported by a … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)