Resharper C# Live Templates expressions does not appear in intellisense

I am trying to use C# live templates(expressions) with resharper(long time ago at least one year ago I opened a defect, was assigned to some dev but even today the defect is still present, it was not fixed) and it looks like these templates are not shown in intellisense by default(you need to do a trick to appear).

I have this simple expression template named MyCustomIsNull:

Example:

$VALUE$ == null

and mark the template to appear when an expression is required(you see an option named "Availability" and you need to check "C# 2.0+ expressions")

Then I try to use is this way:

if(MyCustomIsNull.......

 

The problem is that MyCustomIsNull template is not appearing in intellisense by default, you need to do a trick to have it enabled:

type "if(MyCustomIsNull" then press backspace till you will have "if(" and then type again MyCustomIsNull and this time the template will appear in intellisense.

Is there anyone struggling with the same issue?

Thank you.

0
8 comments
Official comment

Hello Cristian, 

One question, after typing "if", do you complete "if" template from the IntelliSense popup? If so, it might explain why there is no your custom template in the popup after that. After completing "if" template, a hotspot session is active (the red frame inside parentheses), and there is no way to open any IntelliSense popup automatically where live templates will appear. 

You might update "if" template not to open a hotspot session. Paste the following code instead the existed one in the template's body:

if ($END$)
{
     $SELECTION$
}

Then save it. After that, there won't be any hotspot after completing "if" template.

 

Or there is another way. You might create a custom "if" template implementation with needed code already inside, like:

if ($VALUE$ == null)
{
$SELECTION$$END$
}

and call if e.g. "ifnull". Then, start typing "ifnull", complete it from the InteliSense popup and choose the correct value for "VALUE" hotspot.

Thanks! 

 

 

Avatar
Permanently deleted user

It's not related to "if" template, I've deleted the "if" template at all(except "MyCustomIsNull" template), actually deleted all templates. The same is happening with "while" and every place where in C# language you need to add an expression.

So after typing "if" I type "(" example:

if(   and now if I continue typing "MyCustomIsNull" resharper is not showing the live template(only if I press backspace and delete all content(MyCustomIsNull) till "(" then type it again)

I'm quiet sure you can also reproduce on your side.

 

Thank you.

 

0

Hello Cristian,

I finally was able to reproduce the same issue. In the initial post, you told that you'd already opened a defect. Are you able to share a ticket's number or any ID of the defect? 

As possible workarounds, apart from already mentioned by you:

  • you might type a space after an opening parenthesis and then start typing the custom template's name;

or

  • hit Ctrl+Space after typing first characters of the template's name. 

Thanks!  

0
Avatar
Permanently deleted user

HI,

Yes I submitted the defect: Request  #1226242

Thank you.

0

Thanks! I see. You submitted this support request previous week. However, you told:

> long time ago at least one year ago I opened a defect, was assigned to some dev but even today the defect is still present, it was not fixed

I thought the defect you told about had some ID or similar. Anyway, I filed a request to YouTrack https://youtrack.jetbrains.com/issue/RSRP-468136

Thanks! 

0
Avatar
Permanently deleted user

Not remember the defect number for the old request(my old mail address was disposed).

Thank you very much.

0
Avatar
Permanently deleted user

Hello,

 

Is there any chance to see this issue fixed in resharper?

Thank you.

0
Avatar
Permanently deleted user

I see no updates related to this issue...

0

Please sign in to leave a comment.