live templates - code snippet and imports

Hello All,

is it possible to have a live template that would do two things at once:
a) generate a fragment of code
b) add imports (on top of the class file) to classe that are used by code snippet from a)
??

The use-case is to have a live template for TestNG @DataProvider that would generate the skeleton of data provider method and add a import to org.testng.annotations.DataProvider.

--
Cheers,
Tomek Kaczanowski

2 comments

Hello Tomek,

Yes. You need to use the fully-qualified name of the class in the live template
text and enable the "Shorten qualified names" option in the live template
settings.

is it possible to have a live template that would do two things at
once:
a) generate a fragment of code
b) add imports (on top of the class file) to classe that are used by
code snippet from a)
??
The use-case is to have a live template for TestNG @DataProvider that
would generate the skeleton of data provider method and add a import
to org.testng.annotations.DataProvider.


--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

Thank you Dmitry, that was exactly what I needed!

--
Cheers,
Tomek Kaczanowski

0

Please sign in to leave a comment.