IntelliJ lets you complete code statements in several different ways.
- Infix notation.
- To create a loop that goes over each variable, try typing the variable name, a .fori. It should expand into a for loop that creates an index.
- To create a loop that creates a foreach, type the variable name and then a .for. It will expand into a foreach loop.
- Live templates. Look at Settings -> Live templates.
- With these, you can ifn or ifnn and a tab to get if null or if not null constructs.
- You can also construct your own.
- I added a logging category and set logdecl to private final org.slf4j.Logger log = org.slf4j.LoggerFactory.
getLogger(this.getClass());, as I had done before, in Eclipse. - You can also add variables. I set logstart to be log.info("Entering $METHOD$.");. Then I pressed the Edit Variable button and told it that the expression to use was a predefined methodName().
No comments:
Post a Comment