Skip to content

OnTypeFormattingEditProvider

原文链接

https://microsoft.github.io/monaco-editor/docs.html#interfaces/languages.OnTypeFormattingEditProvider.html

文档格式设置提供程序接口定义扩展和格式设置功能之间的约定。

ts
interface OnTypeFormattingEditProvider {
    autoFormatTriggerCharacters: string[];
    provideOnTypeFormattingEdits(model, position, ch, options, token): ProviderResult<TextEdit[]>;
}

autoFormatTriggerCharacters

  • 类型:string[]

provideOnTypeFormattingEdits