当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript StatusBarItem.show方法代码示例

本文整理汇总了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();
        }
    }
开发者ID:chrisdias,项目名称:vsts-vscode,代码行数:27,代码来源:team-extension.ts

示例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);
    }
开发者ID:KalitaAlexey,项目名称:RustyCode,代码行数:13,代码来源:output_channel_task_status_bar_item.ts

示例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();
  }
开发者ID:nertofiveone,项目名称:salesforcedx-vscode,代码行数:31,代码来源:statusBar.ts

示例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();
    }
  }
开发者ID:mulesoft-labs,项目名称:http-bat-vscode,代码行数:33,代码来源:extension.ts

示例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();
        }
    }
}
开发者ID:rid9,项目名称:DateTime,代码行数:29,代码来源:extension.ts

示例6: showTurnedOff

    public showTurnedOff(): void {
        this.setText('Off');

        this.clearCommand();

        this.statusBarItem.show();
    }
开发者ID:KalitaAlexey,项目名称:RustyCode,代码行数:7,代码来源:racer_status_bar_item.ts

示例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();
    }
开发者ID:KalitaAlexey,项目名称:RustyCode,代码行数:7,代码来源:racer_status_bar_item.ts

示例8: show

 public show(hideWhenDone?: Thenable<any>): void {
     this.statusBarItem.show();
     this.start();
     if (hideWhenDone !== undefined) {
         hideWhenDone.then(() => this.hide());
     }
 }
开发者ID:dfinke,项目名称:vscode-powershell,代码行数:7,代码来源:animatedStatusBar.ts

示例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();
        }
    }
开发者ID:Osuka-Andala,项目名称:vscode-wordcount,代码行数:27,代码来源:extension.ts

示例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();
    }
开发者ID:,项目名称:,代码行数:31,代码来源:


注:本文中的vscode.StatusBarItem.show方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。