hawkerm / monaco-editor-uwp

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

Find code feature #71

Closed DmitryBorodiy closed 2 years ago

DmitryBorodiy commented 2 years ago

Hello! I'm looking for an opportunity how can I implement the ability to search for text and code in the editor?

Thank you!

hawkerm commented 2 years ago

@DmitryBorodiy the Monaco editor already has the ability for the user to search using Ctrl+F.

Otherwise, if you're asking about how you can introspect what has been written in the editor, please look at the sample app and the code in this repo. It's the same API as Monaco itself which provides the FindMatches API off the model to look at text in the editor.

DmitryBorodiy commented 2 years ago

How I can use FindMatches method?

DmitryBorodiy commented 2 years ago

I cant find this method in Model...

hawkerm commented 2 years ago

@DmitryBorodiy there's an example in the demonstration app right here:

https://github.com/hawkerm/monaco-editor-uwp/blob/ba3c0de6ad95527b0cb6a9dac9c6c2098382dfc9/MonacoEditorTestApp/MainPage.xaml.cs#L535

DmitryBorodiy commented 2 years ago

@DmitryBorodiy there's an example in the demonstration app right here:

https://github.com/hawkerm/monaco-editor-uwp/blob/ba3c0de6ad95527b0cb6a9dac9c6c2098382dfc9/MonacoEditorTestApp/MainPage.xaml.cs#L535

Thank you I try it!🙂