From ec3e57e946cd7b02e58ebedfb95a6fc31a5c016f Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Fri, 23 Feb 2018 17:02:13 -0800 Subject: [PATCH] Remove TS 2.6.1 import path workaround since this was fixed in TS 2.6.2+ --- .../src/features/completionItemProvider.ts | 23 +++---------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/extensions/typescript/src/features/completionItemProvider.ts b/extensions/typescript/src/features/completionItemProvider.ts index acea652ff2c..bc4a1304162 100644 --- a/extensions/typescript/src/features/completionItemProvider.ts +++ b/extensions/typescript/src/features/completionItemProvider.ts @@ -418,26 +418,9 @@ export default class TypeScriptCompletionItemProvider implements vscode.Completi ): vscode.MarkdownString | undefined { const documentation = new vscode.MarkdownString(); if (detail.source) { - let importPath = `'${Previewer.plain(detail.source)}'`; - if (this.client.apiVersion.has260Features() && !this.client.apiVersion.has262Features()) { - // Try to resolve the real import name that will be added - if (detail.codeActions && detail.codeActions[0]) { - const action = detail.codeActions[0]; - if (action.changes[0] && action.changes[0].textChanges[0]) { - const textChange = action.changes[0].textChanges[0]; - const matchedImport = textChange.newText.match(/(['"])(.+?)\1/); - if (matchedImport) { - importPath = matchedImport[0]; - item.detail += ` — from ${matchedImport[0]}`; - } - } - } - documentation.appendMarkdown(localize('autoImportLabel', 'Auto import from {0}', importPath)); - } else { - const autoImportLabel = localize('autoImportLabel', 'Auto import from {0}', importPath); - item.detail = `${autoImportLabel}\n${item.detail}`; - } - documentation.appendMarkdown('\n\n'); + const importPath = `'${Previewer.plain(detail.source)}'`; + const autoImportLabel = localize('autoImportLabel', 'Auto import from {0}', importPath); + item.detail = `${autoImportLabel}\n${item.detail}`; } Previewer.addMarkdownDocumentation(documentation, detail.documentation, detail.tags);