Creating new live-templates with import statements in IntelliJ IDEA

前端 未结 4 918
广开言路
广开言路 2021-02-02 06:06

Here is the Eclipse template that I want to port:

${:import(org.apache.log4j.Logger)}
private static final Logger LOG = Logger.getLogger(${enclosing_type}.class)         


        
4条回答
  •  隐瞒了意图╮
    2021-02-02 06:10

    Now its possible to add live templates with static imports:

    You have to check static import in Options

    @org.junit.Test
    public void should$EXPR$when$CONDITION$() {
        org.junit.Assert.assertThat(null, org.hamcrest.CoreMatchers.is(org.hamcrest.CoreMatchers.nullValue())); 
    }
    

提交回复
热议问题