From 598985c4a7cac7d278ddb99376a40bb94c680850 Mon Sep 17 00:00:00 2001 From: Kartik Raj Date: Fri, 4 Aug 2023 13:18:05 -0700 Subject: [PATCH] Remove optionalDependencies from API npm package and document to install vscode types separately --- pythonExtensionApi/README.md | 5 ++++- pythonExtensionApi/package-lock.json | 3 --- pythonExtensionApi/package.json | 3 --- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/pythonExtensionApi/README.md b/pythonExtensionApi/README.md index 1587635aae40..4acd26008b24 100644 --- a/pythonExtensionApi/README.md +++ b/pythonExtensionApi/README.md @@ -17,11 +17,14 @@ First we need to define a `package.json` for the extension that wants to use the // Depend on the Python extension facade npm module to get easier API access to the // core extension. "dependencies": { - "@vscode/python-extension": "..." + "@vscode/python-extension": "...", + "@types/vscode": "..." }, } ``` +Update `"@types/vscode"` to [a recent version](https://code.visualstudio.com/updates/) of VS Code, say `"^1.81.0"` for VS Code version `"1.81"`, in case there are any conflicts. + The actual source code to get the active environment to run some script could look like this: ```typescript diff --git a/pythonExtensionApi/package-lock.json b/pythonExtensionApi/package-lock.json index f882b489d793..0b2abfd1895b 100644 --- a/pythonExtensionApi/package-lock.json +++ b/pythonExtensionApi/package-lock.json @@ -15,9 +15,6 @@ "engines": { "node": ">=16.17.1", "vscode": "^1.78.0" - }, - "optionalDependencies": { - "@types/vscode": "^1.78.0" } }, "node_modules/@types/vscode": { diff --git a/pythonExtensionApi/package.json b/pythonExtensionApi/package.json index 6359a7fe0fae..ee61029b07d2 100644 --- a/pythonExtensionApi/package.json +++ b/pythonExtensionApi/package.json @@ -25,9 +25,6 @@ "bugs": { "url": "https://github.com/Microsoft/vscode-python/issues" }, - "optionalDependencies": { - "@types/vscode": "^1.78.0" - }, "devDependencies": { "typescript": "5.0.4", "@types/vscode": "^1.78.0"