本文整理匯總了TypeScript中vscode.EventEmitter.fire方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript EventEmitter.fire方法的具體用法?TypeScript EventEmitter.fire怎麽用?TypeScript EventEmitter.fire使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類vscode.EventEmitter
的用法示例。
在下文中一共展示了EventEmitter.fire方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: async
const update = async () => {
try {
await generateTranslationSchema({ rootPath: srcPath, filter: filter, schemaPath: schema, logger: logger, indention: indention, preprocessor: preprocessor, babylonConfig: babylonConfig })
spin(false)
var items = (oldSchema) ? ['Show Diff'] : ['Show File']
const value = await vscode.window.showInformationMessage('i18n json schema has been updated', ...items)
if (value === 'Show Diff') {
const oldUri = vscode.Uri.parse('i18n-schema:old.json')
const newUri = vscode.Uri.parse(`i18n-schema:${path.basename(schema)}`)
emitter.fire(oldUri)
emitter.fire(newUri)
vscode.commands.executeCommand('vscode.diff', oldUri, newUri)
}
if (value === 'Show File') {
try {
const file = await vscode.workspace.openTextDocument(schema)
vscode.window.showTextDocument(file)
} catch(err) {
vscode.window.showErrorMessage(err.message)
}
}
} catch (err) {
outputChannel.append(err)
vscode.window.showErrorMessage(err.message)
spin(false)
}
}
示例2: readConfig
readConfig().then(() => {
if (oldSchema) {
const oldUri = vscode.Uri.parse('i18n-schema:old.json')
const newUri = vscode.Uri.parse(`i18n-schema:${path.basename(schema)}`)
emitter.fire(oldUri)
emitter.fire(newUri)
vscode.commands.executeCommand('vscode.diff', oldUri, newUri)
} else {
vscode.window.showInformationMessage(`Schema has no local changes`)
}
resolve()
}, reject)