My live template is not working like expected (R# 5.1)

Hi there,

I've made a more complex variant of the "prop" template, but there's a bug
(I think) preventing me from using it correctly.
I've simplified my problem to the smallest example possible. In my code some
of the variables are being copied and casing is changed using some of the
default r# live template macros.

If I create a new live template containing this code:
$fieldtype$ _$fieldname$;
I haven't changed availability, reformat/shorten qualified references are
still ticked and I haven't chosen any macros for these variables.

Now I get some unexpected behaviour:
1) for some reason, after inserting this template in my code there's
"private" in front of my 2 variables:
private fieldtype fieldname;

2) After inserting the text I end up at the first variable (fieldtype). If I
type any known type (i.e. int, bool, short) and I tab to the next variable,
it won't replace the text of variable fieldname, but it types the text in
front of it. So my code ends up looking like: private int
_numberOfPeoplefieldname; instead of private int _numberOfPeople; There are
2 exceptions in which it'll do what it should:
a) I type an unknown type in my $fieldtype$ variable, like: "private
wtf...". The text turns red, since it's not known within visual studio. If I
tab, I can replace the $fieldname$ variable.
b) I change the order in which the variables are entered. If I start with
the $fieldname$ variable and edit the $fieldtype$ variable afterwards it
works.

For some reason it does work in the prop template, but not in my own live
template!

Is this a bug? Using R# 5.1 (latest version atm) within VS2010 on Vista.

Regards, Ted

3 comments
Comment actions Permalink

Hello Ted,

Could you please export your live template into an xml file (using the Export...
button on Live Templates window toolbar) and attach it here? Thank you!

Andrey Serebryansky
Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

Hi there,

I've made a more complex variant of the "prop" template, but there's a
bug
(I think) preventing me from using it correctly.
I've simplified my problem to the smallest example possible. In my
code some
of the variables are being copied and casing is changed using some of
the
default r# live template macros.
If I create a new live template containing this code:
$fieldtype$ _$fieldname$;
I haven't changed availability, reformat/shorten qualified references
are
still ticked and I haven't chosen any macros for these variables.
Now I get some unexpected behaviour:
1) for some reason, after inserting this template in my code there's
"private" in front of my 2 variables:
private fieldtype fieldname;
2) After inserting the text I end up at the first variable
(fieldtype). If I
type any known type (i.e. int, bool, short) and I tab to the next
variable,
it won't replace the text of variable fieldname, but it types the text
in
front of it. So my code ends up looking like: private int
_numberOfPeoplefieldname; instead of private int _numberOfPeople;
There are
2 exceptions in which it'll do what it should:
a) I type an unknown type in my $fieldtype$ variable, like: "private
wtf...". The text turns red, since it's not known within visual
studio. If I
tab, I can replace the $fieldname$ variable.
b) I change the order in which the variables are entered. If I start
with
the $fieldname$ variable and edit the $fieldtype$ variable afterwards
it
works.
For some reason it does work in the prop template, but not in my own
live template!

Is this a bug? Using R# 5.1 (latest version atm) within VS2010 on
Vista.

Regards, Ted



0
Comment actions Permalink

Hi Andrey,

Sorry for the delay. Here's the template.. I hope I explained the problem
well enough in the previous post.

Regards, Ted


"Andrew Serebryansky" <andrew.serebryansky@jetbrains.com> wrote in message
news:5fe5abdf73d48ccfd65862834ea@news.intellij.net...

Hello Ted,

>

Could you please export your live template into an xml file (using the
Export... button on Live Templates window toolbar) and attach it here?
Thank you!

>

Andrey Serebryansky
Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

>
>> Hi there,
>>
>> I've made a more complex variant of the "prop" template, but there's a
>> bug
>> (I think) preventing me from using it correctly.
>> I've simplified my problem to the smallest example possible. In my
>> code some
>> of the variables are being copied and casing is changed using some of
>> the
>> default r# live template macros.
>> If I create a new live template containing this code:
>> $fieldtype$ _$fieldname$;
>> I haven't changed availability, reformat/shorten qualified references
>> are
>> still ticked and I haven't chosen any macros for these variables.
>> Now I get some unexpected behaviour:
>> 1) for some reason, after inserting this template in my code there's
>> "private" in front of my 2 variables:
>> private fieldtype fieldname;
>> 2) After inserting the text I end up at the first variable
>> (fieldtype). If I
>> type any known type (i.e. int, bool, short) and I tab to the next
>> variable,
>> it won't replace the text of variable fieldname, but it types the text
>> in
>> front of it. So my code ends up looking like: private int
>> _numberOfPeoplefieldname; instead of private int _numberOfPeople;
>> There are
>> 2 exceptions in which it'll do what it should:
>> a) I type an unknown type in my $fieldtype$ variable, like: "private
>> wtf...". The text turns red, since it's not known within visual
>> studio. If I
>> tab, I can replace the $fieldname$ variable.
>> b) I change the order in which the variables are entered. If I start
>> with
>> the $fieldname$ variable and edit the $fieldtype$ variable afterwards
>> it
>> works.
>> For some reason it does work in the prop template, but not in my own
>> live template!
>>
>> Is this a bug? Using R# 5.1 (latest version atm) within VS2010 on
>> Vista.
>>
>> Regards, Ted
>>
>

0
Comment actions Permalink

Hi Andrey,

Have you gotten to it yet? :)

Regards, Ted

"Andrew Serebryansky" <andrew.serebryansky@jetbrains.com> wrote in message
news:5fe5abdf73d48ccfd65862834ea@news.intellij.net...

Hello Ted,

>

Could you please export your live template into an xml file (using the
Export... button on Live Templates window toolbar) and attach it here?
Thank you!

>

Andrey Serebryansky
Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

>
>> Hi there,
>>
>> I've made a more complex variant of the "prop" template, but there's a
>> bug
>> (I think) preventing me from using it correctly.
>> I've simplified my problem to the smallest example possible. In my
>> code some
>> of the variables are being copied and casing is changed using some of
>> the
>> default r# live template macros.
>> If I create a new live template containing this code:
>> $fieldtype$ _$fieldname$;
>> I haven't changed availability, reformat/shorten qualified references
>> are
>> still ticked and I haven't chosen any macros for these variables.
>> Now I get some unexpected behaviour:
>> 1) for some reason, after inserting this template in my code there's
>> "private" in front of my 2 variables:
>> private fieldtype fieldname;
>> 2) After inserting the text I end up at the first variable
>> (fieldtype). If I
>> type any known type (i.e. int, bool, short) and I tab to the next
>> variable,
>> it won't replace the text of variable fieldname, but it types the text
>> in
>> front of it. So my code ends up looking like: private int
>> _numberOfPeoplefieldname; instead of private int _numberOfPeople;
>> There are
>> 2 exceptions in which it'll do what it should:
>> a) I type an unknown type in my $fieldtype$ variable, like: "private
>> wtf...". The text turns red, since it's not known within visual
>> studio. If I
>> tab, I can replace the $fieldname$ variable.
>> b) I change the order in which the variables are entered. If I start
>> with
>> the $fieldname$ variable and edit the $fieldtype$ variable afterwards
>> it
>> works.
>> For some reason it does work in the prop template, but not in my own
>> live template!
>>
>> Is this a bug? Using R# 5.1 (latest version atm) within VS2010 on
>> Vista.
>>
>> Regards, Ted
>>
>


0

Please sign in to leave a comment.