Is possible in IntelliJ to automatically update javadoc? For example, when I add new method params or throw new exceptions I want them to appear in the existing javadoc comment.
In IntelliJ 2019.2.4 you can open File/Settings/Keymap/Other then look for Fix doc comment and assign a shortcut to it.
This doesn't get at what you want, but may help others when SO search leads them here. The JavaDoc plugin generates javadoc where non exists. It's a bit dated (intellij 2020.1) and sometimes doesn't work in 2022.1 When it does work -- it's FANTASTIC!
Related
I am following the Atomic Kotlin course. I have understood the concept and my output is correct, however Intellij IDEA complains that the outputs are different. Even when I copy and paste from the answer. Please see screenshot.
I have tried using the print() method instead of println(), but it didn't help.
Go to Settings->Editor->General and uncheck the Ensure an empty line.. property.
see the following screenshot:
There is a straightforward workaround on how one can avoid this problem. Changing the AtomicKotlin/Programming Basics/Data Types/Exercise 2/test/output.txt manually to add a new line at the end of the text should fix the test.I've also found a YouTrack ticket with the problem description. According to it, EduTools 4.2 version release should fix it. Maybe it worth to upvote or comment on the ticket.
I'm looking for a way to delete an added JavaDoc tag.
The only solution on StackOverflow was from 2010 and did not help me because Intellij has updated and the menu settings are no longer the same.
If anyone could tell me how to remove it, that would be great.
Edit: This was the question from '10.
Edit 2: When you add a JavaDoc tag, and Intellij doesn't detect it as a valid tag, you can right click to add it to your saved JavaDoc tags.
I am looking for a way to remove my saved tags.
The answer from the linked issue is still valid, only the path to that settings has changed slightly.
Anyway, it is easiest if you just use the provided search: Use "File -> Settings", then type "javadoc problems" in the search field in the upper left.
You will then easily find "Editor -> Inspections", with the inspection "Java -> Javadoc issues -> Declaration has Javadoc problems" at the right.
In Eclipse it is possible to show the active shortcuts with CTRL+Shift+L.
List of shortcuts (depending on the context):
Is there something similar in IntelliJ?
No, there is no such feature in IntelliJ IDEA. It could be implemented as a plugin, but as far as I'm aware such a plugin does not exist.
You may install this intellij plugin :
https://plugins.jetbrains.com/plugin/?id=2391
Actually the best solution for me was Ctrl+Shift+A. Then just type the desired action and you will see the shortcut or you can execute the action.
Example (call hierarchy):
For a while now, newer versions of Visual Studio have been able to display in-line information for methods, fields etc relating to how many times they may have been referenced or changed and who changed the code last. This feature is known as CodeLens.
Is there any plugin or feature in IntelliJ IDEA similar to this that would be able to display information on an individual class/field/method basis?
(22-Aug-2022 updated) The hints from git blame are also available in the latest IntelliJ IDEA.
==================
(For CodeLens function references feature) Now it's a built-in feature after version IntelliJ IDEA 2020.1.
You can enable it from:
Ref: https://blog.jetbrains.com/idea/2020/03/intellij-idea-2020-1-beta2/
There is no such plugin (yet).
You can of course right click the left gutter (gray editor to the left of the editor) and select "Annotate". That gives you at least the last edit per line.
More similar to your desired feature (but unfortunately not inline):
Select some text (e.g. a method), then right-click Git -> Show History for Selection.
Now there is JetBrains plugin named GitToolBox.
It has some similar functionality, including the current line "blame annotation" at the end of the line with detailed commit information:
This feature is available for Rider, but not for IntelliJ yet.
In Rider it's called Code Vision
You can vote for this feature request in IntelliJ IDEA here
It really annoys me that IntelliJ highlights certain 'errors' (that don't prevent successful compilation) the same way that real errors are highlighted. For example, a magic number is not really an error, but it will be flagged in exactly the same way as an incompatible type error.
How can I change this?
Go to Settings -> Inspections. Then you need to search through the long list for the offending inspection, which you can get the name of by hovering on the warning marker in the margin. You can change the severity of the inspection, whether it's an error, warning, etc. or just disable it altogether.
Edit: if you search for "magic" in Settings, you get the following, which should be helpful:
Whenever you see an inspection warning/error you can place the caret on it and press Alt+Enter (a light bulb also appears that tells you that). A menu will appear with suggested quick fixes. You may need to open a submenu by pressing Right, and you'll find "Edit inspection settings" there. Having invoked that, you may proceed as in hvgotcodes's answer :), it's just a faster way of getting to those settings.
As Michael Calvin said you can use the SuppressWarnings annotation. For example:
#SuppressWarnings("OptionalUsedAsFieldOrParameterType")
See https://github.com/JetBrains/intellij-community/blob/master/plugins/InspectionGadgets/src/inspectionDescriptions/OptionalUsedAsFieldOrParameterType.html
Usually searching the internet for the exact description leads me to this.
Not directly relevant to the OP, but may be of use to future Googlers
I got to this question while trying to figure out how to disable IntelliJ IDEA's warnings about Guava functionalities that have been replaced by Java 8 features. I'm not able to use the Java 8 versions of these features in my case because of a library we're using that was built with Guava (despite being a Java 8 project). So to solve that, I added a SuppressWarnings annotation before any class using Guava:
#SuppressWarnings(Guava)
public final class...