本文整理匯總了TypeScript中vscode.StatusBarItem.show方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript StatusBarItem.show方法的具體用法?TypeScript StatusBarItem.show怎麽用?TypeScript StatusBarItem.show使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類vscode.StatusBarItem
的用法示例。
在下文中一共展示了StatusBarItem.show方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: initializeStatusBars
//Set up the initial status bars
private initializeStatusBars() {
if (this.ensureInitialized()) {
this._teamServicesStatusBarItem.command = CommandNames.OpenTeamSite;
this._teamServicesStatusBarItem.text = this._serverContext.RepoInfo.TeamProject;
this._teamServicesStatusBarItem.tooltip = Strings.NavigateToTeamServicesWebSite;
this._teamServicesStatusBarItem.show();
this._pullRequestStatusBarItem = window.createStatusBarItem(StatusBarAlignment.Left, 99);
this._pullRequestStatusBarItem.command = CommandNames.GetPullRequests;
this._pullRequestStatusBarItem.text = GitClient.GetPullRequestStatusText(0);
this._pullRequestStatusBarItem.tooltip = Strings.BrowseYourPullRequests;
this._pullRequestStatusBarItem.show();
this._buildStatusBarItem = window.createStatusBarItem(StatusBarAlignment.Left, 98);
this._buildStatusBarItem.command = CommandNames.OpenBuildSummaryPage;
this._buildStatusBarItem.text = `$(icon octicon-package) ` + `$(icon octicon-dash)`;
this._buildStatusBarItem.tooltip = Strings.NoBuildsFound;
this._buildStatusBarItem.show();
this._pinnedQueryStatusBarItem = window.createStatusBarItem(StatusBarAlignment.Left, 97);
this._pinnedQueryStatusBarItem.command = CommandNames.ViewPinnedQueryWorkItems;
this._pinnedQueryStatusBarItem.text = WitClient.GetPinnedQueryStatusText(0);
this._pinnedQueryStatusBarItem.tooltip = Strings.ViewYourPinnedQuery;
this._pinnedQueryStatusBarItem.show();
}
}
示例2: show
public show(): void {
this.stopStatusBarItem.show();
this.spinnerStatusBarItem.show();
const spinner = elegantSpinner();
const update = () => {
this.spinnerStatusBarItem.text = spinner();
};
this.interval = setInterval(update, 100);
}
示例3: constructor
private constructor(
execution: CommandExecution,
token: CancellationTokenSource
) {
resetStatusBarItem();
statusBarItem.text = nls.localize('status_bar_text', execution.command);
statusBarItem.tooltip = nls.localize('status_bar_tooltip');
statusBarItem.command = CANCEL_EXECUTION_COMMAND;
cancellationTokenSource = token;
if (statusTimer) {
clearInterval(statusTimer);
}
statusTimer = setInterval(() => cycleStatusBarText(statusBarItem), 1000);
execution.processExitSubject.subscribe(data => {
if (statusTimer) {
clearInterval(statusTimer);
}
resetStatusBarItem();
});
execution.processErrorSubject.subscribe(data => {
if (statusTimer) {
clearInterval(statusTimer);
}
resetStatusBarItem();
});
statusBarItem.show();
}
示例4: updateWordCount
public updateWordCount() {
// Create as needed
if (!this._statusBarItem) {
this._statusBarItem = window.createStatusBarItem(StatusBarAlignment.Left);
}
// Get the current text editor
let editor = window.activeTextEditor;
if (!editor) {
this._statusBarItem.hide();
return;
}
let doc = editor.document;
// Only update status if an MD file
if (doc.languageId === "yaml") {
let wordCount = this._getHints(doc, editor);
if (wordCount == null) {
editor.setDecorations(smallNumberDecorationType, []);
this._statusBarItem.hide();
} else {
editor.setDecorations(smallNumberDecorationType, wordCount);
this._statusBarItem.show();
this._statusBarItem.text = "Run tests";
}
} else {
this._statusBarItem.hide();
}
}
示例5: updateDateTime
function updateDateTime() {
if (configuration.hasFormat()) {
let flashState: FlashState;
if (configuration.shouldFlashTimeSeparators()) {
flashState = currentFlashState = currentFlashState === FlashState.On
? FlashState.Off
: FlashState.On;
} else {
flashState = FlashState.On;
}
let shouldShow = false;
if (!isStatusBarVisible) {
createStatusBarItem();
shouldShow = true;
}
statusBarItem.text = getDateTimeText(flashState);
if (shouldShow) {
statusBarItem.show();
}
} else {
if (isStatusBarVisible) {
removeStatusBarItem();
}
}
}
示例6: showTurnedOff
public showTurnedOff(): void {
this.setText('Off');
this.clearCommand();
this.statusBarItem.show();
}
示例7: showCrashed
public showCrashed(): void {
this.setText('Crashed');
this.statusBarItem.tooltip = 'The racer process has stopped. Click to view error';
this.statusBarItem.command = this.showErrorCommandName;
this.statusBarItem.show();
}
示例8: show
public show(hideWhenDone?: Thenable<any>): void {
this.statusBarItem.show();
this.start();
if (hideWhenDone !== undefined) {
hideWhenDone.then(() => this.hide());
}
}
示例9: updateWordCount
public updateWordCount() {
// Create as needed
if (!this._statusBarItem) {
this._statusBarItem = window.createStatusBarItem(StatusBarAlignment.Left);
}
// Get the current text editor
let editor = window.activeTextEditor;
if (!editor) {
this._statusBarItem.hide();
return;
}
let doc = editor.document;
// Only update status if an MD file
if (doc.languageId === "markdown") {
let wordCount = this._getWordCount(doc);
// Update the status bar
this._statusBarItem.text = wordCount !== 1 ? `$(pencil) ${wordCount} Words` : '$(pencil) 1 Word';
this._statusBarItem.show();
} else {
this._statusBarItem.hide();
}
}
示例10: updateDisplay
private async updateDisplay(pythonPath: string) {
const interpreters = await this.getInterpreters();
const interpreter = interpreters.find(i => utils.arePathsSame(i.path, pythonPath));
this.statusBar.color = '';
this.statusBar.tooltip = pythonPath;
if (interpreter) {
this.statusBar.text = interpreter.displayName!;
if (interpreter.companyDisplayName) {
const toolTipSuffix = `${EOL}${interpreter.companyDisplayName}`;
this.statusBar.tooltip += toolTipSuffix;
}
}
else {
const defaultDisplayName = `${path.basename(pythonPath)} [Environment]`;
const interpreterExists = utils.fsExistsAsync(pythonPath);
const displayName = this.versionProvider.getVersion(pythonPath, defaultDisplayName);
const virtualEnvName = this.getVirtualEnvironmentName(pythonPath);
await Promise.all([interpreterExists, displayName, virtualEnvName])
.then(([interpreterExists, displayName, virtualEnvName]) => {
const dislayNameSuffix = virtualEnvName.length > 0 ? ` (${virtualEnvName})` : '';
this.statusBar.text = `${displayName}${dislayNameSuffix}`;
if (!interpreterExists && displayName === defaultDisplayName && interpreters.length > 0) {
this.statusBar.color = 'yellow';
this.statusBar.text = '$(alert) Select Python Environment';
}
});
}
this.statusBar.show();
}