Skip to content

Commit b2f5dd5

Browse files
committed
ref #11 Let Prettier to autoformat
1 parent aade704 commit b2f5dd5

File tree

4 files changed

+50
-13
lines changed

4 files changed

+50
-13
lines changed

lib/bootstrapper.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ class Bootstrapper {
2121
}
2222

2323
_registerCommands (context) {
24-
this._commandList.forEach(command => {
25-
const registerer = this._getCommandRegisterer(command.type)
26-
const disposable = registerer(command.name, command.command.execute, command.command)
24+
this._commandList.forEach(cmd => {
25+
const registerer = this._getCommandRegisterer(cmd.type)
26+
const disposable = registerer(cmd.name, cmd.command.execute, cmd.command)
2727
context.subscriptions.push(disposable)
2828
})
2929
}

lib/message-bar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
class MessageBar {
2-
constructor ({vscWindow}) {
2+
constructor ({ vscWindow }) {
33
this.vscWindow = vscWindow
44
}
55

lib/text-process-rule-applier.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ class TextProcessRuleApplier {
1818
_applyRuleToText (rule, text) {
1919
const pattern = new RegExp(rule.match, 'g')
2020

21-
if (typeof rule.replaceWith === 'string') { return text.replace(pattern, rule.replaceWith) }
21+
if (typeof rule.replaceWith === 'string') {
22+
return text.replace(pattern, rule.replaceWith)
23+
}
2224

2325
return text.replace(pattern, matched => {
2426
switch (rule.replaceWith.letterCase) {

test/lib/bootstrapper.test.js

Lines changed: 43 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,29 +33,64 @@ suite('Bootstrapper', () => {
3333

3434
function fakeVSCodeCommands () {
3535
const commands = td.object(['registerCommand', 'registerTextEditorCommand'])
36-
td.when(commands.registerCommand('extension.partialDiff.diffVisibleEditors', commandMap.compareVisibleEditorsCommand.execute, commandMap.compareVisibleEditorsCommand))
36+
td
37+
.when(
38+
commands.registerCommand(
39+
'extension.partialDiff.diffVisibleEditors',
40+
commandMap.compareVisibleEditorsCommand.execute,
41+
commandMap.compareVisibleEditorsCommand
42+
)
43+
)
3744
.thenReturn('DISPOSABLE_diffVisibleEditors')
38-
td.when(commands.registerTextEditorCommand('extension.partialDiff.markSection1', commandMap.saveText1Command.execute, commandMap.saveText1Command))
45+
td
46+
.when(
47+
commands.registerTextEditorCommand(
48+
'extension.partialDiff.markSection1',
49+
commandMap.saveText1Command.execute,
50+
commandMap.saveText1Command
51+
)
52+
)
3953
.thenReturn('DISPOSABLE_markSection1')
40-
td.when(commands.registerTextEditorCommand('extension.partialDiff.markSection2AndTakeDiff', commandMap.compareSelectionWithText1Command.execute, commandMap.compareSelectionWithText1Command))
54+
td
55+
.when(
56+
commands.registerTextEditorCommand(
57+
'extension.partialDiff.markSection2AndTakeDiff',
58+
commandMap.compareSelectionWithText1Command.execute,
59+
commandMap.compareSelectionWithText1Command
60+
)
61+
)
4162
.thenReturn('DISPOSABLE_markSection2AndTakeDiff')
42-
td.when(commands.registerTextEditorCommand('extension.partialDiff.diffSelectionWithClipboard', commandMap.compareSelectionWithClipboardCommand.execute, commandMap.compareSelectionWithClipboardCommand))
63+
td
64+
.when(
65+
commands.registerTextEditorCommand(
66+
'extension.partialDiff.diffSelectionWithClipboard',
67+
commandMap.compareSelectionWithClipboardCommand.execute,
68+
commandMap.compareSelectionWithClipboardCommand
69+
)
70+
)
4371
.thenReturn('DISPOSABLE_diffSelectionWithClipboard')
4472
return commands
4573
}
4674

4775
function fakeCommandFactory () {
4876
return {
4977
crateSaveText1Command: () => commandMap.saveText1Command,
50-
createCompareSelectionWithText1Command: () => commandMap.compareSelectionWithText1Command,
51-
createCompareSelectionWithClipboardCommand: () => commandMap.compareSelectionWithClipboardCommand,
52-
createCompareVisibleEditorsCommand: () => commandMap.compareVisibleEditorsCommand
78+
createCompareSelectionWithText1Command: () =>
79+
commandMap.compareSelectionWithText1Command,
80+
createCompareSelectionWithClipboardCommand: () =>
81+
commandMap.compareSelectionWithClipboardCommand,
82+
createCompareVisibleEditorsCommand: () =>
83+
commandMap.compareVisibleEditorsCommand
5384
}
5485
}
5586

5687
function fakeVSCodeWorkspace () {
5788
const registerTextDocumentContentProvider = td.function()
58-
td.when(registerTextDocumentContentProvider('partialdiff', 'CONTENT_PROVIDER')).thenReturn('DISPOSABLE_scheme')
89+
td
90+
.when(
91+
registerTextDocumentContentProvider('partialdiff', 'CONTENT_PROVIDER')
92+
)
93+
.thenReturn('DISPOSABLE_scheme')
5994
return { registerTextDocumentContentProvider }
6095
}
6196

0 commit comments

Comments
 (0)