當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript window.onDidChangeTextEditorOptions方法代碼示例

本文整理匯總了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);
 }
開發者ID:kenwilcox,項目名稱:editors,代碼行數:11,代碼來源:extension.ts

示例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);
	});
開發者ID:jedmao,項目名稱:editorconfig-vscode,代碼行數:13,代碼來源:testUtils.ts

示例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);
	});
開發者ID:Bigous,項目名稱:editorconfig-vscode,代碼行數:15,代碼來源:testUtils.ts

示例4: Promise

	await new Promise(resolve => {
		window.onDidChangeTextEditorOptions(e => {
			textEditorOptions = e.options;
			resolve();
		});
	});
開發者ID:YOTOV-LIMITED,項目名稱:editorconfig-vscode,代碼行數:6,代碼來源:testUtils.ts


注:本文中的vscode.window.onDidChangeTextEditorOptions方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。