提交 dece5329 编写于 作者: M Matt Bierner

Prefix unused with _

上级 90041e8b
...@@ -58,7 +58,7 @@ suite('Tests for Expand Abbreviations (HTML)', () => { ...@@ -58,7 +58,7 @@ suite('Tests for Expand Abbreviations (HTML)', () => {
}); });
test('Expand snippets when no parent node (HTML)', () => { test('Expand snippets when no parent node (HTML)', () => {
return withRandomFileEditor('img', 'html', async (editor, doc) => { return withRandomFileEditor('img', 'html', async (editor, _doc) => {
editor.selection = new Selection(0, 3, 0, 3); editor.selection = new Selection(0, 3, 0, 3);
await expandEmmetAbbreviation(null); await expandEmmetAbbreviation(null);
assert.equal(editor.document.getText(), '<img src=\"\" alt=\"\">'); assert.equal(editor.document.getText(), '<img src=\"\" alt=\"\">');
...@@ -67,7 +67,7 @@ suite('Tests for Expand Abbreviations (HTML)', () => { ...@@ -67,7 +67,7 @@ suite('Tests for Expand Abbreviations (HTML)', () => {
}); });
test('Expand snippets when no parent node in completion list (HTML)', () => { test('Expand snippets when no parent node in completion list (HTML)', () => {
return withRandomFileEditor('img', 'html', async (editor, doc) => { return withRandomFileEditor('img', 'html', async (editor, _doc) => {
editor.selection = new Selection(0, 3, 0, 3); editor.selection = new Selection(0, 3, 0, 3);
const cancelSrc = new CancellationTokenSource(); const cancelSrc = new CancellationTokenSource();
const completionPromise = completionProvider.provideCompletionItems(editor.document, editor.selection.active, cancelSrc.token, { triggerKind: CompletionTriggerKind.Invoke }); const completionPromise = completionProvider.provideCompletionItems(editor.document, editor.selection.active, cancelSrc.token, { triggerKind: CompletionTriggerKind.Invoke });
...@@ -158,7 +158,7 @@ suite('Tests for Expand Abbreviations (HTML)', () => { ...@@ -158,7 +158,7 @@ suite('Tests for Expand Abbreviations (HTML)', () => {
}); });
test('No expanding text inside open tag (HTML)', () => { test('No expanding text inside open tag (HTML)', () => {
return withRandomFileEditor(htmlContents, 'html', async (editor, doc) => { return withRandomFileEditor(htmlContents, 'html', async (editor, _doc) => {
editor.selection = new Selection(2, 4, 2, 4); editor.selection = new Selection(2, 4, 2, 4);
await expandEmmetAbbreviation(null); await expandEmmetAbbreviation(null);
assert.equal(editor.document.getText(), htmlContents); assert.equal(editor.document.getText(), htmlContents);
...@@ -167,7 +167,7 @@ suite('Tests for Expand Abbreviations (HTML)', () => { ...@@ -167,7 +167,7 @@ suite('Tests for Expand Abbreviations (HTML)', () => {
}); });
test('No expanding text inside open tag in completion list (HTML)', () => { test('No expanding text inside open tag in completion list (HTML)', () => {
return withRandomFileEditor(htmlContents, 'html', (editor, doc) => { return withRandomFileEditor(htmlContents, 'html', (editor, _doc) => {
editor.selection = new Selection(2, 4, 2, 4); editor.selection = new Selection(2, 4, 2, 4);
const cancelSrc = new CancellationTokenSource(); const cancelSrc = new CancellationTokenSource();
const completionPromise = completionProvider.provideCompletionItems(editor.document, editor.selection.active, cancelSrc.token, { triggerKind: CompletionTriggerKind.Invoke }); const completionPromise = completionProvider.provideCompletionItems(editor.document, editor.selection.active, cancelSrc.token, { triggerKind: CompletionTriggerKind.Invoke });
...@@ -177,7 +177,7 @@ suite('Tests for Expand Abbreviations (HTML)', () => { ...@@ -177,7 +177,7 @@ suite('Tests for Expand Abbreviations (HTML)', () => {
}); });
test('No expanding text inside open tag when there is no closing tag (HTML)', () => { test('No expanding text inside open tag when there is no closing tag (HTML)', () => {
return withRandomFileEditor(htmlContents, 'html', async (editor, doc) => { return withRandomFileEditor(htmlContents, 'html', async (editor, _doc) => {
editor.selection = new Selection(9, 8, 9, 8); editor.selection = new Selection(9, 8, 9, 8);
await expandEmmetAbbreviation(null); await expandEmmetAbbreviation(null);
assert.equal(editor.document.getText(), htmlContents); assert.equal(editor.document.getText(), htmlContents);
...@@ -186,7 +186,7 @@ suite('Tests for Expand Abbreviations (HTML)', () => { ...@@ -186,7 +186,7 @@ suite('Tests for Expand Abbreviations (HTML)', () => {
}); });
test('No expanding text inside open tag when there is no closing tag in completion list (HTML)', () => { test('No expanding text inside open tag when there is no closing tag in completion list (HTML)', () => {
return withRandomFileEditor(htmlContents, 'html', (editor, doc) => { return withRandomFileEditor(htmlContents, 'html', (editor, _doc) => {
editor.selection = new Selection(9, 8, 9, 8); editor.selection = new Selection(9, 8, 9, 8);
const cancelSrc = new CancellationTokenSource(); const cancelSrc = new CancellationTokenSource();
const completionPromise = completionProvider.provideCompletionItems(editor.document, editor.selection.active, cancelSrc.token, { triggerKind: CompletionTriggerKind.Invoke }); const completionPromise = completionProvider.provideCompletionItems(editor.document, editor.selection.active, cancelSrc.token, { triggerKind: CompletionTriggerKind.Invoke });
...@@ -197,7 +197,7 @@ suite('Tests for Expand Abbreviations (HTML)', () => { ...@@ -197,7 +197,7 @@ suite('Tests for Expand Abbreviations (HTML)', () => {
test('No expanding text inside open tag when there is no closing tag when there is no parent node (HTML)', () => { test('No expanding text inside open tag when there is no closing tag when there is no parent node (HTML)', () => {
const fileContents = '<img s'; const fileContents = '<img s';
return withRandomFileEditor(fileContents, 'html', async (editor, doc) => { return withRandomFileEditor(fileContents, 'html', async (editor, _doc) => {
editor.selection = new Selection(0, 6, 0, 6); editor.selection = new Selection(0, 6, 0, 6);
await expandEmmetAbbreviation(null); await expandEmmetAbbreviation(null);
assert.equal(editor.document.getText(), fileContents); assert.equal(editor.document.getText(), fileContents);
...@@ -207,7 +207,7 @@ suite('Tests for Expand Abbreviations (HTML)', () => { ...@@ -207,7 +207,7 @@ suite('Tests for Expand Abbreviations (HTML)', () => {
test('No expanding text in completion list inside open tag when there is no closing tag when there is no parent node (HTML)', () => { test('No expanding text in completion list inside open tag when there is no closing tag when there is no parent node (HTML)', () => {
const fileContents = '<img s'; const fileContents = '<img s';
return withRandomFileEditor(fileContents, 'html', (editor, doc) => { return withRandomFileEditor(fileContents, 'html', (editor, _doc) => {
editor.selection = new Selection(0, 6, 0, 6); editor.selection = new Selection(0, 6, 0, 6);
const cancelSrc = new CancellationTokenSource(); const cancelSrc = new CancellationTokenSource();
const completionPromise = completionProvider.provideCompletionItems(editor.document, editor.selection.active, cancelSrc.token, { triggerKind: CompletionTriggerKind.Invoke }); const completionPromise = completionProvider.provideCompletionItems(editor.document, editor.selection.active, cancelSrc.token, { triggerKind: CompletionTriggerKind.Invoke });
...@@ -217,7 +217,7 @@ suite('Tests for Expand Abbreviations (HTML)', () => { ...@@ -217,7 +217,7 @@ suite('Tests for Expand Abbreviations (HTML)', () => {
}); });
test('Expand css when inside style tag (HTML)', () => { test('Expand css when inside style tag (HTML)', () => {
return withRandomFileEditor(htmlContents, 'html', async (editor, doc) => { return withRandomFileEditor(htmlContents, 'html', async (editor, _doc) => {
editor.selection = new Selection(13, 16, 13, 19); editor.selection = new Selection(13, 16, 13, 19);
let expandPromise = expandEmmetAbbreviation({ language: 'css' }); let expandPromise = expandEmmetAbbreviation({ language: 'css' });
if (!expandPromise) { if (!expandPromise) {
...@@ -233,7 +233,7 @@ suite('Tests for Expand Abbreviations (HTML)', () => { ...@@ -233,7 +233,7 @@ suite('Tests for Expand Abbreviations (HTML)', () => {
const abbreviation = 'm10'; const abbreviation = 'm10';
const expandedText = 'margin: 10px;'; const expandedText = 'margin: 10px;';
return withRandomFileEditor(htmlContents, 'html', async (editor, doc) => { return withRandomFileEditor(htmlContents, 'html', async (editor, _doc) => {
editor.selection = new Selection(13, 16, 13, 19); editor.selection = new Selection(13, 16, 13, 19);
const cancelSrc = new CancellationTokenSource(); const cancelSrc = new CancellationTokenSource();
const completionPromise = completionProvider.provideCompletionItems(editor.document, editor.selection.active, cancelSrc.token, { triggerKind: CompletionTriggerKind.Invoke }); const completionPromise = completionProvider.provideCompletionItems(editor.document, editor.selection.active, cancelSrc.token, { triggerKind: CompletionTriggerKind.Invoke });
...@@ -256,7 +256,7 @@ suite('Tests for Expand Abbreviations (HTML)', () => { ...@@ -256,7 +256,7 @@ suite('Tests for Expand Abbreviations (HTML)', () => {
}); });
test('No expanding text inside style tag if position is not for property name (HTML)', () => { test('No expanding text inside style tag if position is not for property name (HTML)', () => {
return withRandomFileEditor(htmlContents, 'html', async (editor, doc) => { return withRandomFileEditor(htmlContents, 'html', async (editor, _doc) => {
editor.selection = new Selection(13, 14, 13, 14); editor.selection = new Selection(13, 14, 13, 14);
await expandEmmetAbbreviation(null); await expandEmmetAbbreviation(null);
assert.equal(editor.document.getText(), htmlContents); assert.equal(editor.document.getText(), htmlContents);
...@@ -265,7 +265,7 @@ suite('Tests for Expand Abbreviations (HTML)', () => { ...@@ -265,7 +265,7 @@ suite('Tests for Expand Abbreviations (HTML)', () => {
}); });
test('No expanding text in completion list inside style tag if position is not for property name (HTML)', () => { test('No expanding text in completion list inside style tag if position is not for property name (HTML)', () => {
return withRandomFileEditor(htmlContents, 'html', (editor, doc) => { return withRandomFileEditor(htmlContents, 'html', (editor, _doc) => {
editor.selection = new Selection(13, 14, 13, 14); editor.selection = new Selection(13, 14, 13, 14);
const cancelSrc = new CancellationTokenSource(); const cancelSrc = new CancellationTokenSource();
const completionPromise = completionProvider.provideCompletionItems(editor.document, editor.selection.active, cancelSrc.token, { triggerKind: CompletionTriggerKind.Invoke }); const completionPromise = completionProvider.provideCompletionItems(editor.document, editor.selection.active, cancelSrc.token, { triggerKind: CompletionTriggerKind.Invoke });
...@@ -276,7 +276,7 @@ suite('Tests for Expand Abbreviations (HTML)', () => { ...@@ -276,7 +276,7 @@ suite('Tests for Expand Abbreviations (HTML)', () => {
test('Expand css when inside style attribute (HTML)', () => { test('Expand css when inside style attribute (HTML)', () => {
const styleAttributeContent = '<div style="m10" class="hello"></div>'; const styleAttributeContent = '<div style="m10" class="hello"></div>';
return withRandomFileEditor(styleAttributeContent, 'html', async (editor, doc) => { return withRandomFileEditor(styleAttributeContent, 'html', async (editor, _doc) => {
editor.selection = new Selection(0, 15, 0, 15); editor.selection = new Selection(0, 15, 0, 15);
let expandPromise = expandEmmetAbbreviation(null); let expandPromise = expandEmmetAbbreviation(null);
if (!expandPromise) { if (!expandPromise) {
...@@ -292,7 +292,7 @@ suite('Tests for Expand Abbreviations (HTML)', () => { ...@@ -292,7 +292,7 @@ suite('Tests for Expand Abbreviations (HTML)', () => {
const abbreviation = 'm10'; const abbreviation = 'm10';
const expandedText = 'margin: 10px;'; const expandedText = 'margin: 10px;';
return withRandomFileEditor('<div style="m10" class="hello"></div>', 'html', async (editor, doc) => { return withRandomFileEditor('<div style="m10" class="hello"></div>', 'html', async (editor, _doc) => {
editor.selection = new Selection(0, 15, 0, 15); editor.selection = new Selection(0, 15, 0, 15);
const cancelSrc = new CancellationTokenSource(); const cancelSrc = new CancellationTokenSource();
const completionPromise = completionProvider.provideCompletionItems(editor.document, editor.selection.active, cancelSrc.token, { triggerKind: CompletionTriggerKind.Invoke }); const completionPromise = completionProvider.provideCompletionItems(editor.document, editor.selection.active, cancelSrc.token, { triggerKind: CompletionTriggerKind.Invoke });
...@@ -315,7 +315,7 @@ suite('Tests for Expand Abbreviations (HTML)', () => { ...@@ -315,7 +315,7 @@ suite('Tests for Expand Abbreviations (HTML)', () => {
}); });
test('Expand html when inside script tag with html type (HTML)', () => { test('Expand html when inside script tag with html type (HTML)', () => {
return withRandomFileEditor(htmlContents, 'html', async (editor, doc) => { return withRandomFileEditor(htmlContents, 'html', async (editor, _doc) => {
editor.selection = new Selection(21, 12, 21, 12); editor.selection = new Selection(21, 12, 21, 12);
let expandPromise = expandEmmetAbbreviation(null); let expandPromise = expandEmmetAbbreviation(null);
if (!expandPromise) { if (!expandPromise) {
...@@ -331,7 +331,7 @@ suite('Tests for Expand Abbreviations (HTML)', () => { ...@@ -331,7 +331,7 @@ suite('Tests for Expand Abbreviations (HTML)', () => {
const abbreviation = 'span.hello'; const abbreviation = 'span.hello';
const expandedText = '<span class="hello"></span>'; const expandedText = '<span class="hello"></span>';
return withRandomFileEditor(htmlContents, 'html', async (editor, doc) => { return withRandomFileEditor(htmlContents, 'html', async (editor, _doc) => {
editor.selection = new Selection(21, 12, 21, 12); editor.selection = new Selection(21, 12, 21, 12);
const cancelSrc = new CancellationTokenSource(); const cancelSrc = new CancellationTokenSource();
const completionPromise = completionProvider.provideCompletionItems(editor.document, editor.selection.active, cancelSrc.token, { triggerKind: CompletionTriggerKind.Invoke }); const completionPromise = completionProvider.provideCompletionItems(editor.document, editor.selection.active, cancelSrc.token, { triggerKind: CompletionTriggerKind.Invoke });
...@@ -353,7 +353,7 @@ suite('Tests for Expand Abbreviations (HTML)', () => { ...@@ -353,7 +353,7 @@ suite('Tests for Expand Abbreviations (HTML)', () => {
}); });
test('No expanding text inside script tag with javascript type (HTML)', () => { test('No expanding text inside script tag with javascript type (HTML)', () => {
return withRandomFileEditor(htmlContents, 'html', async (editor, doc) => { return withRandomFileEditor(htmlContents, 'html', async (editor, _doc) => {
editor.selection = new Selection(24, 12, 24, 12); editor.selection = new Selection(24, 12, 24, 12);
await expandEmmetAbbreviation(null); await expandEmmetAbbreviation(null);
assert.equal(editor.document.getText(), htmlContents); assert.equal(editor.document.getText(), htmlContents);
...@@ -362,7 +362,7 @@ suite('Tests for Expand Abbreviations (HTML)', () => { ...@@ -362,7 +362,7 @@ suite('Tests for Expand Abbreviations (HTML)', () => {
}); });
test('No expanding text in completion list inside script tag with javascript type (HTML)', () => { test('No expanding text in completion list inside script tag with javascript type (HTML)', () => {
return withRandomFileEditor(htmlContents, 'html', (editor, doc) => { return withRandomFileEditor(htmlContents, 'html', (editor, _doc) => {
editor.selection = new Selection(24, 12, 24, 12); editor.selection = new Selection(24, 12, 24, 12);
const cancelSrc = new CancellationTokenSource(); const cancelSrc = new CancellationTokenSource();
const completionPromise = completionProvider.provideCompletionItems(editor.document, editor.selection.active, cancelSrc.token, { triggerKind: CompletionTriggerKind.Invoke }); const completionPromise = completionProvider.provideCompletionItems(editor.document, editor.selection.active, cancelSrc.token, { triggerKind: CompletionTriggerKind.Invoke });
...@@ -373,7 +373,7 @@ suite('Tests for Expand Abbreviations (HTML)', () => { ...@@ -373,7 +373,7 @@ suite('Tests for Expand Abbreviations (HTML)', () => {
test('Expand html when inside script tag with javascript type if js is mapped to html (HTML)', async () => { test('Expand html when inside script tag with javascript type if js is mapped to html (HTML)', async () => {
await workspace.getConfiguration('emmet').update('includeLanguages', { "javascript": "html" }, ConfigurationTarget.Global); await workspace.getConfiguration('emmet').update('includeLanguages', { "javascript": "html" }, ConfigurationTarget.Global);
await withRandomFileEditor(htmlContents, 'html', async (editor, doc) => { await withRandomFileEditor(htmlContents, 'html', async (editor, _doc) => {
editor.selection = new Selection(24, 10, 24, 10); editor.selection = new Selection(24, 10, 24, 10);
let expandPromise = expandEmmetAbbreviation(null); let expandPromise = expandEmmetAbbreviation(null);
if (!expandPromise) { if (!expandPromise) {
...@@ -389,7 +389,7 @@ suite('Tests for Expand Abbreviations (HTML)', () => { ...@@ -389,7 +389,7 @@ suite('Tests for Expand Abbreviations (HTML)', () => {
const abbreviation = 'span.bye'; const abbreviation = 'span.bye';
const expandedText = '<span class="bye"></span>'; const expandedText = '<span class="bye"></span>';
await workspace.getConfiguration('emmet').update('includeLanguages', { "javascript": "html" }, ConfigurationTarget.Global); await workspace.getConfiguration('emmet').update('includeLanguages', { "javascript": "html" }, ConfigurationTarget.Global);
await withRandomFileEditor(htmlContents, 'html', async (editor, doc) => { await withRandomFileEditor(htmlContents, 'html', async (editor, _doc) => {
editor.selection = new Selection(24, 10, 24, 10); editor.selection = new Selection(24, 10, 24, 10);
const cancelSrc = new CancellationTokenSource(); const cancelSrc = new CancellationTokenSource();
const completionPromise = completionProvider.provideCompletionItems(editor.document, editor.selection.active, cancelSrc.token, { triggerKind: CompletionTriggerKind.Invoke }); const completionPromise = completionProvider.provideCompletionItems(editor.document, editor.selection.active, cancelSrc.token, { triggerKind: CompletionTriggerKind.Invoke });
...@@ -440,7 +440,7 @@ suite('Tests for jsx, xml and xsl', () => { ...@@ -440,7 +440,7 @@ suite('Tests for jsx, xml and xsl', () => {
teardown(closeAllEditors); teardown(closeAllEditors);
test('Expand abbreviation with className instead of class in jsx', () => { test('Expand abbreviation with className instead of class in jsx', () => {
return withRandomFileEditor('ul.nav', 'javascriptreact', async (editor, doc) => { return withRandomFileEditor('ul.nav', 'javascriptreact', async (editor, _doc) => {
editor.selection = new Selection(0, 6, 0, 6); editor.selection = new Selection(0, 6, 0, 6);
await expandEmmetAbbreviation({ language: 'javascriptreact' }); await expandEmmetAbbreviation({ language: 'javascriptreact' });
assert.equal(editor.document.getText(), '<ul className="nav"></ul>'); assert.equal(editor.document.getText(), '<ul className="nav"></ul>');
...@@ -449,7 +449,7 @@ suite('Tests for jsx, xml and xsl', () => { ...@@ -449,7 +449,7 @@ suite('Tests for jsx, xml and xsl', () => {
}); });
test('Expand abbreviation with self closing tags for jsx', () => { test('Expand abbreviation with self closing tags for jsx', () => {
return withRandomFileEditor('img', 'javascriptreact', async (editor, doc) => { return withRandomFileEditor('img', 'javascriptreact', async (editor, _doc) => {
editor.selection = new Selection(0, 6, 0, 6); editor.selection = new Selection(0, 6, 0, 6);
await expandEmmetAbbreviation({ language: 'javascriptreact' }); await expandEmmetAbbreviation({ language: 'javascriptreact' });
assert.equal(editor.document.getText(), '<img src="" alt=""/>'); assert.equal(editor.document.getText(), '<img src="" alt=""/>');
...@@ -459,7 +459,7 @@ suite('Tests for jsx, xml and xsl', () => { ...@@ -459,7 +459,7 @@ suite('Tests for jsx, xml and xsl', () => {
test('Expand abbreviation with single quotes for jsx', async () => { test('Expand abbreviation with single quotes for jsx', async () => {
await workspace.getConfiguration('emmet').update('syntaxProfiles', { jsx: { "attr_quotes": "single" } }, ConfigurationTarget.Global); await workspace.getConfiguration('emmet').update('syntaxProfiles', { jsx: { "attr_quotes": "single" } }, ConfigurationTarget.Global);
return withRandomFileEditor('img', 'javascriptreact', async (editor, doc) => { return withRandomFileEditor('img', 'javascriptreact', async (editor, _doc) => {
editor.selection = new Selection(0, 6, 0, 6); editor.selection = new Selection(0, 6, 0, 6);
await expandEmmetAbbreviation({ language: 'javascriptreact' }); await expandEmmetAbbreviation({ language: 'javascriptreact' });
assert.equal(editor.document.getText(), '<img src=\'\' alt=\'\'/>'); assert.equal(editor.document.getText(), '<img src=\'\' alt=\'\'/>');
...@@ -468,7 +468,7 @@ suite('Tests for jsx, xml and xsl', () => { ...@@ -468,7 +468,7 @@ suite('Tests for jsx, xml and xsl', () => {
}); });
test('Expand abbreviation with self closing tags for xml', () => { test('Expand abbreviation with self closing tags for xml', () => {
return withRandomFileEditor('img', 'xml', async (editor, doc) => { return withRandomFileEditor('img', 'xml', async (editor, _doc) => {
editor.selection = new Selection(0, 6, 0, 6); editor.selection = new Selection(0, 6, 0, 6);
await expandEmmetAbbreviation({ language: 'xml' }); await expandEmmetAbbreviation({ language: 'xml' });
assert.equal(editor.document.getText(), '<img src="" alt=""/>'); assert.equal(editor.document.getText(), '<img src="" alt=""/>');
...@@ -477,7 +477,7 @@ suite('Tests for jsx, xml and xsl', () => { ...@@ -477,7 +477,7 @@ suite('Tests for jsx, xml and xsl', () => {
}); });
test('Expand abbreviation with no self closing tags for html', () => { test('Expand abbreviation with no self closing tags for html', () => {
return withRandomFileEditor('img', 'html', async (editor, doc) => { return withRandomFileEditor('img', 'html', async (editor, _doc) => {
editor.selection = new Selection(0, 6, 0, 6); editor.selection = new Selection(0, 6, 0, 6);
await expandEmmetAbbreviation({ language: 'html' }); await expandEmmetAbbreviation({ language: 'html' });
assert.equal(editor.document.getText(), '<img src="" alt="">'); assert.equal(editor.document.getText(), '<img src="" alt="">');
...@@ -486,7 +486,7 @@ suite('Tests for jsx, xml and xsl', () => { ...@@ -486,7 +486,7 @@ suite('Tests for jsx, xml and xsl', () => {
}); });
test('Expand abbreviation with condition containing less than sign for jsx', () => { test('Expand abbreviation with condition containing less than sign for jsx', () => {
return withRandomFileEditor('if (foo < 10) { span.bar', 'javascriptreact', async (editor, doc) => { return withRandomFileEditor('if (foo < 10) { span.bar', 'javascriptreact', async (editor, _doc) => {
editor.selection = new Selection(0, 27, 0, 27); editor.selection = new Selection(0, 27, 0, 27);
await expandEmmetAbbreviation({ language: 'javascriptreact' }); await expandEmmetAbbreviation({ language: 'javascriptreact' });
assert.equal(editor.document.getText(), 'if (foo < 10) { <span className="bar"></span>'); assert.equal(editor.document.getText(), 'if (foo < 10) { <span className="bar"></span>');
...@@ -513,7 +513,7 @@ suite('Tests for jsx, xml and xsl', () => { ...@@ -513,7 +513,7 @@ suite('Tests for jsx, xml and xsl', () => {
}); });
function testExpandAbbreviation(syntax: string, selection: Selection, abbreviation: string, expandedText: string, shouldFail?: boolean): Thenable<any> { function testExpandAbbreviation(syntax: string, selection: Selection, abbreviation: string, expandedText: string, shouldFail?: boolean): Thenable<any> {
return withRandomFileEditor(htmlContents, syntax, async (editor, doc) => { return withRandomFileEditor(htmlContents, syntax, async (editor, _doc) => {
editor.selection = selection; editor.selection = selection;
let expandPromise = expandEmmetAbbreviation(null); let expandPromise = expandEmmetAbbreviation(null);
if (!expandPromise) { if (!expandPromise) {
...@@ -529,7 +529,7 @@ function testExpandAbbreviation(syntax: string, selection: Selection, abbreviati ...@@ -529,7 +529,7 @@ function testExpandAbbreviation(syntax: string, selection: Selection, abbreviati
} }
function testHtmlCompletionProvider(selection: Selection, abbreviation: string, expandedText: string, shouldFail?: boolean): Thenable<any> { function testHtmlCompletionProvider(selection: Selection, abbreviation: string, expandedText: string, shouldFail?: boolean): Thenable<any> {
return withRandomFileEditor(htmlContents, 'html', async (editor, doc) => { return withRandomFileEditor(htmlContents, 'html', async (editor, _doc) => {
editor.selection = selection; editor.selection = selection;
const cancelSrc = new CancellationTokenSource(); const cancelSrc = new CancellationTokenSource();
const completionPromise = completionProvider.provideCompletionItems(editor.document, editor.selection.active, cancelSrc.token, { triggerKind: CompletionTriggerKind.Invoke }); const completionPromise = completionProvider.provideCompletionItems(editor.document, editor.selection.active, cancelSrc.token, { triggerKind: CompletionTriggerKind.Invoke });
...@@ -555,7 +555,7 @@ function testHtmlCompletionProvider(selection: Selection, abbreviation: string, ...@@ -555,7 +555,7 @@ function testHtmlCompletionProvider(selection: Selection, abbreviation: string,
} }
function testNoCompletion(syntax: string, fileContents: string, selection: Selection): Thenable<any> { function testNoCompletion(syntax: string, fileContents: string, selection: Selection): Thenable<any> {
return withRandomFileEditor(fileContents, syntax, (editor, doc) => { return withRandomFileEditor(fileContents, syntax, (editor, _doc) => {
editor.selection = selection; editor.selection = selection;
const cancelSrc = new CancellationTokenSource(); const cancelSrc = new CancellationTokenSource();
const completionPromise = completionProvider.provideCompletionItems(editor.document, editor.selection.active, cancelSrc.token, { triggerKind: CompletionTriggerKind.Invoke }); const completionPromise = completionProvider.provideCompletionItems(editor.document, editor.selection.active, cancelSrc.token, { triggerKind: CompletionTriggerKind.Invoke });
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册