Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PhpStorm $SELECTION$ in live template does not work

I watched this video:

https://www.youtube.com/watch?v=8LXJfYvq8z8

and tried to make a live template for try catch block.

try {
    $SELECTION$
} catch ($TYPE$ $$$VARIABLENAME$) {
    $END$
}

Now I select a code which I want to be surrounded and choose this template. I get:

try {

        } catch ( $) {

            }

No selected code in try block. What is wrong? Version is 2016.3.2, build on December 20, 2016

Is it a bug or I am doing something wrong?

like image 897
Dariux Avatar asked Jun 19 '26 09:06

Dariux


1 Answers

Found an answer while watching another video: https://www.youtube.com/watch?v=h5p90FvJo0Y

It turns out that I have to not only select text, but also use different shortcut.

By default it is ctrl + alt + J. I was using ctrl + J so thats why it did not work.

like image 91
Dariux Avatar answered Jun 23 '26 10:06

Dariux



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!