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


TypeScript StatusBarItem.hide方法代碼示例

本文整理匯總了TypeScript中vscode.StatusBarItem.hide方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript StatusBarItem.hide方法的具體用法?TypeScript StatusBarItem.hide怎麽用?TypeScript StatusBarItem.hide使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在vscode.StatusBarItem的用法示例。


在下文中一共展示了StatusBarItem.hide方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: 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

示例2: 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

示例3: hide

    public hide(): void {
        if (this.interval !== undefined) {
            clearInterval(this.interval);

            this.interval = undefined;
        }

        this.stopStatusBarItem.hide();

        this.spinnerStatusBarItem.hide();
    }
開發者ID:KalitaAlexey,項目名稱:RustyCode,代碼行數:11,代碼來源:output_channel_task_status_bar_item.ts

示例4: updateStatusBarItemVisibility

 public updateStatusBarItemVisibility(): void {
     if (!this.canBeShown) {
         return;
     }
     if (!window.activeTextEditor) {
         this.statusBarItem.hide();
         return;
     }
     if (languages.match(getDocumentFilter(), window.activeTextEditor.document)) {
         this.statusBarItem.show();
     } else {
         this.statusBarItem.hide();
     }
 }
開發者ID:KalitaAlexey,項目名稱:RustyCode,代碼行數:14,代碼來源:missing_tools_status_bar_item.ts

示例5: removeStatusBarItem

function removeStatusBarItem() {
    if (statusBarItem) {
        statusBarItem.hide();
        statusBarItem.dispose();
        statusBarItem = null;
    }
    isStatusBarVisible = false;
}
開發者ID:rid9,項目名稱:DateTime,代碼行數:8,代碼來源:extension.ts

示例6: updateCharCount

 public updateCharCount(){
     if(!this._statusBarItem) {
         this._statusBarItem = window.createStatusBarItem(StatusBarAlignment.Left);
     }
     let editor = window.activeTextEditor;
     if(!editor) {
         this._statusBarItem.hide();
         return;
     }
     let doc = editor.document;
     if(doc.languageId === "markdown") {
         let charCount = this._getCharCount(doc);
         this._statusBarItem.text = charCount !== 1 ? `$(pencil) ${charCount} Chars` : `$(pencil)1 Char`;
         this._statusBarItem.show();
     } else {
         this._statusBarItem.hide();
     }
 }
開發者ID:m0t0k1,項目名稱:vscode-charcount,代碼行數:18,代碼來源:extension.ts

示例7: updateStatus

function updateStatus(status: StatusBarItem): void {
    const info = getEditorInfo();
    status.text = info ? info.text : void 0;
    status.tooltip = info ? info.tooltip : void 0;
    status.color = info ? info.color : void 0;

    if (info) {
        status.show();
    } else {
        status.hide();
    }
}
開發者ID:voodoos,項目名稱:vscode-extension-samples,代碼行數:12,代碼來源:extension.ts

示例8: updateStatus

function updateStatus(status: StatusBarItem): void {
	let text = getSelectedLines();
	if (text) {
		status.text = '$(megaphone) ' + text;
	}

	if (text) {
		status.show();
	} else {
		status.hide();
	}
}
開發者ID:rlugojr,項目名稱:vscode-extension-samples,代碼行數:12,代碼來源:extension.ts

示例9: updateEditor

    export function updateEditor() {
        var editor = window.activeTextEditor;
        if(!editor) {
            _statusBarItem.hide();
            return;
        }

        var doc = editor.document;

        //If no folder is open, override the perforce directory to the files
        var directoryOverride = null;
        if (workspace.rootPath == undefined) {
            directoryOverride = Path.dirname(doc.uri.fsPath);
        }

        if(!doc.isUntitled) {
            const args = '"' + Utils.expansePath(doc.uri.fsPath) + '"';
            PerforceService.execute("opened", function(err, stdout, stderr) {
                if(err) {
                    // file not under client root
                    _statusBarItem.text = 'P4: $(circle-slash)';
                    _statusBarItem.tooltip = stderr.toString();
                }
                else if(stderr) {
                    // file not opened on client
                    _statusBarItem.text = 'P4: $(file-text)';
                    _statusBarItem.tooltip = stderr.toString();
                } else if(stdout) {
                    // file opened in add or edit
                    _statusBarItem.text = 'P4: $(check)';
                    _statusBarItem.tooltip = stdout.toString();
                }
            }, args, directoryOverride);
            _statusBarItem.show();
        } else {
            _statusBarItem.hide();
        }
    }
開發者ID:hoovercj,項目名稱:vscode-perforce,代碼行數:38,代碼來源:Display.ts

示例10: refresh

 refresh(document: string) {
     let visible = true;
     if (this.include) {
         console.log(this.include.source);
         visible = document && this.include.test(document);
     }
     if (this.exclude) {
         visible = document && !this.exclude.test(document);
     }
     if (visible) {
         this.button.show();
     } else {
         this.button.hide();
     }
 }
開發者ID:AnWeber,項目名稱:vscode-statusbar-command,代碼行數:15,代碼來源:command.ts


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