Anybody know why IntelliJ Idea Ultimate doesn't like Ruby hash literals in the newer syntax? Refer to the red underlines in my screenshot from the IDE below. Syntax:
{key1: "value", key2: 123}
Really annoying as it means my entire project has a red underline all the way up the directory tree.
I have setup a Ruby SDK version greater than 1.9 (which is when i think the new hash literal syntax was introduced) in the IDE preferences, so there is no excuse!
Thanks.
How I fixed this in Intellij 14.1:
Previously I tried just changing the project SDK from the default of Java to Ruby, but this didn't fix the issue.
Under OSX IntelliJ 14 I was able to fix this by closing the project and reopening it.
In fairness, I did try setting the project's "language level", but it only shows Java SDKs, which shouldn't affect my main Ruby module.
This seems to be a bug in the Ruby plugin: http://devnet.jetbrains.com/thread/457333
Anyone who doesn't feel like changing his code base, the following steps resolved the issue for me:
IntelliJ now asks if you would like to reload your project. After doing so the "new" Hash Syntax is considered correct...
Edit: It doesn't really matter what you select as language level as it is only relevant for Java code, but apparently this triggers something in the code parser...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With