Skip to content

Commit 6b6e73b

Browse files
committed
Prefer using template strings instead of strings.format
1 parent 90416b8 commit 6b6e73b

4 files changed

Lines changed: 7 additions & 8 deletions

File tree

src/vs/editor/contrib/codelens/codelensWidget.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import 'vs/css!./codelensWidget';
77
import * as dom from 'vs/base/browser/dom';
88
import { coalesce, isFalsyOrEmpty } from 'vs/base/common/arrays';
9-
import { escape, format } from 'vs/base/common/strings';
9+
import { escape } from 'vs/base/common/strings';
1010
import * as editorBrowser from 'vs/editor/browser/editorBrowser';
1111
import { Range } from 'vs/editor/common/core/range';
1212
import { IModelDecorationsChangeAccessor, IModelDeltaDecoration, ITextModel } from 'vs/editor/common/model';
@@ -109,10 +109,10 @@ class CodeLensContentWidget implements editorBrowser.IContentWidget {
109109
let title = escape(command.title);
110110
let part: string;
111111
if (command.id) {
112-
part = format('<a id={0}>{1}</a>', i, title);
112+
part = `<a id=${i}>${title}</a>`;
113113
this._commands[i] = command;
114114
} else {
115-
part = format('<span>{0}</span>', title);
115+
part = `<span>${title}</span>`;
116116
}
117117
html.push(part);
118118
}

src/vs/editor/contrib/referenceSearch/peekViewWidget.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,11 +186,11 @@ export abstract class PeekViewWidget extends ZoneWidget {
186186
}
187187

188188
protected _doLayoutHead(heightInPixel: number, widthInPixel: number): void {
189-
this._headElement.style.height = strings.format('{0}px', heightInPixel);
189+
this._headElement.style.height = `${heightInPixel}px`;
190190
this._headElement.style.lineHeight = this._headElement.style.height;
191191
}
192192

193193
protected _doLayoutBody(heightInPixel: number, widthInPixel: number): void {
194-
this._bodyElement.style.height = strings.format('{0}px', heightInPixel);
194+
this._bodyElement.style.height = `${heightInPixel}px`;
195195
}
196196
}

src/vs/workbench/browser/parts/compositePart.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ export abstract class CompositePart<T extends Composite> extends Part {
183183
return composite;
184184
}
185185

186-
throw new Error(strings.format('Unable to find composite with id {0}', id));
186+
throw new Error(`Unable to find composite with id ${id}`);
187187
}
188188

189189
protected showComposite(composite: Composite): void {

src/vs/workbench/services/files/node/watcher/unix/chokidarWatcherService.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import * as paths from 'vs/base/common/paths';
1111
import * as glob from 'vs/base/common/glob';
1212
import { FileChangeType } from 'vs/platform/files/common/files';
1313
import { ThrottledDelayer } from 'vs/base/common/async';
14-
import * as strings from 'vs/base/common/strings';
1514
import { normalizeNFC } from 'vs/base/common/normalization';
1615
import { realcaseSync } from 'vs/base/node/extfs';
1716
import { isMacintosh } from 'vs/base/common/platform';
@@ -220,7 +219,7 @@ export class ChokidarWatcherService implements IWatcherService {
220219
this.spamCheckStartTime = now;
221220
} else if (!this.spamWarningLogged && this.spamCheckStartTime + ChokidarWatcherService.EVENT_SPAM_WARNING_THRESHOLD < now) {
222221
this.spamWarningLogged = true;
223-
console.warn(strings.format('Watcher is busy catching up with {0} file changes in 60 seconds. Latest changed path is "{1}"', undeliveredFileEvents.length, event.path));
222+
console.warn(`Watcher is busy catching up with ${undeliveredFileEvents.length} file changes in 60 seconds. Latest changed path is "${event.path}"`);
224223
}
225224

226225
// Add to buffer

0 commit comments

Comments
 (0)