0

I cannot seem to enable to right settings to access the code editor option when wanting to surround custom regions of code in JetBrains Rider. I have seen some tutorials showing how its supposed to be working but I cannot get it right. I want to be able to fold custom regions of code in a xaml file, and give it a suitable name as found in Visual Studio.

I accessed the following: "Settings -> Editor -> General -> Code folding" and enabled custom folding regions.

The working code in Visual Studio looks as follows:

<!--#region My custom region-->
<TextBlock Grid.Row="1"
           Grid.Column="0"
           Margin="90,0,0,0"
           HorizontalAlignment="Left"
           VerticalAlignment="Center"
           FontSize="20"
           Foreground="White"
           Text="RF Broadcast Interval (ms)" />
<!--#endregion-->

This enables you to create custom code folding regions. This is obviously in a xaml file, and I want to be able to implement the same functionality in Rider.

https://blog.jetbrains.com/idea/2012/03/custom-code-folding-regions-in-intellij-idea-111/

The above link shows a dropdown when selecting the "Surround with" option, in it, there is a option "<editor-fold...> Comments" which is supposed to function the same, however, this seems to be in a cs. file and not xaml. I have the option to still make use of the #region property in my classes, but have nothing to use in my xaml files.

TinusJvR
  • 1
  • 2
  • Can you give a small example, please? It would help me a lot to understand your question – mu88 Mar 13 '23 at 10:35
  • Hi @mu88, I updated my post to add some more context, I could not embed images, but I think you'll be able to understand my issue now. – TinusJvR Mar 14 '23 at 05:26
  • @TinusJvR Are you saying that even though you have proper `` folding comment the IDE (Rider) does not allow you to collapse/fold them? Or perhaps you asking to have the "#region Comment" option when using the Surround With action? – LazyOne Mar 16 '23 at 11:08
  • @TinusJvR For #1 I have found https://youtrack.jetbrains.com/issue/RIDER-14047/region-defined-in-XAML-isnt-collapsible ticket that is shelved (not on their todo list right now, maybe one day). So if that is not implemented then it will be odd to see #2 implemented. – LazyOne Mar 16 '23 at 11:09
  • @TinusJvR Just in case: for #2 you should be able to make your own Live Template of the surround kind... – LazyOne Mar 16 '23 at 11:10

0 Answers0