Integration of SyntaxEditor and Roslyn tool

1 Answer 138 Views
SyntaxEditor
Brian
Top achievements
Rank 1
Brian asked on 10 Oct 2022, 08:22 AM

Hi

Do you have an example on how to integrate the SyntaxEditor and the Roslyn toll:

Using C#

Want to:

- Compile and display errors

- Get list of functions and be able to navigate to functions

- etc.

/Brian

 


 

 

1 Answer, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 11 Oct 2022, 10:35 AM

Hello Brian,

There aren't any examples showing integration between RadSyntaxEditor and Roslyn.

You should be able to achieve your requirement with the list of functions using the Roslyn Completion Service or something similar along with the IntelliPrompts feature of RadSyntaxEditor.

About the compilation and errors display, this is not supported since the RadSyntaxEditor just visualizes the code and there isn't any interface related to code compilation. If you can use the Roslyn APIs to compile code, you can get the text from the SyntaxEditor using its TextDocument object (assigned to the Document property) and provide it to the compiler. To display errors, you can use any ItemsControl (like  ItemsControl, RadListBox or whatever fits your visualization requirements). And if you want to get a visualization similar to Visual Studio and its panes (like Output, Solution Explorer, Code Editor, Errors, etc.), you can use RadDocking. There is an example that creates a layout similar to Visual Studio, which you can find in our WPF Demos application. The example is named "First Look" under the Docking section.

I hope these ideas help.

Regards,
Martin Ivanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
SyntaxEditor
Asked by
Brian
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Share this question
or