IntelliJ shows method parameter hints on usage - How to disable it
Interview Questions practice on Codemia
Over 8,000 real interview questions from top companies, searchable by company and role.
IntelliJ IDEA by JetBrains is a powerful Integrated Development Environment (IDE) used for programming in various languages, including Java, Kotlin, and Scala. One of the helpful features in IntelliJ IDEA is the display of method parameter hints. These hints provide immediate context about the parameters required by a method without looking at the method declaration. However, some developers may find this feature cluttering, especially when working with methods that have self-explanatory parameter names or when the screen space is limited.
Understanding Method Parameter Hints
Method parameter hints are inline annotations that appear next to method arguments, displaying parameter names corresponding to the values being passed. This feature is particularly useful when dealing with methods that have multiple parameters, especially if the parameters are of the same type or have similar names. Here's a practical example:
In the main method above, IntelliJ might display the hints like firstName: "John", lastName: "Doe", age: 31 next to the addPerson method call. These hints ensure that it's clear which argument corresponds to which parameter.
Disabling Method Parameter Hints
Although useful, parameter hints can make the code feel verbose, especially for seasoned developers who know their codebase well. Here’s how to disable this feature in IntelliJ IDEA:
- Accessing the Settings: Open IntelliJ IDEA and navigate to
File > Settingson Windows and Linux, orIntelliJ IDEA > Preferenceson macOS. - Locating Editor Preferences: Within the Settings or Preferences window, go to
Editor > Inlay Hints. - Adjusting Inlay Settings for Language: Select the language for which you'd like to adjust the inlay hints settings, such as Java.
- Disabling Parameter Hints: Uncheck the box corresponding to
Parameter hints. This will disable the method parameter hints across all your projects in IntelliJ. - Apply and Close: Click on the
Applybutton to save your changes and thenOKto close the settings window.
Considerations and Best Practices
While disabling parameter hints might clear up some visual clutter, there are situations where these hints can dramatically improve the readability and maintainability of the code. For instance, with overloaded methods or constructors, parameter hints prevent confusion and reduce bugs.
It’s also possible to selectively enable parameter hints only for specific methods or classes rather than globally turning off the feature. This selective enablement can be configured in the same Inlay Hints menu under the settings for specific file types or methods.
Summary Table
| Feature | Description | How to Access/Modify |
| Method Parameter Hints | Shows names of parameters in method calls | Enabled by default; configurable per language |
| Disable Globally | Turn off parameter hints across all projects | Editor > Inlay Hints > [Language] > Uncheck Parameter hints |
| Selective Disabling | Disable hints for specific methods | Use inline option or configure in settings |
Additional Tips
Remember that these settings can be exported and imported which is beneficial if you work across multiple systems or share your IDE settings with a team. Furthermore, for collaborative projects, consistency in IDE configurations can help in maintaining a uniform code style among all developers.
IntelliJ IDEA’s flexibility in customization ensures that whether you prefer a minimalist code interface or a fully annotated script, adjusting the settings to suit your workflow is straightforward. By taking the time to customize your development environment, you increase both productivity and code quality.
Related reading
- Intermediate layer makes tensorflow optimizer to stop working
- Intermediate layer makes tensorflow optimizer to stop working
- intermittent 502 bad gateway
- Internal error occurred failed calling webhook mservice.elbv2.k8s.aws
- InternalsVisibleTo attribute isn't working
- Interpreting Tensorboard Distributions - Weights not Changing, only Biases
- Introducing FOREIGN KEY constraint may cause cycles or multiple cascade paths - why?
- Invalid Argument Error / Graph Execution Error
.png&w=3840&q=75)
Tackling System Design Interview Problems
A short course that equips you with the skills to approach system design interviews methodically.
Start the free courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
Interview Questions practice on Codemia
Over 8,000 real interview questions from top companies, searchable by company and role.