本文整理匯總了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();
}
}
示例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();
}
}
示例3: hide
public hide(): void {
if (this.interval !== undefined) {
clearInterval(this.interval);
this.interval = undefined;
}
this.stopStatusBarItem.hide();
this.spinnerStatusBarItem.hide();
}
示例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();
}
}
示例5: removeStatusBarItem
function removeStatusBarItem() {
if (statusBarItem) {
statusBarItem.hide();
statusBarItem.dispose();
statusBarItem = null;
}
isStatusBarVisible = false;
}
示例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();
}
}
示例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();
}
}
示例8: updateStatus
function updateStatus(status: StatusBarItem): void {
let text = getSelectedLines();
if (text) {
status.text = '$(megaphone) ' + text;
}
if (text) {
status.show();
} else {
status.hide();
}
}
示例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();
}
}
示例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();
}
}