IntelliJ Live Templates error with completeSmart () function

I'm trying to create a Live-Template in Android Studio, which will speed up the creation somewhat findViewById(...)

Some of this is self-learning, and some are curious about creating such lively patterns.

I want to be able to enter the following ...

Button find + (enter)

... and this should create something like this ...

Button btnAdd = (Button) findViewById(R.id.btnAddition);


My current implementation has problems ...

enter image description hereenter image description here

... and these problems are related to use completeSmart(). Whenever you use completeSmart(), the template ignores everything after this call and finishes editing.

, CAST named-variable ( ID), , ID . , , btnAddition. ...findViewById(R.id.);

CAST , ; completeSmart() ( $END$ - 29 ), .

, ... enter image description here

... . , . ?


, ...

1) , Button, , Button. !

+4
1

typeOfVariable()

:

foo

0

Source: https://habr.com/ru/post/1547041/


All Articles