本文整理汇总了TypeScript中vscode.window.setStatusBarMessage方法的典型用法代码示例。如果您正苦于以下问题:TypeScript window.setStatusBarMessage方法的具体用法?TypeScript window.setStatusBarMessage怎么用?TypeScript window.setStatusBarMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vscode.window
的用法示例。
在下文中一共展示了window.setStatusBarMessage方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: setup
async function setup(disposables: vscode.Disposable[]) {
const pathHint = vscode.workspace.getConfiguration('git').get<string>('path');
git.info = await findGit(pathHint);
vscode.window.setStatusBarMessage(
'gitflow using git executable: ' + git.info.path + ' with version ' +
git.info.version, 5000);
const commands = [
vscode.commands.registerCommand(
'gitflow.initialize',
async () => {
await runWrapped(flow.initialize);
}),
vscode.commands.registerCommand(
'gitflow.featureStart',
async () => {
await runWrapped(flow.requireFlowEnabled);
await runWrapped(flow.feature.precheck);
const name = await vscode.window.showInputBox({
placeHolder: 'my-awesome-feature',
prompt: 'A new name for your feature',
});
if (!name) { return; }
await runWrapped(flow.feature.start, [name, 'feature']);
}),
vscode.commands.registerCommand(
'gitflow.featureRebase',
async () => {
await runWrapped(flow.feature.rebase, ['feature']);
}),
vscode.commands.registerCommand(
'gitflow.featureFinish',
async () => {
await runWrapped(flow.feature.finish, ['feature']);
}),
vscode.commands.registerCommand(
'gitflow.bugfixStart',
async () => {
await runWrapped(flow.requireFlowEnabled);
await runWrapped(flow.feature.precheck);
const name = await vscode.window.showInputBox({
placeHolder: 'my-awesome-bugfix',
prompt: 'A new name for your bugfix',
});
if (!name) { return; }
await runWrapped(flow.feature.start, [name, 'bugfix']);
}),
vscode.commands.registerCommand(
'gitflow.bugfixRebase',
async () => {
await runWrapped(flow.feature.rebase, ['bugfix']);
}),
vscode.commands.registerCommand(
'gitflow.bugfixFinish',
async () => {
await runWrapped(flow.feature.finish, ['bugfix']);
}),
vscode.commands.registerCommand(
'gitflow.releaseStart',
async () => {
await runWrapped(flow.requireFlowEnabled);
await runWrapped(flow.release.precheck);
const guessedVersion = await runWrapped(
flow.release.guess_new_version) || '';
const name = await vscode.window.showInputBox({
placeHolder: guessedVersion,
prompt: 'The name of the release',
value: guessedVersion,
});
if (!name) { return; }
await runWrapped(flow.release.start, [name]);
}),
vscode.commands.registerCommand(
'gitflow.releaseFinish',
async () => {
await runWrapped(flow.release.finish);
}),
vscode.commands.registerCommand(
'gitflow.hotfixStart',
async () => {
await runWrapped(flow.requireFlowEnabled);
const guessedVersion = await runWrapped(
flow.hotfix.guess_new_version) || '';
const name = await vscode.window.showInputBox({
placeHolder: guessedVersion,
prompt: 'The name of the hotfix version',
value: guessedVersion,
});
if (!name) { return; }
await runWrapped(flow.hotfix.start, [name]);
}),
vscode.commands.registerCommand(
'gitflow.hotfixFinish',
async () => {
await runWrapped(flow.hotfix.finish);
}),
];
// add disposable
disposables.push(...commands);
}
示例2: setStatusBarPermanentMessage
setStatusBarPermanentMessage(text: string): vscode.Disposable {
return vscode.window.setStatusBarMessage(text);
}
示例3: showMenu
export default function showMenu(context: vscode.ExtensionContext) {
'use strict';
vscode.window.setStatusBarMessage('ForceCode Menu');
return vscode.window.forceCode.connect(context)
.then(svc => displayMenu())
.then(res => processResult(res))
.then(finished, onError);
// =======================================================================================================================================
// =======================================================================================================================================
// =======================================================================================================================================
function displayMenu() {
var quickpick: any[] = [model.enterCredentials];
if (vscode.window.forceCode.userInfo !== undefined) {
quickpick.push(model.openFile);
quickpick.push(model.compileDeploy);
quickpick.push(model.executeAnonymous);
quickpick.push(model.getLogs);
quickpick.push(model.resourceBundle);
// quickpick.push(model.retrievePackage);
// quickpick.push(model.deployPackage);
}
let options: vscode.QuickPickItem[] = quickpick.map(record => {
let icon: string = getIcon(record.icon);
return {
description: `${record.description}`,
detail: `${record.detail}`,
label: `$(${icon}) ${record.label}`,
};
});
let config: {} = {
matchOnDescription: true,
matchOnDetail: true,
placeHolder: 'Run a command',
};
return vscode.window.showQuickPick(options, config);
}
function processResult(result) {
if (result !== undefined && result.description !== undefined) {
switch (result.description) {
case model.enterCredentials.description:
return commands.credentials(context);
case model.compileDeploy.description:
return commands.compile(vscode.window.activeTextEditor.document, context);
case model.executeAnonymous.description:
return commands.executeAnonymous(vscode.window.activeTextEditor.document, context);
case model.getLogs.description:
return commands.getLog(context);
case model.openFile.description:
return commands.open(context);
case model.resourceBundle.description:
return commands.staticResource(context);
case model.retrievePackage.description:
return commands.retrieve();
case model.deployPackage.description:
// return commands.deployPackage();
break;
default:
break;
}
}
}
// =======================================================================================================================================
// =======================================================================================================================================
// =======================================================================================================================================
function finished(res): boolean {
console.log(res);
return true;
}
// =======================================================================================================================================
function onError(err): boolean {
vscode.window.setStatusBarMessage('Error opening menu');
vscode.window.showErrorMessage(err.message);
var outputChannel: vscode.OutputChannel = vscode.window.forceCode.outputChannel;
outputChannel.append('================================================================');
outputChannel.append(err);
console.error(err);
return false;
}
// =======================================================================================================================================
}
示例4: function
myGi.DownloadGist(gist).then(async function (res: any) {
var keys = Object.keys(res.files);
for (var i: number = 0; i < keys.length; i++) {
switch (keys[i]) {
case "launch.json": {
await fileManager.FileManager.WriteFile(en.FILE_LAUNCH, res.files[en.FILE_LAUNCH_NAME].content).then(
function (added: boolean) {
vscode.window.showInformationMessage("Launch Settings downloaded Successfully");
}, function (error: any) {
vscode.window.showErrorMessage(common.ERROR_MESSAGE);
return;
}
);
break;
}
case "settings.json": {
await fileManager.FileManager.WriteFile(en.FILE_SETTING, res.files[en.FILE_SETTING_NAME].content).then(
function (added: boolean) {
vscode.window.showInformationMessage("Editor Settings downloaded Successfully");
}, function (error: any) {
vscode.window.showErrorMessage(common.ERROR_MESSAGE);
return;
});
break;
}
case en.FILE_KEYBINDING_DEFAULT || en.FILE_KEYBINDING_MAC: {
var sourceKeyBinding : string = "";
var os : string = null;
if (en.OsType == OsType.Mac) {
sourceKeyBinding = en.FILE_KEYBINDING_MAC;
os = "Mac";
}
else{
sourceKeyBinding = en.FILE_KEYBINDING_DEFAULT;
}
await fileManager.FileManager.WriteFile(en.FILE_KEYBINDING, res.files[sourceKeyBinding].content).then(
function (added: boolean) {
if (os) {
vscode.window.showInformationMessage("Keybinding Settings for Mac downloaded Successfully");
}
vscode.window.showInformationMessage("Keybinding Settings downloaded Successfully");
}, function (error: any) {
vscode.window.showErrorMessage(common.ERROR_MESSAGE);
return;
});
break;
}
case "locale.json": {
await fileManager.FileManager.WriteFile(en.FILE_LOCALE, res.files[en.FILE_LOCALE_NAME].content).then(
function (added: boolean) {
vscode.window.showInformationMessage("Locale Settings downloaded Successfully");
}, function (error: any) {
vscode.window.showErrorMessage(common.ERROR_MESSAGE);
return;
});
break;
}
case "extensions.json": {
var extensionlist = pluginService.PluginService.CreateExtensionList();
extensionlist.sort(function (a, b) {
return a.name.localeCompare(b.name);
});
var remoteList = pluginService.ExtensionInformation.fromJSONList(res.files[en.FILE_EXTENSION_NAME].content);
var deletedList = pluginService.PluginService.GetDeletedExtensions(remoteList);
for (var deletedItemIndex = 0; deletedItemIndex < deletedList.length; deletedItemIndex++) {
var deletedExtension = deletedList[deletedItemIndex];
await pluginService.PluginService.DeleteExtension(deletedExtension, en.ExtensionFolder)
.then((res) => {
vscode.window.showInformationMessage(deletedExtension.name + '-' + deletedExtension.version + " is removed.");
}, (rej) => {
vscode.window.showErrorMessage(common.ERROR_MESSAGE);
});
}
var missingList = pluginService.PluginService.GetMissingExtensions(remoteList);
if (missingList.length == 0) {
vscode.window.showInformationMessage("No extension need to be installed");
}
else {
var actionList = new Array<Promise<void>>();
vscode.window.setStatusBarMessage("Installing Extensions in background.");
missingList.forEach(element => {
actionList.push(pluginService.PluginService.InstallExtension(element, en.ExtensionFolder)
.then(function () {
var name = element.publisher + '.' + element.name + '-' + element.version;
vscode.window.showInformationMessage("Extension " + name + " installed Successfully");
}));
});
Promise.all(actionList)
.then(function () {
vscode.window.setStatusBarMessage("Restart Required to use installed extensions.");
vscode.window.showInformationMessage("Extension installed Successfully, please restart");
//.........这里部分代码省略.........
示例5:
.then(() => {
vscode.window.setStatusBarMessage('Successfully installed .NET Core Debugger.');
})
示例6: startGitProcess
async function startGitProcess() {
vscode.window.setStatusBarMessage("Sync : Uploading / Updating Your Settings In Github.");
if (!syncSetting.anonymousGist) {
if (syncSetting.token == null && syncSetting.token == "") {
vscode.window.showInformationMessage("Sync : Set Github Token or set anonymousGist to true from settings.");
return;
}
}
syncSetting.lastUpload = dateNow;
vscode.window.setStatusBarMessage("Sync : Reading Settings and Extensions.");
uploadedExtensions = PluginService.CreateExtensionList();
uploadedExtensions.sort(function (a, b) {
return a.name.localeCompare(b.name);
});
// var remoteList = ExtensionInformation.fromJSONList(file.content);
// var deletedList = PluginService.GetDeletedExtensions(uploadedExtensions);
let fileName = en.FILE_EXTENSION_NAME;
let filePath = en.FILE_EXTENSION;
let fileContent = JSON.stringify(uploadedExtensions, undefined, 2);;
let file: File = new File(fileName, fileContent, filePath, fileName);
allSettingFiles.push(file);
let contentFiles: Array<File> = new Array();
// if (syncSetting.workspaceSync) {
contentFiles = await FileManager.ListFiles(en.USER_FOLDER, 0, 2);
// }
// else {
// contentFiles = await FileManager.ListFiles(en.USER_FOLDER, 0, 1);
// }
let customExist: boolean = await FileManager.FileExists(en.FILE_CUSTOMIZEDSETTINGS);
if (customExist) {
customSettings = await common.GetCustomSettings();
contentFiles = contentFiles.filter((file: File, index: number) => {
let a: boolean = file.fileName != en.FILE_CUSTOMIZEDSETTINGS_NAME;
return a;
});
if (customSettings.ignoreUploadFiles.length > 0) {
contentFiles = contentFiles.filter((file: File, index: number) => {
let a: boolean = customSettings.ignoreUploadFiles.indexOf(file.fileName) == -1 && file.fileName != en.FILE_CUSTOMIZEDSETTINGS_NAME;
return a;
});
}
if (customSettings.ignoreUploadFolders.length > 0) {
contentFiles = contentFiles.filter((file: File, index: number) => {
let matchedFolders = customSettings.ignoreUploadFolders.filter((folder) => {
return file.filePath.indexOf(folder) == -1;
});
return matchedFolders.length > 0;
});
}
}
else {
common.LogException(null, common.ERROR_MESSAGE, true);
return;
}
contentFiles.forEach(snippetFile => {
if (snippetFile.fileName != en.APP_SUMMARY_NAME && snippetFile.fileName != en.FILE_KEYBINDING_MAC) {
if (snippetFile.content != "") {
if (snippetFile.fileName == en.FILE_KEYBINDING_NAME) {
var destinationKeyBinding: string = "";
if (en.OsType == OsType.Mac) {
destinationKeyBinding = en.FILE_KEYBINDING_MAC;
}
else {
destinationKeyBinding = en.FILE_KEYBINDING_DEFAULT;
}
snippetFile.gistName = destinationKeyBinding;
}
allSettingFiles.push(snippetFile);
}
}
});
var extProp: CloudSetting = new CloudSetting();
extProp.lastUpload = dateNow;
fileName = en.FILE_CLOUDSETTINGS_NAME;
fileContent = JSON.stringify(extProp);
file = new File(fileName, fileContent, "", fileName);
allSettingFiles.push(file);
let completed: boolean = false;
let newGIST: boolean = false;
if (syncSetting.anonymousGist) {
//.........这里部分代码省略.........
示例7: function
let pasteAndShowMessage= function(fileName: string) {
copyPaste.copy(fileName);
vscode.window.setStatusBarMessage(`The filename "${fileName}" was copied to the clipboard.`, 3000);
}
示例8: startGitProcess
async function startGitProcess(sett: Setting) {
if (sett.Token != null) {
var allSettingFiles = new Array<File>();
vscode.window.setStatusBarMessage("Reading Settings and Extensions.", 1000);
await fileManager.FileManager.FileExists(en.FILE_SETTING).then(async function(fileExists: boolean) {
if (fileExists) {
await fileManager.FileManager.ReadFile(en.FILE_SETTING).then(function(settings: string) {
if (settings) {
var fileName = en.FILE_SETTING_NAME;
var filePath = en.FILE_SETTING;
var fileContent = settings;
var file: File = new File(fileName, fileContent, filePath);
allSettingFiles.push(file);
}
});
}
});
await fileManager.FileManager.FileExists(en.FILE_LAUNCH).then(async function(fileExists: boolean) {
if (fileExists) {
await fileManager.FileManager.ReadFile(en.FILE_LAUNCH).then(function(launch: string) {
if (launch) {
var fileName = en.FILE_LAUNCH_NAME;
var filePath = en.FILE_LAUNCH;
var fileContent = launch;
var file: File = new File(fileName, fileContent, filePath);
allSettingFiles.push(file);
}
});
}
});
await fileManager.FileManager.FileExists(en.FILE_KEYBINDING).then(async function(fileExists: boolean) {
if (fileExists) {
await fileManager.FileManager.ReadFile(en.FILE_KEYBINDING).then(function(keybinding: string) {
if (keybinding) {
var fileName = en.FILE_KEYBINDING_NAME;
var filePath = en.FILE_KEYBINDING;
var fileContent = keybinding;
var file: File = new File(fileName, fileContent, filePath);
allSettingFiles.push(file);
}
});
}
});
var extensionlist = pluginService.PluginService.CreateExtensionList();
extensionlist.sort(function(a, b) {
return a.name.localeCompare(b.name);
});
var fileName = en.FILE_EXTENSION_NAME;
var filePath = en.FILE_EXTENSION;
var fileContent = JSON.stringify(extensionlist, undefined, 2);;
var file: File = new File(fileName, fileContent, filePath);
allSettingFiles.push(file);
var snippetFiles = await fileManager.FileManager.ListFiles(en.FOLDER_SNIPPETS);
snippetFiles.forEach(snippetFile => {
allSettingFiles.push(snippetFile);
});
if (sett.Gist == null || sett.Gist === "") {
await myGi.CreateNewGist(allSettingFiles).then(async function(gistID: string) {
if (gistID) {
sett.Gist = gistID;
await common.SaveSettings(sett).then(function(added: boolean) {
if (added) {
vscode.window.showInformationMessage("Uploaded Successfully." + " GIST ID : " + gistID + " . Please copy and use this ID in other machines to sync all settings.");
vscode.window.setStatusBarMessage("Gist Saved.", 1000);
}
}, function(err: any) {
console.error(err);
vscode.window.showErrorMessage(common.ERROR_MESSAGE);
return;
});
}
else{
vscode.window.showErrorMessage("GIST ID: undefined" + common.ERROR_MESSAGE);
return;
}
}, function(error: any) {
vscode.window.showErrorMessage(common.ERROR_MESSAGE);
return;
});
}
else {
await myGi.ExistingGist(sett.Gist, allSettingFiles).then(function(added: boolean) {
vscode.window.showInformationMessage("Settings Updated Successfully");
}, function(error: any) {
vscode.window.showErrorMessage(common.ERROR_MESSAGE);
return;
});
}
}
else {
//.........这里部分代码省略.........
示例9: setStatusBarText
function setStatusBarText(what, docType){
var date=new Date();
var text=what + ' [' + docType + '] ' + date.toLocaleTimeString();
vscode.window.setStatusBarMessage(text, 1500);
}
示例10:
}).catch(error => {
vscode.window.setStatusBarMessage("");
console.error(error);
Helpers.throwError("Could not connect to Nuget server.");
});;