From 5b284c140c06d1670267bbbc4eb660ba01a30a9d Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 4 Feb 2020 14:19:16 -0800 Subject: [PATCH] Build TS extension against current vscode.d.ts directly Currently extensions like TS have a dev dependency on the `"vscode"` package. This pulls in a copy of `vscode.d.ts` that we end up using instead of our local `vscode.d.ts`. This change uses the `paths` `tsconig` option so that we use our local `vscode.d.ts` instead of the one from `node_modules` --- .../src/features/jsDocCompletions.ts | 2 +- .../typescript-language-features/src/typings/ref.d.ts | 1 - extensions/typescript-language-features/tsconfig.json | 11 +++++++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/extensions/typescript-language-features/src/features/jsDocCompletions.ts b/extensions/typescript-language-features/src/features/jsDocCompletions.ts index 03feee6a334..80b0e219705 100644 --- a/extensions/typescript-language-features/src/features/jsDocCompletions.ts +++ b/extensions/typescript-language-features/src/features/jsDocCompletions.ts @@ -28,7 +28,7 @@ class JsDocCompletionItem extends vscode.CompletionItem { const suffix = line.slice(position.character).match(/^\s*\**\//); const start = position.translate(0, prefix ? -prefix[0].length : 0); const range = new vscode.Range(start, position.translate(0, suffix ? suffix[0].length : 0)); - this.range = { inserting: range, replacing: range }; + this.range = { inserting: range, replacing: range }; } } diff --git a/extensions/typescript-language-features/src/typings/ref.d.ts b/extensions/typescript-language-features/src/typings/ref.d.ts index c9849d48e08..43a9cadf250 100644 --- a/extensions/typescript-language-features/src/typings/ref.d.ts +++ b/extensions/typescript-language-features/src/typings/ref.d.ts @@ -3,5 +3,4 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -/// /// diff --git a/extensions/typescript-language-features/tsconfig.json b/extensions/typescript-language-features/tsconfig.json index d83a0817920..7a2eafbfa84 100644 --- a/extensions/typescript-language-features/tsconfig.json +++ b/extensions/typescript-language-features/tsconfig.json @@ -2,9 +2,16 @@ "extends": "../shared.tsconfig.json", "compilerOptions": { "outDir": "./out", - "experimentalDecorators": true + "experimentalDecorators": true, + // https://github.com/microsoft/TypeScript/issues/31869#issuecomment-515167432 + "baseUrl": "src/\u0000", + "paths": { + "vscode": [ + "../../../../src/vs/vscode.d.ts" + ] + } }, "include": [ "src/**/*" ] -} \ No newline at end of file +}