hawkerm / monaco-editor-uwp

A Windows Runtime Component wrapper around the web-based Monaco Editor.
MIT License
153 stars 36 forks source link

How to create my own code suggestions? #69

Closed DmitryBorodiy closed 2 years ago

DmitryBorodiy commented 2 years ago

Hello everyone! I have some UWP app with your very cool component😀 and I need to add my own code suggestions for XAML editor. How can I do that?

Thank you! Best wishes! 😀

hawkerm commented 2 years ago

You talking about like intellisense or snippets? Like this Monaco sample here: https://microsoft.github.io/monaco-editor/playground.html#extending-language-services-completion-provider-example

We generate the C# API from the JavaScript API, so it matches as closely as possible.

You can see how this was translated to something similar in the sample app here:

https://github.com/hawkerm/monaco-editor-uwp/blob/ba3c0de6ad95527b0cb6a9dac9c6c2098382dfc9/MonacoEditorTestApp/Helpers/LanguageProvider.cs#L16