How to capitalize a variable in a Rider Live Template?
Asked Answered
C

1

2

I'm trying to follow This post to solve the issue but I can't understand if the problem is Rider itself (that differs from IDEA) or something that I am mistaking.

If I click on "Live Templates" I only have a list of languages and the interface is totally different from the Mac screenshot.

Opening the C++ section I can select the template that I want to edit and there's a section called "Edit variables" that I know and use, but there's no "Expression" field or table to fill.

In this case I need to make the "Current Solution Name" variable capitalized.

Thank you in advance for the help!

Rider 2022 Screenshot

Circularize answered 5/9, 2022 at 15:0 Comment(2)
It looks like you're supposed to edit the template right underneath its definition. For example, the USTRUCT live template has its code right below it. Do the sections expand when you select the template name. As you type a new variable name into that section, for example, $myvar$, I believe the Edit Variables button will be enabled.Iconoduly
I found a windows similar to yours clicking on "Other languages", Unfortunately I couldn't figure how to make these variables work with the C++ live templates, and I didn't find how to read the solution name from there too, I guess that Rider really differs from Idea then, I'll try to contact the JetBrains support too. Thank you for the tipsCircularize
G
0

I have the same problem trying to add a custom template for C++.

For some reason, the "edit variables" window is different for language-specific templates (e.x. C++) vs "other languages".

So if you want to see the table with "name", "expression", "default value" and "skip if defined" columns, you need to create/edit a template in "other languages".

I wasn't able to define the template for C++ (with enum suggestions) in "C++" with "macros" (the whole "edit variables" window is wonky and inconsistent), so defined it in "other languages".

Grabowski answered 18/5 at 18:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.