How can I enable code outlining for C#?

SyntaxEditor .NET Languages Add-on for WPF Forum

Posted 13 years ago by Craig - Varigence, Inc.
Version: 11.1.0541
Avatar
I'm using the C# language in the syntax editor and while other capabilities started working immediately, code outlining never became enabled. Do I need to explicitly enable that feature? If so, how?

Things I've tried:
1. Setting the editor's Document.Language property to a new CSharpSyntaxLanguage instance.
2. Setting Document.OutliningMode to OutliningMode.Automatic.
3. Setting IsOutliningMarginVisible to true (just in case)
4. Running EditorCommands.StartAutomaticOutlining.Execute.

Note that I am using text binding, in case that makes a difference.

Also, will C# outlining account for region tags (as in #region - #endregion)? It doesn't seem to in your samples, which is why I'm asking.

Thanks,

-Craig

[Modified at 03/01/2011 09:42 PM]

Comments (1)

Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Craig,

Make sure you have an ambient parse request dispatcher service started when your app starts, like with this line:
AmbientParseRequestDispatcherProvider.Dispatcher = new ThreadedParseRequestDispatcher();
That should be in the docs for the add-on (just noticed it's not), and we'll get it in the Getting Started topic for the next build. The XML language's Getting Started topic does have the info that is appropriate here.

Outlining will work out of the box without you having to set automatic. Regions aren't outlined just yet. That is on our TODO list since they are sort of out-of-band from the real AST data, similar to XML comments.


Actipro Software Support

The latest build of this product (v24.1.2) was released 2 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.