本文整理汇总了TypeScript中vs/base/common/strings.format函数的典型用法代码示例。如果您正苦于以下问题:TypeScript format函数的具体用法?TypeScript format怎么用?TypeScript format使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了format函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: testLink
supportedLinkFormats.forEach(linkFormatInfo => {
// console.log('linkFormatInfo: ', linkFormatInfo);
testLink(
strings.format(linkFormatInfo.urlFormat, linkUrl, linkFormatInfo.line, linkFormatInfo.column),
linkUrl,
linkFormatInfo.line,
linkFormatInfo.column
);
});
开发者ID:VishalMadhvani,项目名称:vscode,代码行数:9,代码来源:terminalLinkHandler.test.ts
示例2: getPS1
getPS1(): string {
if (!this.HEAD) {
return '';
}
var label = this.HEAD.name || this.HEAD.commit.substr(0, 8);
var statusSummary = this.getStatus().getSummary();
return format('{0}{1}{2}{3}',
label,
statusSummary.hasWorkingTreeChanges ? '*' : '',
statusSummary.hasIndexChanges ? '+' : '',
statusSummary.hasMergeChanges ? '!' : ''
);
}
开发者ID:asotog,项目名称:vscode,代码行数:15,代码来源:gitModel.ts
示例3: getPS1
getPS1(): string {
if (!this.HEAD) {
return '';
}
const tag = this.getRefs().filter(iref => iref.type === RefType.Tag && iref.commit === this.HEAD.commit)[0];
const tagName = tag && tag.name;
const head = this.HEAD.name || tagName || this.HEAD.commit.substr(0, 8);
const statusSummary = this.getStatus().getSummary();
return format('{0}{1}{2}{3}',
head,
statusSummary.hasWorkingTreeChanges ? '*' : '',
statusSummary.hasIndexChanges ? '+' : '',
statusSummary.hasMergeChanges ? '!' : ''
);
}
开发者ID:StateFarmIns,项目名称:vscode,代码行数:18,代码来源:gitModel.ts
示例4: render
private render() {
this.element.textContent = '' + this.count;
this.element.title = format(this.titleFormat, this.count);
this.applyStyles();
}
开发者ID:hungys,项目名称:vscode,代码行数:6,代码来源:countBadge.ts
示例5: getAriaLabel
public getAriaLabel(): string {
return strings.format(QuickOutlineNLS.entryAriaLabel, this.name);
}
开发者ID:PKRoma,项目名称:vscode,代码行数:3,代码来源:quickOutline.ts
示例6: toQuickOpenEntries
private toQuickOpenEntries(editor: ICodeEditor, flattened: DocumentSymbol[], searchValue: string): SymbolEntry[] {
const controller = this.getController(editor);
let results: SymbolEntry[] = [];
// Convert to Entries
let normalizedSearchValue = searchValue;
if (searchValue.indexOf(SCOPE_PREFIX) === 0) {
normalizedSearchValue = normalizedSearchValue.substr(SCOPE_PREFIX.length);
}
for (const element of flattened) {
let label = strings.trim(element.name);
// Check for meatch
let highlights = matchesFuzzy(normalizedSearchValue, label);
if (highlights) {
// Show parent scope as description
let description: string | undefined = undefined;
if (element.containerName) {
description = element.containerName;
}
// Add
results.push(this.symbolEntry(label, symbolKindToCssClass(element.kind), description, element.range, highlights, editor, controller));
}
}
// Sort properly if actually searching
if (searchValue) {
if (searchValue.indexOf(SCOPE_PREFIX) === 0) {
results = results.sort(this.sortScoped.bind(this, searchValue.toLowerCase()));
} else {
results = results.sort(this.sortNormal.bind(this, searchValue.toLowerCase()));
}
}
// Mark all type groups
if (results.length > 0 && searchValue.indexOf(SCOPE_PREFIX) === 0) {
let currentType: string | null = null;
let currentResult: SymbolEntry | null = null;
let typeCounter = 0;
for (let i = 0; i < results.length; i++) {
let result = results[i];
// Found new type
if (currentType !== result.getType()) {
// Update previous result with count
if (currentResult) {
currentResult.setGroupLabel(this.typeToLabel(currentType || '', typeCounter));
}
currentType = result.getType();
currentResult = result;
typeCounter = 1;
result.setShowBorder(i > 0);
}
// Existing type, keep counting
else {
typeCounter++;
}
}
// Update previous result with count
if (currentResult) {
currentResult.setGroupLabel(this.typeToLabel(currentType || '', typeCounter));
}
}
// Mark first entry as outline
else if (results.length > 0) {
results[0].setGroupLabel(strings.format(QuickOutlineNLS._symbols_, results.length));
}
return results;
}
开发者ID:PKRoma,项目名称:vscode,代码行数:81,代码来源:quickOutline.ts
注:本文中的vs/base/common/strings.format函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论