How do I make a custom autocomplete suggestion in IntelliJ?

Jack :

I want to make add a suggestion to intellij’s autocomplete to object names. Currently when autocompleting a name of a instance of a class it just autocompletes to the class name but in lower case.

ExampleObject exampleObject;

This has sometimes causes bugs that take some time to track down. I found this other naming convention that often should work better. Just by adding ‘a’ infront of the class name, it often is much clearer which is the object and which is the class. E.g

ExampleObject aExampleObject;

I’ve looked through the settings a bit but couldn’t quite find the setting to do this. It’s something small, but i think it will be a “nice to have”. Any help on this would be nice.

Thanks.

Olga Klisho :

You may define prefixes and suffixes of fields, local variables etc in Preferences | Editor | Code Style | Java | Code Generation pane: enter image description here

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=385152&siteId=1