本文整理汇总了TypeScript中vscode.window.onDidChangeTextEditorOptions方法的典型用法代码示例。如果您正苦于以下问题:TypeScript window.onDidChangeTextEditorOptions方法的具体用法?TypeScript window.onDidChangeTextEditorOptions怎么用?TypeScript window.onDidChangeTextEditorOptions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vscode.window
的用法示例。
在下文中一共展示了window.onDidChangeTextEditorOptions方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: constructor
constructor(editors: Editors) {
this._editors = editors;
this._editors.update();
let subscriptions: Disposable[] = [];
window.onDidChangeActiveTextEditor(this._onChangeEvent, this, subscriptions);
window.onDidChangeTextEditorOptions(this._onOptionsEvent, this, subscriptions);
this._editors.update();
this._disposable = Disposable.from(...subscriptions);
}
示例2: wait
return new Promise<TextEditorOptions>(async resolve => {
window.onDidChangeTextEditorOptions(e => {
resolved = true;
assert.ok(e.options);
resolve(e.options);
});
await wait(100);
if (resolved) {
return;
}
assert.ok(window.activeTextEditor.options);
resolve(window.activeTextEditor.options);
});
示例3:
return new Promise<TextEditorOptions>(resolve => {
window.onDidChangeTextEditorOptions(e => {
resolved = true;
assert.ok(e.options);
resolve(e.options);
});
setTimeout(() => {
if (resolved) {
return;
}
assert.ok(window.activeTextEditor.options);
resolve(window.activeTextEditor.options);
}, 100);
});
示例4: Promise
await new Promise(resolve => {
window.onDidChangeTextEditorOptions(e => {
textEditorOptions = e.options;
resolve();
});
});