From 683d2f19f17380a034970b71d4144f7983df3bf0 Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Mon, 24 Jan 2022 11:43:14 +0100 Subject: [PATCH] reenable 'vscode API - languages - link detector' Fixes #140878 --- .../src/singlefolder-tests/languages.test.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/extensions/vscode-api-tests/src/singlefolder-tests/languages.test.ts b/extensions/vscode-api-tests/src/singlefolder-tests/languages.test.ts index 8535e3a4bab4c..b61cb898de99a 100644 --- a/extensions/vscode-api-tests/src/singlefolder-tests/languages.test.ts +++ b/extensions/vscode-api-tests/src/singlefolder-tests/languages.test.ts @@ -96,7 +96,7 @@ suite('vscode API - languages', () => { assert.ok(found); }); - test.skip('link detector', async function () { // #140878 + test('link detector', async function () { // #140878 const uri = await createRandomFile('class A { // http://a.com }', undefined, '.java'); const doc = await vscode.workspace.openTextDocument(uri); @@ -111,14 +111,14 @@ suite('vscode API - languages', () => { vscode.languages.registerDocumentLinkProvider({ language: 'java', scheme: testFs.scheme }, linkProvider); const links = await vscode.commands.executeCommand('vscode.executeLinkProvider', doc.uri); - assert.strictEqual(2, links && links.length); + assert.strictEqual(links && links.length, 2, links.map(l => !l.target).join(', ')); let [link1, link2] = links!.sort((l1, l2) => l1.range.start.compareTo(l2.range.start)); - assert.strictEqual(target.toString(), link1.target && link1.target.toString()); - assertEqualRange(range, link1.range); + assert.strictEqual(link1.target && link1.target.toString(), target.toString()); + assertEqualRange(link1.range, range); - assert.strictEqual('http://a.com/', link2.target && link2.target.toString()); - assertEqualRange(new vscode.Range(new vscode.Position(0, 13), new vscode.Position(0, 25)), link2.range); + assert.strictEqual(link2.target && link2.target.toString(), 'http://a.com/'); + assertEqualRange(link2.range, new vscode.Range(new vscode.Position(0, 13), new vscode.Position(0, 25))); }); test('diagnostics & CodeActionProvider', async function () {