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

Commit

Permalink
Clean up for new release
Browse files Browse the repository at this point in the history
  • Loading branch information
octref committed Apr 23, 2020
1 parent faa0254 commit e55dfe8
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
12 changes: 7 additions & 5 deletions README.md
@@ -1,16 +1,18 @@
# vscode-extension-vscode

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

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 is the source code for the NPM [`vscode` module](https://www.npmjs.com/package/vscode).

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.

[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)

---
## Summary

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.
~~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.~~

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

## Changes

Expand Down
6 changes: 3 additions & 3 deletions bin/install
Expand Up @@ -21,7 +21,7 @@ console.log('Detected VS Code engine version: ' + engine);
getURLMatchingEngine(engine, function (_, data) {
console.log('Fetching vscode.d.ts from: ' + data.url);

shared.getContents(data.url, process.env.GITHUB_TOKEN, null, function (error, contents) {
shared.getUrlContents(data.url, process.env.GITHUB_TOKEN, null, function (error, contents) {
if (error) {
exitWithError(error);
}
Expand Down Expand Up @@ -66,7 +66,7 @@ function getURLMatchingEngine(engine, callback) {
});
}

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

// check if master is on the version specified
if (!tag) {
return shared.getContents('https://raw.githubusercontent.com/Microsoft/vscode/master/package.json', process.env.GITHUB_TOKEN, null, function (error, packageJson) {
return shared.getUrlContents('https://raw.githubusercontent.com/Microsoft/vscode/master/package.json', process.env.GITHUB_TOKEN, null, function (error, packageJson) {
if (error) {
exitWithError(error);
}
Expand Down
8 changes: 4 additions & 4 deletions lib/shared.js
Expand Up @@ -16,8 +16,8 @@ if (process.env.npm_config_proxy) {
if (process.env.npm_config_https_proxy) {
HTTPS_PROXY_AGENT = new HttpsProxyAgent(process.env.npm_config_https_proxy);
}
function getContents(url, token, headers, callback) {
var options = toRequestOptions(url, token, headers);
function getUrlContents(url, token, headers, callback) {
var options = toHttpRequestOptions(url, token, headers);
https.get(options, function (res) {
if (res && res.statusCode >= 400) {
callback(new Error('Request returned status code: ' + res.statusCode));
Expand All @@ -33,8 +33,8 @@ function getContents(url, token, headers, callback) {
callback(e);
});
}
exports.getContents = getContents;
function toRequestOptions(url, token, headers) {
exports.getUrlContents = getUrlContents;
function toHttpRequestOptions(url, token, headers) {
if (headers === void 0) { headers = { 'user-agent': 'nodejs' }; }
var options = url_1.parse(url);
if (PROXY_AGENT && options.protocol.startsWith('http:')) {
Expand Down
6 changes: 3 additions & 3 deletions lib/shared.ts
Expand Up @@ -21,8 +21,8 @@ if (process.env.npm_config_https_proxy) {
HTTPS_PROXY_AGENT = new HttpsProxyAgent(process.env.npm_config_https_proxy);
}

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

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

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

0 comments on commit e55dfe8

Please sign in to comment.