简体   繁体   中英

I created scala a live template, but it doesn't seem to work

I'm confused why my live template is not working.

I clicked on the + sign and created a new live template for Scala.

Abbreviation:  slick-update
Template text:
$table$.filter(_.id === $model$.id).update($model$).flatMap(whenSucceeded($model$))

I clicked ok.

Now in my .scala file, if I type cmd-j or I type 'scala-update' I do not see my new live template name appear anywhere.

Why isn't it working? Do I have to restart?

You don't have to restart.

When creating a live template, IDEA warns you that you need to define contexts that template can be used in.

Below the Template text field, click Define , then select

Scala > Code

and save the changes.

That should make your template work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM