Hello,
I have SyntaxEditor with .net addon and around 700 lines of code with multiple #region blocks. When the editor is loaded and its content is parsed, it sometimes collapses all the regions on its own. How can I disable this behavior?
Thank you
Hello,
I have SyntaxEditor with .net addon and around 700 lines of code with multiple #region blocks. When the editor is loaded and its content is parsed, it sometimes collapses all the regions on its own. How can I disable this behavior?
Thank you
Hello,
Any outlining node that is created with an IOutliningNodeDefinition.IsDefaultCollapsed set to true will collapse when the document is loaded. Regions are usually set up that way. The only way to prevent that is to use an IOutliningNodeDefinition that returns false for that IsDefaultCollapsed property.
Which syntax language are you using?
Hello,
C#.
Hello,
The only way you could prevent it from happening in our .NET Languages Add-on would be to use reflection on the CSharpOutliningSource class and look for static fields of type OutliningNodeDefinition. One of them has a Key of "RegionPreprocessorDirective". Set that object's IsDefaultCollapsed property to false. You'd do this at your app startup.
Thank you, it seems to be working. Is there any way to avoid the magic string?
Unfortunately no... the OutliningNodeDefinition is passed that string key directly and it isn't really referenced anywhere else in our code.
Please log in to a validated account to post comments.