codemirror: Add support for missing Monaco props
Created by: fkling
Closes #36524 (closed)
This PR adds support for optional props defined in the Monaco editor interface but not considered in the CodeMirror implementation (see issue for list).
Some notes:
-
editorClassName
is not supported because it appears to be used for handling placeholder values only, which CodeMirror handles out of the box. - I refactored how
onSuggestionsInitialized
works. Instead of passing this as a separate function, this is now a method on theIEditor
interface provided to the callback of theonEditorCreated
prop. Having a single interface for directly controlling editor behavior seemed cleaner to me.
Test plan
onFocus
, onCompletionItemSelected
and onSuggestionInitiated
(now editor.showSuggestions()
) are all used by the onboarding tour. The existing integration test passes for Monaco (verifies that onSuggestionsInitialized
migration works) and I was able to get most of the onboarding tour to work with CodeMirror (see also the Percy build of this PR, but the integration test seem to need some tweaking to make it work properly with CodeMirror so I'll do this in a separate PR.
App preview:
Check out the client app preview documentation to learn more.