Refactored MonacoInlineCompletion into its own file to reuse the class to redefine some interfaces as interface generics in accordance with the monaco-editor API because MonacoInlineCompletion is after all an implementation of the monaco.languages.InlineCompletion interface.
Also added the following type-guard for inlineCompletionItems to remove the type assertion as monaco.languages.InlineCompletion[]
.filter(
(item?: MonacoInlineCompletion): item is MonacoInlineCompletion =>
!!item
);
Refactored
MonacoInlineCompletion
into its own file to reuse the class to redefine some interfaces as interface generics in accordance with themonaco-editor
API becauseMonacoInlineCompletion
is after all an implementation of themonaco.languages.InlineCompletion
interface.Also added the following type-guard for
inlineCompletionItems
to remove the type assertionas monaco.languages.InlineCompletion[]