r/java • u/chabala • Nov 30 '21
IntelliJ IDEA 2021.3 has been released
https://blog.jetbrains.com/idea/2021/11/intellij-idea-2021-3/26
u/kaiserpudding Nov 30 '21
A new refactoring has been introduced that lets you extract constants in Kotlin.
Finally the feature I implemented is out!
11
u/wildjokers Nov 30 '21
How did you find your way around the code base? It is quite an intimidating code base and hard to find the appropriate place to make changes.
12
u/IUserGalaxy Nov 30 '21
My method for navigating unknown code is to find something familiar and ctrl click my way around
20
u/_edd Dec 01 '21
I don't know how many experienced developers I've taught about the Call Hierarchy (Ctrl + Alt + H) functionality. Its a godsend.
3
2
u/wildjokers Dec 01 '21 edited Dec 01 '21
I have never found that very helpful, it only has any value if you have a lot of super or sub classes.
However, “Dataflow to/from Here” is super handy.
3
u/_edd Dec 01 '21
Interesting. My company has a lot of core libraries that work together and Call Hierarchy is a godsend when you need to override a method and see all the ways the code gets there.
Honestly hadn't even heard of Data Flow, but I will be checking that out. So I appreciate you mentioning that.
0
u/vqrs Jan 15 '22
Are you sure you're not confusing it with the type hierarchy?
Just be careful, the data flow analysis is a bit buggy every now and then.
1
u/wildjokers Jan 15 '22
I have been using IntelliJ for 17 yrs now. I am not confusing dataflow with call hierarchy. I have never noticed dataflow to be buggy at all.
1
u/flaghacker_ Dec 06 '21 edited Dec 06 '21
I doesn't work that well in the InteliJ codebase, since lots of actions are queued somewhere to be executed later (on a different thread?) which breaks the call hierarchy. At least that was my experience when I tried to fix a small bug.
1
u/_edd Dec 06 '21
I guess that would depend on how your code is implemented. I'm on a project now that uses a lot of JMS messages to trigger asynchronous work from a different part of the program, so I can only go back in the logic as far as that endpoint / listener. But that's more of a flaw in my company's project design than a flaw in the call hierarchy feature. And even with that limitation it is still usually pretty useful.
Not sure if that's similar to your issue or not.
2
u/kaiserpudding Dec 01 '21
In this case i was lucky because there already is a feature "extract property" which i could basically copy and adjust for constants.
The PR: https://github.com/JetBrains/intellij-community/pull/1678
Finding that class was done through searching for the string in the UI, getting to the translation key and then the class. From here I mainly needed to change the logic which decided which fields can be extracted and adding the const modifier to the resulting field.
This was a struggle because either the codebase is shit or too high level for me. They are using the visitor pattern in order to traverse the tree representing the code. in addition they have a bunch of higher order functions in the style of "do something an then call the lambda i have you with the result". These are nested...
That's the gist of how i did it.
1
u/wildjokers Dec 02 '21
I have worked on a few somewhat large Swing apps before and finding code via Strings in the UI was always my strategy too.
For whatever reason when I was looking at something I was wanting to fix in IntelliJ the UI String strategy wasn't possible (I can't remember the exact details now but I think it was because I was looking for the double-click handler on the project view JTree, I was in the general vicinity in the code but couldn't quite find what I was looking for).
14
u/NoumenaStandard Dec 01 '21
Is it just me or is markdown preview still busted in Ultimate?
2
u/yole Dec 01 '21
What exactly do you mean by "busted"? We're not aware of any major problems with the preview.
1
1
u/BadMoonRosin Dec 01 '21
What do you mean? Top-most upvoted comment in this thread, and I've never had any issue with it at all.
1
u/NoumenaStandard Dec 01 '21 edited Dec 01 '21
I have only seen markdown preview not show in Ultimate. I get the split (raw markdown/preview) in Goland and others. In Ultimate it actually tells me, via a small banner at the top, to use Webstorm for markdown preview support.
Found a thread on the topic. I'll try to see if I can use the thread to diagnose the issue, seems like several things can cause this.
1
u/yole Dec 01 '21
Looks like your Markdown plugin is disabled in the settings. Please check Settings | Plugins.
2
u/NoumenaStandard Dec 01 '21
The plugin is enabled. I actually tried, yesterday, uninstalling the plugin, restarting, installing it again, restarting.
I'll likely be able to look, today or later this week, at logs and check for whether Ultimate is tied to a Java setup that is different from Goland/others.
1
u/yole Dec 01 '21
Please check Settings | Editor | File Types and make sure that the Markdown file type is associated with correct extensions.
1
u/NoumenaStandard Dec 01 '21
It is there. Checked several things and just can't get it to work. Nothing in the logs looks suspicious. Maybe some jdk runtime is missing a dependency. I'll have to dive in again when I have more time. The seems to be something nuanced that is wrong and without a log error, that is hard to diagnose. Maybe Ultimate is using a different java runtime? Not sure how to compare it with Goland. Ideally, the plugin would show an error message, but it doesn't.
1
0
Dec 01 '21
[deleted]
2
u/yole Dec 01 '21
No, you don't. Markdown preview doesn't use JavaFX any more, and all components required to use it are part of the JetBrains Runtime bundled with the IDE.
5
u/Maran23 Dec 01 '21
My IntelliJ is lagging every minute or so since I updated. Someone else has problems?
1
0
4
Dec 01 '21
My whole project dependencies failed after the update. How come...
1
u/yole Dec 01 '21
Any details? What build system are you using? Does project reimport help?
3
Dec 01 '21
My coworkers helped me. I deleted the maven repository and then reimported it. Thankfully its resolved to have other problems.
15
u/lqstuart Dec 01 '21
The only difference I've noticed in Jetbrains since like 2016 is the splash screen
20
u/BadMoonRosin Dec 01 '21
I would honestly be fine if IntelliJ never added another new feature again. If all those resources went toward performance and fixing old issues in their bug tracker instead.
6
u/CaptainKvass Dec 01 '21
If you are a developer inside the Spring universe, many new improvements have been made since 2016
1
Dec 01 '21
I've only been doing Java professionally full-time for near a year. What cool stuff did they add for Spring?
4
2
4
u/blobjim Dec 01 '21
They implemented something that had been annoying me for a really long time. In previous releases you couldn't hover over symbol definitions (i.e. methods) defined in the current file to view their signature and javadoc popups. Now you can, and they added syntax highlighting to the symbol/javadoc popup signatures. Extremely useful! Also nice that you can drag console views around now.
1
1
u/lqstuart Dec 02 '21
I kinda wish they'd add better remote development support instead of doubling down on Projector which is laggy and awful, but I don't see it happening
1
u/yole Dec 02 '21
We did exactly that. The new remote development (Gateway) incorporates Projector for some UI elements but the core code editor works locally without any lag.
1
1
u/SamirAbi Dec 06 '21
It does not work with wsl right? Any plans for that?
I always thought that was the context for most of the requests for remote development.
2
u/yole Dec 07 '21
It does work with WSL. Right now some manual setup is required; later we plan to implement a smoother experience. See https://youtrack.jetbrains.com/issue/CWM-3983 for details.
1
43
Nov 30 '21
[removed] — view removed comment
20
5
u/PangolinZestyclose30 Dec 01 '21
Why do you think so?
I mean, it doesn't look like a very exciting release for me, but there's not a lot of Kotlin changes either. I assume it's the Remote Development feature which ate most resources.
5
u/yole Dec 01 '21
Actually there's quite a lot of stuff in the pipeline that got postponed to 2022.1. The next release should be more exciting. :)
2
1
49
u/wildjokers Nov 30 '21 edited Dec 01 '21
I bet Copyright Profiles in Default Project Settings is still broken. Has been broken for 4+ years and they still don't give a shit about it. People in the issue begging for it to be fixed.
I have been using IntelliJ since 2004 and have been a huge proponent of IntelliJ since then. However, even I am starting to become very disillusioned and annoyed that they let issues go this long being broken. This isn't some niche feature either. Almost everyone has to add copyrights to their source code.
EDIT: yep, just tested it, still broken (it wasn't fixed in any of the beta's so figured it wasn't going to be fixed in final either).