From 282ad073463ebde03466bffcd20a41cd3e8a89bd Mon Sep 17 00:00:00 2001 From: Erich Gamma Date: Fri, 19 Feb 2016 18:26:28 +0100 Subject: [PATCH] Fixed line terminators --- extensions/javascript-migration/package.json | 28 +++++++++++++ .../javascript-migration/src/extension.ts | 42 +++++++++++++++++++ .../javascript-migration/src/tsconfig.json | 12 ++++++ extensions/node.d.ts | 2 +- 4 files changed, 83 insertions(+), 1 deletion(-) create mode 100644 extensions/javascript-migration/package.json create mode 100644 extensions/javascript-migration/src/extension.ts create mode 100644 extensions/javascript-migration/src/tsconfig.json diff --git a/extensions/javascript-migration/package.json b/extensions/javascript-migration/package.json new file mode 100644 index 00000000000..d38d7711214 --- /dev/null +++ b/extensions/javascript-migration/package.json @@ -0,0 +1,28 @@ +{ + "name": "javascript-migration", + "displayName": "Helper extension for migrating to Salsa", + "description": "Informs users about the JS Salsa upgrade", + "version": "0.0.1", + "publisher": "vscode", + "engines": { + "vscode": "*" + }, + "categories": [ + "Other" + ], + "activationEvents": [ + "onLanguage:javascript", + "onLanguage:javascriptreact" + ], + "main": "./out/extension", + + "scripts": { + "vscode:prepublish": "node ../../node_modules/gulp/bin/gulp.js --gulpfile ../../gulpfile.plugins.js compile-plugin:javascript-migration ./src/tsconfig.json" + }, + "devDependencies": { + "typescript": "^1.7.5", + "vscode": "^0.11.0" + }, + "dependencies": { + } +} \ No newline at end of file diff --git a/extensions/javascript-migration/src/extension.ts b/extensions/javascript-migration/src/extension.ts new file mode 100644 index 00000000000..3325bf6dcd6 --- /dev/null +++ b/extensions/javascript-migration/src/extension.ts @@ -0,0 +1,42 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; + +import * as vscode from 'vscode'; +import * as cp from 'child_process'; + + +export function activate(context: vscode.ExtensionContext) { + const releaseNotesShown = 'javascript.releasenotesshown'; + + if (!context.globalState.get(releaseNotesShown)) { + // cheating with nls, this is a temporary extenion only, that doesn't need be localized + vscode.window.showInformationMessage('The JavaScript infrastructure has changed, please read the change notes.', 'Change Notes').then(selection => { + if (selection) { + open('http://go.microsoft.com/fwlink/?LinkId=733559'); + } + context.globalState.update(releaseNotesShown, true); + }); + } +} + +function open(url: string) { + var cmd: string; + + switch (process.platform) { + case 'darwin': + cmd = 'open'; + break; + case 'win32': + cmd = 'start'; + break; + default: + cmd = 'xdg-open'; + } + return cp.exec(cmd + ' ' + url); +} + +export function deactivate() { +} \ No newline at end of file diff --git a/extensions/javascript-migration/src/tsconfig.json b/extensions/javascript-migration/src/tsconfig.json new file mode 100644 index 00000000000..1cb4fb973b0 --- /dev/null +++ b/extensions/javascript-migration/src/tsconfig.json @@ -0,0 +1,12 @@ +{ + "compilerOptions": { + "noLib": true, + "target": "es5", + "module": "commonjs", + "sourceMap": false, + "outDir": "../out" + }, + "exclude": [ + "node_modules" + ] +} \ No newline at end of file diff --git a/extensions/node.d.ts b/extensions/node.d.ts index 578da68a028..89f52915a65 100644 --- a/extensions/node.d.ts +++ b/extensions/node.d.ts @@ -648,7 +648,7 @@ declare module "child_process" { maxBuffer?: number; killSignal?: string; }, callback: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess; - export function exec(command: string, callback: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess; + export function exec(command: string, callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess; export function execFile(file: string, args: string[], options: { cwd?: string; stdio?: any;