Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit e55dfe8

Browse files
committed
Clean up for new release
1 parent faa0254 commit e55dfe8

File tree

4 files changed

+17
-15
lines changed

4 files changed

+17
-15
lines changed

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
# vscode-extension-vscode
22

3-
## ⚠️ Use @types/vscode and vscode-test instead ⚠️
3+
## ⚠️ Deprecated, use @types/vscode and vscode-test instead ⚠️
44

5-
The funcionality of `vscode` module has been splitted into `@types/vscode` and `vscode-test`. They have fewer dependencies, allow greater flexibility in writing tests and will continue to receive updates. Although `vscode` will continue to work, we suggest that you migrate to `@types/vscode` and `vscode-test`.
5+
This is the source code for the NPM [`vscode` module](https://www.npmjs.com/package/vscode).
6+
7+
The funcionality of `vscode` module has been splitted into `@types/vscode` and `vscode-test`. They have fewer dependencies, allow greater flexibility in writing tests and will continue to receive updates. Although `vscode` will continue to work, we suggest that you migrate to `@types/vscode` and `vscode-test`. This package will only receive security updates.
68

79
[Release Notes](https://code.visualstudio.com/updates/v1_36#_splitting-vscode-package-into-typesvscode-and-vscodetest) | [Migration Guide](https://code.visualstudio.com/api/working-with-extensions/testing-extension#migrating-from-vscode)
810

9-
---
11+
## Summary
1012

11-
The `vscode` NPM module provides VS Code extension authors tools to write extensions. It provides the `vscode.d.ts` node module (all accessible API for extensions) as well as commands for compiling and testing extensions.
13+
~~The `vscode` NPM module provides VS Code extension authors tools to write extensions. It provides the `vscode.d.ts` node module (all accessible API for extensions) as well as commands for compiling and testing extensions.~~
1214

13-
For more information around extension authoring for VS Code, please see http://code.visualstudio.com/docs/extensions/overview
15+
~~For more information around extension authoring for VS Code, please see http://code.visualstudio.com/docs/extensions/overview~~
1416

1517
## Changes
1618

bin/install

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ console.log('Detected VS Code engine version: ' + engine);
2121
getURLMatchingEngine(engine, function (_, data) {
2222
console.log('Fetching vscode.d.ts from: ' + data.url);
2323

24-
shared.getContents(data.url, process.env.GITHUB_TOKEN, null, function (error, contents) {
24+
shared.getUrlContents(data.url, process.env.GITHUB_TOKEN, null, function (error, contents) {
2525
if (error) {
2626
exitWithError(error);
2727
}
@@ -66,7 +66,7 @@ function getURLMatchingEngine(engine, callback) {
6666
});
6767
}
6868

69-
shared.getContents('https://update.code.visualstudio.com/api/releases/stable', null, { "X-API-Version": "2" }, function (error, tagsRaw) {
69+
shared.getUrlContents('https://update.code.visualstudio.com/api/releases/stable', null, { "X-API-Version": "2" }, function (error, tagsRaw) {
7070
if (error) {
7171
exitWithError(error);
7272
}
@@ -90,7 +90,7 @@ function getURLMatchingEngine(engine, callback) {
9090

9191
// check if master is on the version specified
9292
if (!tag) {
93-
return shared.getContents('https://raw.githubusercontent.com/Microsoft/vscode/master/package.json', process.env.GITHUB_TOKEN, null, function (error, packageJson) {
93+
return shared.getUrlContents('https://raw.githubusercontent.com/Microsoft/vscode/master/package.json', process.env.GITHUB_TOKEN, null, function (error, packageJson) {
9494
if (error) {
9595
exitWithError(error);
9696
}

lib/shared.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ if (process.env.npm_config_proxy) {
1616
if (process.env.npm_config_https_proxy) {
1717
HTTPS_PROXY_AGENT = new HttpsProxyAgent(process.env.npm_config_https_proxy);
1818
}
19-
function getContents(url, token, headers, callback) {
20-
var options = toRequestOptions(url, token, headers);
19+
function getUrlContents(url, token, headers, callback) {
20+
var options = toHttpRequestOptions(url, token, headers);
2121
https.get(options, function (res) {
2222
if (res && res.statusCode >= 400) {
2323
callback(new Error('Request returned status code: ' + res.statusCode));
@@ -33,8 +33,8 @@ function getContents(url, token, headers, callback) {
3333
callback(e);
3434
});
3535
}
36-
exports.getContents = getContents;
37-
function toRequestOptions(url, token, headers) {
36+
exports.getUrlContents = getUrlContents;
37+
function toHttpRequestOptions(url, token, headers) {
3838
if (headers === void 0) { headers = { 'user-agent': 'nodejs' }; }
3939
var options = url_1.parse(url);
4040
if (PROXY_AGENT && options.protocol.startsWith('http:')) {

lib/shared.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ if (process.env.npm_config_https_proxy) {
2121
HTTPS_PROXY_AGENT = new HttpsProxyAgent(process.env.npm_config_https_proxy);
2222
}
2323

24-
export function getContents(url: string, token?: string, headers?: any, callback?: (err: Error, body?: any) => void) {
25-
const options = toRequestOptions(url, token, headers);
24+
export function getUrlContents(url: string, token?: string, headers?: any, callback?: (err: Error, body?: any) => void) {
25+
const options = toHttpRequestOptions(url, token, headers);
2626

2727
https.get(options, res => {
2828
if (res && res.statusCode >= 400) {
@@ -43,7 +43,7 @@ export function getContents(url: string, token?: string, headers?: any, callback
4343
});
4444
}
4545

46-
function toRequestOptions(url: string, token: string | null, headers = { 'user-agent': 'nodejs' }): https.RequestOptions {
46+
function toHttpRequestOptions(url: string, token: string | null, headers = { 'user-agent': 'nodejs' }): https.RequestOptions {
4747
const options: https.RequestOptions = parseUrl(url);
4848
if (PROXY_AGENT && options.protocol.startsWith('http:')) {
4949
options.agent = PROXY_AGENT;

0 commit comments

Comments
 (0)