提交 d872b0f9 编写于 作者: J Johannes Rieken

Merge branch 'master' into joh/fixLanguageFeatures

......@@ -2,6 +2,7 @@
npm-debug.log
Thumbs.db
node_modules/
.build/
out/
out-build/
out-editor/
......
......@@ -9,6 +9,7 @@
"search.exclude": {
"**/node_modules/**": true,
"**/bower_components": true,
".build/**": true,
"out*/**": true,
"extensions/**/out/**": true
}
......
......@@ -2,6 +2,7 @@ environment:
ATOM_SHELL_INTERNAL_RUN_AS_NODE: 1
install:
- ps: Install-Product node 4.1.1 x64
- npm install -g gulp mocha
build_script:
......
......@@ -8,12 +8,16 @@ var filter = require('gulp-filter');
var es = require('event-stream');
var path = require('path');
var eolFilter = [
var all = [
'build/**/*',
'extensions/**/*',
'scripts/**/*',
'src/**/*',
'test/**/*',
'test/**/*'
];
var eolFilter = [
'**',
'!extensions/csharp-o/bin/**',
'!extensions/**/out/**',
'!**/node_modules/**',
......@@ -64,12 +68,12 @@ var copyrightHeader = [
' *--------------------------------------------------------------------------------------------*/'
].join('\n');
gulp.task('hygiene', function() {
var hygiene = exports.hygiene = function (some) {
var errorCount = 0;
var eol = es.through(function (file) {
if (/\r\n?/g.test(file.contents.toString('utf8'))) {
console.error(file.path + ': Bad EOL found');
console.error(file.relative + ': Bad EOL found');
errorCount++;
}
......@@ -88,7 +92,7 @@ gulp.task('hygiene', function() {
} else if (/^[\t]* \*/.test(line)) {
// block comment using an extra space
} else {
console.error(file.path + '(' + (i + 1) + ',1): Bad whitespace indentation');
console.error(file.relative + '(' + (i + 1) + ',1): Bad whitespace indentation');
errorCount++;
}
});
......@@ -98,15 +102,16 @@ gulp.task('hygiene', function() {
var copyrights = es.through(function (file) {
if (file.contents.toString('utf8').indexOf(copyrightHeader) !== 0) {
console.error(file.path + ': Missing or bad copyright statement');
console.error(file.relative + ': Missing or bad copyright statement');
errorCount++;
}
this.emit('data', file);
});
return gulp.src(eolFilter, { base: '.' })
return gulp.src(some || all, { base: '.' })
.pipe(filter(function (f) { return !f.stat.isDirectory(); }))
.pipe(filter(eolFilter))
.pipe(eol)
.pipe(filter(indentationFilter))
.pipe(indentation)
......@@ -114,9 +119,35 @@ gulp.task('hygiene', function() {
.pipe(copyrights)
.pipe(es.through(null, function () {
if (errorCount > 0) {
this.emit('error', 'Hygiene failed with ' + errorCount + ' errors.\nCheck build/gulpfile.hygiene.js for the hygiene rules.');
this.emit('error', 'Hygiene failed with ' + errorCount + ' errors. Check \'build/gulpfile.hygiene.js\'.');
} else {
this.emit('end');
}
}));
};
gulp.task('hygiene', function () {
return hygiene();
});
// this allows us to run this as a git pre-commit hook
if (require.main === module) {
var cp = require('child_process');
cp.exec('git diff --cached --name-only', function (err, out) {
if (err) {
console.error();
console.error(err);
process.exit(1);
}
var some = out
.split(/\r?\n/)
.filter(function (l) { return !!l; });
hygiene(some).on('error', function (err) {
console.error();
console.error(err);
process.exit(1);
});
});
}
......@@ -25,6 +25,7 @@ var util = require('./lib/util');
var buildfile = require('../src/buildfile');
var common = require('./gulpfile.common');
var root = path.dirname(__dirname);
var build = path.join(root, '.build');
var commit = util.getVersion(root);
var baseModules = [
......@@ -112,7 +113,7 @@ var config = {
gulp.task('electron', function () {
// Force windows to use ia32
var arch = (process.platform === 'win32' ? 'ia32' : process.arch);
return electron.dest(path.join(path.dirname(root), 'Electron-Build'), _.extend({}, config, { arch: arch }));
return electron.dest(path.join(build, 'electron'), _.extend({}, config, { arch: arch }));
});
function mixinProduct() {
......
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
var win = "Please run '.\\scripts\\npm.bat install' instead."
var nix = "Please run './scripts/npm.sh install' instead."
if (process.env['npm_config_disturl'] !== 'https://atom.io/download/atom-shell') {
console.error("You can't use plain npm to install Code's dependencies.");
console.error(/^win/.test(process.platform) ? win : nix);
process.exit(1);
}
\ No newline at end of file
......@@ -416,9 +416,9 @@
"resolved": "https://registry.npmjs.org/semver/-/semver-4.3.6.tgz"
},
"vscode-textmate": {
"version": "1.0.6",
"from": "vscode-textmate@1.0.6",
"resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-1.0.6.tgz",
"version": "1.0.7",
"from": "vscode-textmate@1.0.7",
"resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-1.0.7.tgz",
"dependencies": {
"oniguruma": {
"version": "5.1.1",
......
{
"name": "Code",
"version": "0.10.1",
"electronVersion": "0.34.1",
"author": {
"name": "Microsoft Corporation"
},
"main": "./out/vs/workbench/electron-main/bootstrap",
"private": true,
"engines": {
"node": ">= 0.10.0 < 0.11.0"
},
"scripts": {
"test": "node node_modules/mocha/bin/_mocha",
"postinstall": "npm --prefix extensions/csharp-o/ install extensions/csharp-o/ && npm --prefix extensions/vscode-api-tests/ install extensions/vscode-api-tests/"
},
"dependencies": {
"applicationinsights": "0.15.6",
"chokidar": "1.0.5",
"emmet": "^1.3.0",
"getmac": "1.0.7",
"graceful-fs": "4.1.2",
"http-proxy-agent": "^0.2.6",
"https-proxy-agent": "^0.3.5",
"iconv-lite": "^0.4.13",
"sax": "^1.1.1",
"semver": "^4.2.0",
"vscode-textmate": "^1.0.6",
"winreg": "0.0.12",
"yauzl": "^2.3.1"
},
"devDependencies": {
"async": "^1.4.0",
"azure-storage": "^0.3.1",
"clone": "^1.0.2",
"debounce": "^1.0.0",
"event-stream": "^3.1.7",
"express": "^4.13.1",
"glob": "^5.0.13",
"gulp": "^3.8.9",
"gulp-atom-electron": "^0.17.2",
"gulp-azure-storage": "^0.3.0",
"gulp-bom": "^1.0.0",
"gulp-concat": "^2.6.0",
"gulp-filter": "^3.0.0",
"gulp-insert": "^0.5.0",
"gulp-json-editor": "^2.2.1",
"gulp-minify-css": "^1.2.1",
"clean-css": "3.4.6",
"gulp-mocha": "^2.1.3",
"gulp-remote-src": "^0.4.0",
"gulp-rename": "^1.2.0",
"gulp-sourcemaps": "^1.6.0",
"gulp-tsb": "^1.7.3",
"gulp-uglify": "^1.4.1",
"gulp-util": "^3.0.6",
"gulp-symdest": "^1.0.0",
"gulp-vinyl-zip": "^1.1.0",
"gulp-watch": "^4.2.4",
"innosetup-compiler": "^5.5.60",
"istanbul": "^0.3.17",
"jsdom-no-contextify": "^3.1.0",
"json-comments": "^0.2.1",
"lazy.js": "^0.4.2",
"mime": "1.2.11",
"minimatch": "^2.0.10",
"mkdirp": "^0.5.0",
"mocha": "^2.2.5",
"object-assign": "^4.0.1",
"optimist": "0.3.5",
"queue": "3.0.6",
"rimraf": "^2.2.8",
"sinon": "^1.17.2",
"source-map": "^0.4.4",
"uglify-js": "2.4.8",
"underscore": "^1.8.2",
"vinyl": "^0.4.5"
},
"repository": {
"type": "git",
"url": "https://github.com/Microsoft/vscode.git"
},
"bugs": {
"url": "https://github.com/Microsoft/vscode/issues"
}
"name": "Code",
"version": "0.10.1",
"electronVersion": "0.34.1",
"author": {
"name": "Microsoft Corporation"
},
"main": "./out/vs/workbench/electron-main/bootstrap",
"private": true,
"engines": {
"node": ">= 0.10.0 < 0.11.0"
},
"scripts": {
"test": "node node_modules/mocha/bin/_mocha",
"preinstall": "node build/npm/preinstall.js",
"postinstall": "npm --prefix extensions/csharp-o/ install extensions/csharp-o/ && npm --prefix extensions/vscode-api-tests/ install extensions/vscode-api-tests/"
},
"dependencies": {
"applicationinsights": "0.15.6",
"chokidar": "1.0.5",
"emmet": "^1.3.0",
"getmac": "1.0.7",
"graceful-fs": "4.1.2",
"http-proxy-agent": "^0.2.6",
"https-proxy-agent": "^0.3.5",
"iconv-lite": "^0.4.13",
"sax": "^1.1.1",
"semver": "^4.2.0",
"vscode-textmate": "^1.0.7",
"winreg": "0.0.12",
"yauzl": "^2.3.1"
},
"devDependencies": {
"async": "^1.4.0",
"azure-storage": "^0.3.1",
"clean-css": "3.4.6",
"clone": "^1.0.2",
"debounce": "^1.0.0",
"event-stream": "^3.1.7",
"express": "^4.13.1",
"ghooks": "^1.0.1",
"glob": "^5.0.13",
"gulp": "^3.8.9",
"gulp-atom-electron": "^0.17.2",
"gulp-azure-storage": "^0.3.0",
"gulp-bom": "^1.0.0",
"gulp-concat": "^2.6.0",
"gulp-filter": "^3.0.0",
"gulp-insert": "^0.5.0",
"gulp-json-editor": "^2.2.1",
"gulp-minify-css": "^1.2.1",
"gulp-mocha": "^2.1.3",
"gulp-remote-src": "^0.4.0",
"gulp-rename": "^1.2.0",
"gulp-sourcemaps": "^1.6.0",
"gulp-symdest": "^1.0.0",
"gulp-tsb": "^1.7.3",
"gulp-uglify": "^1.4.1",
"gulp-util": "^3.0.6",
"gulp-vinyl-zip": "^1.1.0",
"gulp-watch": "^4.2.4",
"innosetup-compiler": "^5.5.60",
"istanbul": "^0.3.17",
"jsdom-no-contextify": "^3.1.0",
"json-comments": "^0.2.1",
"lazy.js": "^0.4.2",
"mime": "1.2.11",
"minimatch": "^2.0.10",
"mkdirp": "^0.5.0",
"mocha": "^2.2.5",
"object-assign": "^4.0.1",
"optimist": "0.3.5",
"queue": "3.0.6",
"rimraf": "^2.2.8",
"sinon": "^1.17.2",
"source-map": "^0.4.4",
"uglify-js": "2.4.8",
"underscore": "^1.8.2",
"vinyl": "^0.4.5"
},
"repository": {
"type": "git",
"url": "https://github.com/Microsoft/vscode.git"
},
"bugs": {
"url": "https://github.com/Microsoft/vscode/issues"
},
"config": {
"ghooks": {
"pre-commit": "node build/gulpfile.hygiene.js"
}
}
}
@echo off
title VSCode Dev
pushd %~dp0\..
:: Node modules
if not exist node_modules call .\scripts\npm.bat install
:: Get electron
node .\node_modules\gulp\bin\gulp.js electron
:: Configuration
set NODE_ENV=development
set VSCODE_DEV=1
set ELECTRON_ENABLE_LOGGING=1
set ELECTRON_ENABLE_STACK_DUMPING=1
pushd %~dp0\..
node .\node_modules\gulp\bin\gulp.js electron
..\Electron-Build\CodeOSS.exe . %*
:: Launch Code
.\.build\electron\CodeOSS.exe . %*
popd
......@@ -7,17 +7,27 @@ else
ROOT=$(dirname $(dirname $(readlink -f $0)))
fi
# Configuration
export NODE_ENV=development
export VSCODE_DEV=1
export ELECTRON_ENABLE_LOGGING=1
export ELECTRON_ENABLE_STACK_DUMPING=1
function code() {
cd $ROOT
# Prepare
cd $ROOT ; node node_modules/gulp/bin/gulp.js electron
# Node modules
test -d node_modules || ./scripts/npm.sh install
if [[ "$OSTYPE" == "darwin"* ]]; then
cd $ROOT; ../Electron-Build/Electron.app/Contents/MacOS/Electron . $*
else
cd $ROOT; ../Electron-Build/electron . $*
fi
# Get electron
node node_modules/gulp/bin/gulp.js electron
# Configuration
export NODE_ENV=development
export VSCODE_DEV=1
export ELECTRON_ENABLE_LOGGING=1
export ELECTRON_ENABLE_STACK_DUMPING=1
# Launch Code
if [[ "$OSTYPE" == "darwin"* ]]; then
./.build/electron/Electron.app/Contents/MacOS/Electron . $*
else
./.build/electron/electron . $*
fi
}
code
......@@ -285,7 +285,7 @@ class GotoDefinitionWithMouseEditorContribution implements EditorCommon.IEditorC
startColumn: word.startColumn,
endLineNumber: position.lineNumber,
endColumn: word.endColumn
}, nls.localize('multipleResults', "Click to show the {0} definitions for '{1}'.", results.length, this.currentWordUnderMouse.word), false);
}, nls.localize('multipleResults', "Click to show the {0} definitions found.", results.length), false);
}
// Single result
......
......@@ -67,6 +67,10 @@ export class PluginHostQuickOpen {
return items[handle];
}
});
}, (err) => {
this._proxy._setError(err);
return TPromise.wrapError(err);
});
}
......@@ -80,6 +84,7 @@ export class MainThreadQuickOpen {
private _quickOpenService: IQuickOpenService;
private _doSetItems: (items: MyQuickPickItems[]) => any;
private _doSetError: (error: Error) => any;
private _contents: TPromise<MyQuickPickItems[]>;
private _token = 0;
......@@ -97,6 +102,12 @@ export class MainThreadQuickOpen {
c(items);
}
};
this._doSetError = (error) => {
if (myToken === this._token) {
e(error);
}
};
});
return this._quickOpenService.pick(this._contents, options).then(item => {
......@@ -113,6 +124,13 @@ export class MainThreadQuickOpen {
}
}
_setError(error: Error): Thenable<any> {
if (this._doSetError) {
this._doSetError(error);
return;
}
}
_input(options?: InputBoxOptions): Thenable<string> {
return this._quickOpenService.input(options);
}
......
......@@ -209,7 +209,11 @@ export class QuickOpenController extends WorkbenchComponent implements IQuickOpe
onOk: () => { /* ignore, handle later */ },
onCancel: () => { /* ignore, handle later */ },
onType: (value: string) => { /* ignore, handle later */ },
onShow: () => this.emitQuickOpenVisibilityChange(true)
onShow: () => this.emitQuickOpenVisibilityChange(true),
onHide: () => {
this.restoreFocus(); // focus back to editor or viewlet
this.emitQuickOpenVisibilityChange(false); // event
}
}, {
inputPlaceHolder: options.placeHolder || ''
},
......@@ -363,7 +367,11 @@ export class QuickOpenController extends WorkbenchComponent implements IQuickOpe
} else {
this.pickOpenWidget.setInput(model, autoFocus);
}
}, error);
}, (err) => {
this.pickOpenWidget.hide();
error(err);
});
// Progress if task takes a long time
Promise.timeout(800).then(() => {
......
......@@ -115,6 +115,10 @@ export function log(...a: any[]): void {
}
}
export interface IProcessEnvironment {
[key: string]: string;
}
export interface ICommandLineArguments {
verboseLogging: boolean;
debugPluginHostPort: number;
......
......@@ -20,24 +20,24 @@ import menu = require('vs/workbench/electron-main/menus');
import settings = require('vs/workbench/electron-main/settings');
import {Instance as UpdateManager} from 'vs/workbench/electron-main/update-manager';
import {Server, serve, connect} from 'vs/base/node/service.net';
import {getUserEnvironment, IEnv} from 'vs/base/node/env';
import {getUserEnvironment} from 'vs/base/node/env';
import {Promise, TPromise} from 'vs/base/common/winjs.base';
import {GitAskpassService} from 'vs/workbench/parts/git/electron-main/askpassService';
import { spawnSharedProcess } from 'vs/workbench/electron-main/sharedProcess';
import {spawnSharedProcess} from 'vs/workbench/electron-main/sharedProcess';
export class LaunchService {
public start(args: env.ICommandLineArguments): Promise {
public start(args: env.ICommandLineArguments, userEnv: env.IProcessEnvironment): Promise {
env.log('Received data from other instance', args);
// Otherwise handle in windows manager
if (!!args.pluginDevelopmentPath) {
windows.manager.openPluginDevelopmentHostWindow({ cli: args });
windows.manager.openPluginDevelopmentHostWindow({ cli: args, userEnv: userEnv });
} else if (args.pathArguments.length === 0 && args.openNewWindow) {
windows.manager.open({ cli: args, forceNewWindow: true, forceEmpty: true });
windows.manager.open({ cli: args, userEnv: userEnv, forceNewWindow: true, forceEmpty: true });
} else if (args.pathArguments.length === 0) {
windows.manager.focusLastActive(args);
} else {
windows.manager.open({ cli: args, forceNewWindow: !args.openInSameWindow });
windows.manager.open({ cli: args, userEnv: userEnv, forceNewWindow: !args.openInSameWindow });
}
return Promise.as(null);
......@@ -67,9 +67,11 @@ process.on('uncaughtException', (err: any) => {
function quit(error?: Error);
function quit(message?: string);
function quit(arg?: any) {
let exitCode = 0;
if (typeof arg === 'string') {
env.log(arg)
} else {
exitCode = 1; // signal error to the outside
if (arg.stack) {
console.error(arg.stack);
} else {
......@@ -77,10 +79,10 @@ function quit(arg?: any) {
}
}
process.exit();
process.exit(exitCode);
}
function main(ipcServer: Server, userEnv: IEnv): void {
function main(ipcServer: Server, userEnv: env.IProcessEnvironment): void {
env.log('### VSCode main.js ###');
env.log(env.appRoot, env.cliArgs);
......@@ -203,7 +205,7 @@ function setupIPC(): TPromise<Server> {
const service = client.getService<LaunchService>('LaunchService', LaunchService);
return service.start(env.cliArgs)
return service.start(env.cliArgs, process.env)
.then(() => client.dispose())
.then(() => Promise.wrapError('Sent env to running instance. Terminating...'));
},
......@@ -231,6 +233,8 @@ function setupIPC(): TPromise<Server> {
return setup(true);
}
// On some platforms we need to manually read from the global environment variables
// and assign them to the process environment (e.g. when doubleclick app on Mac)
getUserEnvironment()
.then(userEnv => {
assign(process.env, userEnv);
......
......@@ -16,7 +16,6 @@ import platform = require('vs/base/common/platform');
import objects = require('vs/base/common/objects');
import env = require('vs/workbench/electron-main/env');
import storage = require('vs/workbench/electron-main/storage');
import {IEnv} from 'vs/base/node/env';
export interface IWindowState {
width?: number;
......@@ -113,7 +112,7 @@ export interface IWindowConfiguration extends env.ICommandLineArguments {
releaseNotesUrl: string;
productDownloadUrl: string;
enableTelemetry: boolean;
userEnv: IEnv,
userEnv: env.IProcessEnvironment,
aiConfig: {
key: string;
asimovKey: string;
......
......@@ -28,7 +28,6 @@ import objects = require('vs/base/common/objects');
import storage = require('vs/workbench/electron-main/storage');
import settings = require('vs/workbench/electron-main/settings');
import {Instance as UpdateManager, IUpdate} from 'vs/workbench/electron-main/update-manager';
import {IEnv} from 'vs/base/node/env';
const eventEmitter = new events.EventEmitter();
......@@ -63,6 +62,7 @@ enum WindowError {
export interface IOpenConfiguration {
cli: env.ICommandLineArguments;
userEnv?: env.IProcessEnvironment;
pathsToOpen?: string[];
forceNewWindow?: boolean;
forceEmpty?: boolean;
......@@ -102,13 +102,13 @@ export class WindowsManager {
private static WINDOWS: window.VSCodeWindow[] = [];
private userEnv: IEnv;
private initialUserEnv: env.IProcessEnvironment;
private windowsState: IWindowsState;
public ready(userEnv: IEnv): void {
public ready(initialUserEnv: env.IProcessEnvironment): void {
this.registerListeners();
this.userEnv = userEnv;
this.initialUserEnv = initialUserEnv;
this.windowsState = storage.getItem<IWindowsState>(WindowsManager.windowsStateStorageKey) || { openedFolders: [] };
}
......@@ -403,7 +403,7 @@ export class WindowsManager {
// Otherwise open instance with files
else {
configuration = this.toConfiguration(openConfig.cli, null, filesToOpen, filesToCreate, extensionsToInstall);
configuration = this.toConfiguration(openConfig.userEnv || this.initialUserEnv, openConfig.cli, null, filesToOpen, filesToCreate, extensionsToInstall);
this.openInBrowserWindow(configuration, true /* new window */);
openConfig.forceNewWindow = true; // any other folders to open must open in new window then
......@@ -442,7 +442,7 @@ export class WindowsManager {
return; // ignore folders that are already open
}
configuration = this.toConfiguration(openConfig.cli, folderToOpen.workspacePath, filesToOpen, filesToCreate, extensionsToInstall);
configuration = this.toConfiguration(openConfig.userEnv || this.initialUserEnv, openConfig.cli, folderToOpen.workspacePath, filesToOpen, filesToCreate, extensionsToInstall);
this.openInBrowserWindow(configuration, openConfig.forceNewWindow, openConfig.forceNewWindow ? void 0 : openConfig.windowToUse);
// Reset these because we handled them
......@@ -457,7 +457,7 @@ export class WindowsManager {
// Handle empty
if (emptyToOpen.length > 0) {
emptyToOpen.forEach(() => {
let configuration = this.toConfiguration(openConfig.cli);
let configuration = this.toConfiguration(openConfig.userEnv || this.initialUserEnv, openConfig.cli);
this.openInBrowserWindow(configuration, openConfig.forceNewWindow, openConfig.forceNewWindow ? void 0 : openConfig.windowToUse);
openConfig.forceNewWindow = true; // any other folders to open must open in new window then
......@@ -510,7 +510,7 @@ export class WindowsManager {
this.open({ cli: openConfig.cli, forceNewWindow: true, forceEmpty: openConfig.cli.pathArguments.length === 0 });
}
private toConfiguration(cli: env.ICommandLineArguments, workspacePath?: string, filesToOpen?: window.IPath[], filesToCreate?: window.IPath[], extensionsToInstall?: string[]): window.IWindowConfiguration {
private toConfiguration(userEnv: env.IProcessEnvironment, cli: env.ICommandLineArguments, workspacePath?: string, filesToOpen?: window.IPath[], filesToCreate?: window.IPath[], extensionsToInstall?: string[]): window.IWindowConfiguration {
let configuration: window.IWindowConfiguration = objects.mixin({}, cli); // inherit all properties from CLI
configuration.execPath = process.execPath;
configuration.workspacePath = workspacePath;
......@@ -539,7 +539,7 @@ export class WindowsManager {
configuration.aiConfig = env.product.aiConfig;
configuration.sendASmile = env.product.sendASmile;
configuration.enableTelemetry = env.product.enableTelemetry;
configuration.userEnv = this.userEnv;
configuration.userEnv = userEnv;
return configuration;
}
......
......@@ -294,7 +294,7 @@ export class DebugEditorModelManager implements wbext.IWorkbenchContribution {
stickiness: editorcommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges
};
// We need a seperate decoration for glyph margin, since we do not want it on each line of a multi line statement.
// We need a separate decoration for glyph margin, since we do not want it on each line of a multi line statement.
private static TOP_STACK_FRAME_MARGIN: editorcommon.IModelDecorationOptions = {
glyphMarginClassName: 'debug-top-stack-frame-glyph',
stickiness: editorcommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges
......@@ -325,7 +325,7 @@ export class DebugEditorModelManager implements wbext.IWorkbenchContribution {
private static FOCUSED_STACK_FRAME_DECORATION: editorcommon.IModelDecorationOptions = {
isWholeLine: true,
className: 'debug-focussed-stack-frame-line',
className: 'debug-focused-stack-frame-line',
stickiness: editorcommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges
};
}
......@@ -47,8 +47,8 @@ export class DebugHoverWidget implements editorbrowser.IContentWidget {
const pos = range.getStartPosition();
const wordAtPosition = this.editor.getModel().getWordAtPosition(pos);
const hoveringOver = wordAtPosition ? wordAtPosition.word : null;
const focussedStackFrame = this.debugService.getViewModel().getFocusedStackFrame();
if (!hoveringOver || !focussedStackFrame || (this.isVisible && hoveringOver === this.lastHoveringOver)) {
const focusedStackFrame = this.debugService.getViewModel().getFocusedStackFrame();
if (!hoveringOver || !focusedStackFrame || (this.isVisible && hoveringOver === this.lastHoveringOver)) {
return;
}
......@@ -60,7 +60,7 @@ export class DebugHoverWidget implements editorbrowser.IContentWidget {
namesToFind[0] = namesToFind[0].substring(namesToFind[0].lastIndexOf(' ') + 1);
const variables: debug.IExpression[] = [];
focussedStackFrame.getScopes(this.debugService).done(scopes => {
focusedStackFrame.getScopes(this.debugService).done(scopes => {
// flatten out scopes lists
return scopes.reduce((accum, scopes) => { return accum.concat(scopes); }, [])
......
......@@ -857,15 +857,15 @@ export class BreakpointsController extends BaseDebugController {
return this.doNotFocusExceptionBreakpoint(tree, super.onPageUp(tree, event));
}
private doNotFocusExceptionBreakpoint(tree: tree.ITree, upSucceded: boolean) : boolean {
if (upSucceded) {
private doNotFocusExceptionBreakpoint(tree: tree.ITree, upSucceeded: boolean) : boolean {
if (upSucceeded) {
var focus = tree.getFocus();
if (focus instanceof model.ExceptionBreakpoint) {
tree.focusNth(2);
}
}
return upSucceded;
return upSucceeded;
}
protected onDelete(tree: tree.ITree, event: keyboard.StandardKeyboardEvent): boolean {
......
......@@ -21,7 +21,7 @@
background: rgba(255, 255, 0, 0.7);
}
.monaco-editor .debug-focussed-stack-frame-line {
.monaco-editor .debug-focused-stack-frame-line {
background: rgba(206, 231, 206, 0.45);
}
......@@ -247,7 +247,7 @@
color: #C586C0;
}
.monaco-editor.vs-dark .debug-focussed-stack-frame-line {
.monaco-editor.vs-dark .debug-focused-stack-frame-line {
background: rgba(122, 189, 122, 0.3);
}
......
......@@ -110,6 +110,7 @@
.debug-viewlet .debug-call-stack .stack-frame > .file:not(:first-child) {
margin-left: 0.8em;
margin-right: 0.15em;
}
/* Variables & Expression view */
......
......@@ -20,7 +20,7 @@ import viewer = require('vs/workbench/parts/debug/browser/replViewer');
import debug = require('vs/workbench/parts/debug/common/debug');
import model = require('vs/workbench/parts/debug/common/debugModel');
import debugactions = require('vs/workbench/parts/debug/browser/debugActions');
import replhistory = require('vs/workbench/parts/debug/browser/replHistory');
import replhistory = require('vs/workbench/parts/debug/common/replHistory');
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { IContextViewService, IContextMenuService } from 'vs/platform/contextview/browser/contextView';
import { IInstantiationService, INullService } from 'vs/platform/instantiation/common/instantiation';
......
......@@ -195,21 +195,21 @@ export interface IConfig {
}
export interface IRawEnvAdapter {
type: string;
label: string;
program: string;
args: string[];
runtime: string;
runtimeArgs: string[];
type?: string;
label?: string;
program?: string;
args?: string[];
runtime?: string;
runtimeArgs?: string[];
}
export interface IRawAdapter extends IRawEnvAdapter {
enableBreakpointsFor: { languageIds: string[] };
configurationAttributes: any;
initialConfigurations: any[];
win: IRawEnvAdapter;
osx: IRawEnvAdapter;
linux: IRawEnvAdapter;
enableBreakpointsFor?: { languageIds: string[] };
configurationAttributes?: any;
initialConfigurations?: any[];
win?: IRawEnvAdapter;
osx?: IRawEnvAdapter;
linux?: IRawEnvAdapter;
}
export interface IRawDebugSession extends ee.EventEmitter {
......@@ -236,7 +236,7 @@ export interface IDebugService extends ee.IEventEmitter {
getConfiguration(): IConfig;
setConfiguration(name: string): Promise;
openConfigFile(sideBySide: boolean): Promise;
openConfigFile(sideBySide: boolean): TPromise<boolean>;
loadLaunchConfig(): TPromise<IGlobalConfig>;
setFocusedStackFrameAndEvaluate(focusedStackFrame: IStackFrame): void;
......
......@@ -555,7 +555,7 @@ export class Model extends ee.EventEmitter implements debug.IModel {
this.threads[data.threadId].callStack = data.callStack.map(
(rsf, level) => {
if (!rsf) {
return new StackFrame(data.threadId, 0, debug.Source.fromUri(uri.parse('unknown')), nls.localize('unkownStack', "Unknown stack location"), undefined, undefined);
return new StackFrame(data.threadId, 0, debug.Source.fromUri(uri.parse('unknown')), nls.localize('unknownStack', "Unknown stack location"), undefined, undefined);
}
return new StackFrame(data.threadId, rsf.id, rsf.source ? debug.Source.fromRawSource(rsf.source) : debug.Source.fromUri(uri.parse('unknown')), rsf.name, rsf.line, rsf.column);
......
......@@ -65,7 +65,7 @@ declare module DebugProtocol {
reason: string;
/** The thread which was stopped. */
threadId?: number;
/** Additonal information. E.g. if reason is 'exception', text contains the exception name. */
/** Additional information. E.g. if reason is 'exception', text contains the exception name. */
text?: string;
};
}
......
......@@ -334,28 +334,29 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService
this.emit(debug.ServiceEvents.STATE_CHANGED, data);
}
public openConfigFile(sideBySide: boolean): Promise {
public openConfigFile(sideBySide: boolean): TPromise<boolean> {
const resource = uri.file(paths.join(this.contextService.getWorkspace().resource.fsPath, '/.vscode/launch.json'));
return this.fileService.resolveContent(resource).then(content => {
let globalConfig = null;
try {
globalConfig = <debug.IGlobalConfig> JSON.parse(content.value);
} catch (e) { }
return this.fileService.resolveContent(resource).then(content => true, err =>
this.getInitialConfigFileContent().then(content => {
if (!content) {
return false;
}
if (!globalConfig || !globalConfig.configurations || globalConfig.configurations.length === 0) {
return this.createInitialConfigFile(resource, content.value);
return this.fileService.updateContent(resource, content).then(() => true);
}
)).then(configFileCreated => {
if (!configFileCreated) {
return false;
}
}, err => this.createInitialConfigFile(resource, null))
.then(() => {
this.telemetryService.publicLog('debugConfigure');
return this.editorService.openEditor({
resource: resource,
options: {
forceOpen: true
}
}, sideBySide);
}, sideBySide).then(() => true);
}, (error) => {
throw new Error(nls.localize('DebugConfig.failed', "Unable to create 'launch.json' file inside the '.vscode' folder ({0}).", error));
});
......@@ -399,20 +400,20 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService
});
}
private createInitialConfigFile(resource: uri, previousContent: string): Promise {
private getInitialConfigFileContent(): TPromise<string> {
return this.quickOpenService.pick(this.adapters, { placeHolder: nls.localize('selectDebug', "Select Debug Environment") })
.then(adapter =>
this.massageInitialConfigurations(adapter).then(() => {
if (previousContent && !adapter) {
return previousContent;
}
.then(adapter => {
if (!adapter) {
return null;
}
return JSON.stringify({
return this.massageInitialConfigurations(adapter).then(() =>
JSON.stringify({
version: '0.2.0',
configurations: adapter && adapter.initialConfigurations ? adapter.initialConfigurations : []
configurations: adapter.initialConfigurations ? adapter.initialConfigurations : []
}, null, '\t')
})
).then(content => this.fileService.updateContent(resource, content));
)
});
}
private massageInitialConfigurations(adapter: Adapter): Promise {
......@@ -531,8 +532,11 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService
return this.pluginService.onReady().then(() => this.setConfiguration(this.configuration ? this.configuration.name : null, extensionHostData)).then(() => {
if (!this.configuration) {
return this.openConfigFile(false).then(() =>
this.messageService.show(severity.Info, nls.localize('NewLaunchConfig', "Please set up the launch configuration file to debug your application. Make sure that configurations have unique names.")));
return this.openConfigFile(false).then(openend => {
if (openend) {
this.messageService.show(severity.Info, nls.localize('NewLaunchConfig', "Please set up the launch configuration file to debug your application."));
}
});
}
var adapter = this.adapters.filter(adapter => adapter.type === this.configuration.type).pop();
......
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import assert = require('assert');
import { ViewModel } from 'vs/workbench/parts/debug/common/debugViewModel';
import { StackFrame, Expression } from 'vs/workbench/parts/debug/common/debugModel';
suite('Debug - View Model', () => {
var model: ViewModel;
setup(() => {
model = new ViewModel();
});
teardown(() => {
model = null;
});
test('focused stack frame', () => {
assert.equal(model.getFocusedStackFrame(), null);
assert.equal(model.getFocusedThreadId(), 0);
const frame = new StackFrame(1, 1, null, 'app.js', 1, 1);
model.setFocusedStackFrame(frame);
assert.equal(model.getFocusedStackFrame(), frame);
assert.equal(model.getFocusedThreadId(), 1);
});
test('selected expression', () => {
assert.equal(model.getSelectedExpression(), null);
const expression = new Expression('my expression', false);
model.setSelectedExpression(expression);
assert.equal(model.getSelectedExpression(), expression);
});
});
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import assert = require('assert');
import paths = require('vs/base/common/paths');
import platform = require('vs/base/common/platform');
import { Adapter } from 'vs/workbench/parts/debug/node/debugAdapter';
suite('Debug - Adapter', () => {
var adapter: Adapter;
var extensionFolderPath = 'a/b/c/';
var rawAdapter = {
type: 'mock',
label: 'Mock Debug',
enableBreakpointsFor: { 'languageIds': [ 'markdown' ] },
program: './out/mock/mockDebug.js',
win: {
runtime: 'winRuntime'
},
linux: {
runtime: 'linuxRuntime'
},
osx: {
runtime: 'osxRuntime'
},
configurationAttributes: {
launch: {
required: [ 'program' ],
properties: {
program: {
'type': 'string',
'description': 'Workspace relative path to a text file.',
'default': 'readme.md'
}
}
}
},
initialConfigurations: [
{
name: 'Mock-Debug',
type: 'mock',
request: 'launch',
program: 'readme.md'
}
]
}
setup(() => {
adapter = new Adapter(rawAdapter, null, extensionFolderPath);
});
teardown(() => {
adapter = null;
});
test('adapter attributes', () => {
assert.equal(adapter.type, rawAdapter.type);
assert.equal(adapter.label, rawAdapter.label);
assert.equal(adapter.program, paths.join(extensionFolderPath, rawAdapter.program));
assert.equal(adapter.runtime, platform.isLinux ? rawAdapter.linux.runtime : platform.isMacintosh ? rawAdapter.osx.runtime : rawAdapter.win.runtime);
assert.deepEqual(adapter.initialConfigurations, rawAdapter.initialConfigurations);
});
test('schema attributes', () => {
const schemaAttribute = adapter.getSchemaAttributes()[0];
assert.notDeepEqual(schemaAttribute, rawAdapter.configurationAttributes);
Object.keys(rawAdapter.configurationAttributes.launch).forEach(key => {
assert.deepEqual(schemaAttribute[key], rawAdapter.configurationAttributes.launch[key]);
});
assert.equal(schemaAttribute['additionalProperties'], false);
assert.equal(!!schemaAttribute['properties']['request'], true);
assert.equal(!!schemaAttribute['properties']['name'], true);
assert.equal(!!schemaAttribute['properties']['type'], true);
assert.equal(!!schemaAttribute['properties']['preLaunchTask'], true);
});
});
\ No newline at end of file
......@@ -83,7 +83,7 @@ export class EditorAccessor implements emmet.Editor {
}
}
// shift colum by +1 since they are 1 based
// shift column by +1 since they are 1 based
let range = new Range(startPosition.lineNumber, startPosition.column + 1, endPosition.lineNumber, endPosition.column + 1);
let deletePreviousChars = 0;
......
......@@ -25,7 +25,7 @@ declare module 'emmet' {
/**
* Creates selection from <code>start</code> to <code>end</code> character
* indexes. If <code>end</code> is ommited, this method should place caret
* indexes. If <code>end</code> is omitted, this method should place caret
* and <code>start</code> index
* @param {Number} start
* @param {Number} [end]
......@@ -133,4 +133,4 @@ declare module 'emmet' {
*/
export function run(action: string, editor: Editor): boolean;
}
\ No newline at end of file
}
......@@ -54,3 +54,26 @@ export class InstallExtensionAction extends Action {
return true;
}
}
export class ListOutdatedExtensionsAction extends Action {
static ID = 'workbench.extensions.action.listOutdatedExtensions';
static LABEL = nls.localize('showOutdatedExtensions', "Show Outdated Extensions");
constructor(
id: string,
label: string,
@IExtensionsService private extensionsService: IExtensionsService,
@IQuickOpenService private quickOpenService: IQuickOpenService
) {
super(id, label, null, true);
}
public run(): Promise {
return this.quickOpenService.show('ext update ');
}
protected isEnabled(): boolean {
return true;
}
}
......@@ -26,6 +26,7 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { ReloadWindowAction } from 'vs/workbench/electron-browser/actions';
import { HighlightedLabel } from 'vs/base/browser/ui/highlightedlabel/highlightedLabel';
import { Action } from 'vs/base/common/actions';
import * as semver from 'semver';
import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar';
import remote = require('remote');
const shell = remote.require('shell');
......@@ -469,6 +470,78 @@ export class GalleryExtensionsHandler extends QuickOpenHandler {
return nls.localize('noExtensionsToInstall', "No extensions found");
}
getAutoFocus(searchValue: string): IAutoFocus {
return { autoFocusFirstEntry: true };
}
}
class OutdatedExtensionsModel implements IModel<IExtensionEntry> {
public dataSource = new DataSource();
public renderer: IRenderer<IExtensionEntry>;
public runner: IRunner<IExtensionEntry>;
public entries: IExtensionEntry[];
constructor(
private galleryExtensions: IExtension[],
private localExtensions: IExtension[],
@IInstantiationService instantiationService: IInstantiationService
) {
this.renderer = instantiationService.createInstance(Renderer);
this.runner = instantiationService.createInstance(InstallRunner);
this.entries = [];
}
public set input(input: string) {
this.entries = this.galleryExtensions
.map(extension => ({ extension, highlights: getHighlights(input, extension) }))
.filter(({ extension, highlights }) => {
const local = this.localExtensions.filter(local => extensionEquals(local, extension))[0];
return local && semver.lt(local.version, extension.version) && !!highlights;
})
.map(({ extension, highlights }: { extension: IExtension, highlights: IHighlights }) => ({
extension,
highlights,
state: ExtensionState.Outdated
}))
.sort((a, b) => a.extension.name.localeCompare(b.extension.name));
}
}
export class OutdatedExtensionsHandler extends QuickOpenHandler {
private modelPromise: TPromise<OutdatedExtensionsModel>;
constructor(
@IInstantiationService private instantiationService: IInstantiationService,
@IExtensionsService private extensionsService: IExtensionsService,
@IGalleryService private galleryService: IGalleryService,
@ITelemetryService private telemetryService: ITelemetryService
) {
super();
}
getResults(input: string): TPromise<IModel<IExtensionEntry>> {
if (!this.modelPromise) {
this.telemetryService.publicLog('extensionGallery:open');
this.modelPromise = TPromise.join<any>([this.galleryService.query(), this.extensionsService.getInstalled()])
.then(result => this.instantiationService.createInstance(OutdatedExtensionsModel, result[0], result[1]));
}
return this.modelPromise.then(model => {
model.input = input;
return model;
});
}
onClose(canceled: boolean): void {
this.modelPromise = null;
}
getEmptyLabel(input: string): string {
return nls.localize('noOutdatedExtensions', "No outdated extensions found");
}
getAutoFocus(searchValue: string): IAutoFocus {
return { autoFocusFirstEntry: true };
}
......
......@@ -16,7 +16,7 @@ import { IWorkspaceContextService } from 'vs/workbench/services/workspace/common
import { ReloadWindowAction } from 'vs/workbench/electron-browser/actions';
import wbaregistry = require('vs/workbench/browser/actionRegistry');
import { SyncActionDescriptor } from 'vs/platform/actions/common/actions';
import { ListExtensionsAction, InstallExtensionAction } from './extensionsActions';
import { ListExtensionsAction, InstallExtensionAction, ListOutdatedExtensionsAction } from './extensionsActions';
import { IQuickOpenRegistry, Extensions, QuickOpenHandlerDescriptor } from 'vs/workbench/browser/quickopen';
import ipc = require('ipc');
......@@ -51,7 +51,7 @@ export class ExtensionsWorkbenchExtension implements IWorkbenchContribution {
'vs/workbench/parts/extensions/electron-browser/extensionsQuickOpen',
'LocalExtensionsHandler',
'ext ',
nls.localize('localExtensionsCommands', "Local Extensions Commands")
nls.localize('localExtensionsCommands', "Show Local Extensions")
)
);
......@@ -63,7 +63,19 @@ export class ExtensionsWorkbenchExtension implements IWorkbenchContribution {
'vs/workbench/parts/extensions/electron-browser/extensionsQuickOpen',
'GalleryExtensionsHandler',
'ext install ',
nls.localize('galleryExtensionsCommands', "Gallery Extensions Commands"),
nls.localize('galleryExtensionsCommands', "Install Gallery Extensions"),
true
)
);
actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(ListOutdatedExtensionsAction, ListOutdatedExtensionsAction.ID, ListOutdatedExtensionsAction.LABEL), extensionsCategory);
(<IQuickOpenRegistry>platform.Registry.as(Extensions.Quickopen)).registerQuickOpenHandler(
new QuickOpenHandlerDescriptor(
'vs/workbench/parts/extensions/electron-browser/extensionsQuickOpen',
'OutdatedExtensionsHandler',
'ext update ',
nls.localize('outdatedExtensionsCommands', "Update Outdated Extensions"),
true
)
);
......
......@@ -703,7 +703,7 @@ export class TextFileEditorModel extends BaseTextEditorModel implements IEncodin
}
if (!this.preferredEncoding && this.contentEncoding === encoding) {
return false; // also return if we dont have a preferred encoding but the content encoding is already the same
return false; // also return if we don't have a preferred encoding but the content encoding is already the same
}
return true;
......
......@@ -288,7 +288,7 @@ export abstract class BaseRenameAction extends BaseFileAction {
name = getWellFormedFileName(name);
let existingName = getWellFormedFileName(this.element.name);
// Return early if name is invalid or didnt change
// Return early if name is invalid or didn't change
if (name === existingName || this.validateFileName(this.element.parent, name)) {
return Promise.as(null);
}
......
......@@ -87,7 +87,7 @@ export class FileTracker implements IWorkbenchContribution {
this.emitInputStateChangeEvent(e.getAfter().resource);
if (!this.contextService.isAutoSaveEnabled()) {
this.updateActivityBadge(); // no indication needed when auto save is turned off and we didnt show dirty
this.updateActivityBadge(); // no indication needed when auto save is turned off and we didn't show dirty
}
}
......@@ -182,7 +182,7 @@ export class FileTracker implements IWorkbenchContribution {
this.handleMovedFileInVisibleEditors(before ? before.resource : null, after ? after.resource : null, after ? after.mime : null);
}
// Dispose all known inputs pased on resource
// Dispose all known inputs passed on resource
let oldFile = e.getBefore();
if ((e.gotMoved() || e.gotDeleted())) {
this.disposeAll(oldFile.resource, this.quickOpenService.getEditorHistory());
......
......@@ -75,7 +75,7 @@ let openViewletKb: IKeybindings = {
// Register file editors
(<IEditorRegistry>Registry.as(EditorExtensions.Editors)).registerEditor(
new FileEditorDescriptor(
TextFileEditor.ID, // explicit dependency because we dont want these editors lazy loaded
TextFileEditor.ID, // explicit dependency because we don't want these editors lazy loaded
nls.localize('textFileEditor', "Text File Editor"),
'vs/workbench/parts/files/browser/editors/textFileEditor',
'TextFileEditor',
......@@ -95,7 +95,7 @@ let openViewletKb: IKeybindings = {
(<IEditorRegistry>Registry.as(EditorExtensions.Editors)).registerEditor(
new FileEditorDescriptor(
BinaryFileEditor.ID, // explicit dependency because we dont want these editors lazy loaded
BinaryFileEditor.ID, // explicit dependency because we don't want these editors lazy loaded
nls.localize('binaryFileEditor', "Binary File Editor"),
'vs/workbench/parts/files/browser/editors/binaryFileEditor',
'BinaryFileEditor',
......
......@@ -150,7 +150,7 @@ export class ExplorerView extends CollapsibleViewletView {
// During workbench startup, the editor area might restore more than one editor from a previous
// session. When this happens there might be editor input changing events for side editors that
// dont have focus. In these cases we do not adjust explorer selection for non-focussed editors
// don't have focus. In these cases we do not adjust explorer selection for non-focused editors
// because we only want to react for the editor that has focus.
if (!this.partService.isCreated() && e.editorOptions && e.editorOptions.preserveFocus) {
return;
......@@ -198,10 +198,10 @@ export class ExplorerView extends CollapsibleViewletView {
public focus(): void {
super.focus();
// Open the focussed element in the editor if there is currently no file opened
// Open the focused element in the editor if there is currently no file opened
let input = this.editorService.getActiveEditorInput();
if (!input || !(input instanceof FileEditorInput)) {
this.openFocussedElement();
this.openFocusedElement();
}
}
......@@ -247,13 +247,13 @@ export class ExplorerView extends CollapsibleViewletView {
// Otherwise restore last used file: By Explorer selection
return refreshPromise.then(() => {
this.openFocussedElement();
this.openFocusedElement();
});
}
});
}
private openFocussedElement(): boolean {
private openFocusedElement(): boolean {
let stat: FileStat = this.explorerViewer.getFocus();
if (stat && !stat.isDirectory) {
let editorInput = this.instantiationService.createInstance(FileEditorInput, stat.resource, stat.mime, void 0);
......
......@@ -84,7 +84,7 @@ export class FileDataSource implements Tree.IDataSource {
// Convert to view model
let modelDirStat = FileStat.create(dirStat);
// Add childs to folder
// Add children to folder
for (let i = 0; i < modelDirStat.children.length; i++) {
stat.addChild(modelDirStat.children[i]);
}
......
......@@ -150,7 +150,7 @@ export class WorkingFilesView extends AdaptiveCollapsibleViewletView {
private onTextFileDirty(e: LocalFileChangeEvent): void {
if (!this.contextService.isAutoSaveEnabled()) {
this.updateDirtyIndicator(); // no indication needed when auto save is turned off and we didnt show dirty
this.updateDirtyIndicator(); // no indication needed when auto save is turned off and we didn't show dirty
}
}
......
......@@ -134,7 +134,7 @@ export class WorkingFilesActionProvider extends ContributableActionProvider {
return element instanceof WorkingFileEntry || super.hasActions(tree, element);
}
// we dont call into super here because we put only one primary action to the left (Remove/Dirty Indicator)
// we don't call into super here because we put only one primary action to the left (Remove/Dirty Indicator)
public getActions(tree: tree.ITree, element: WorkingFileEntry): TPromise<actions.IAction[]> {
let actions: actions.IAction[] = [];
......
......@@ -87,7 +87,7 @@ export class WorkingFilesModel implements filesCommon.IWorkingFilesModel {
private onTextFileDirty(e: filesCommon.LocalFileChangeEvent): void {
if (!this.contextService.isAutoSaveEnabled()) {
this.updateDirtyState(e.getAfter().resource, true); // no indication needed when auto save is turned off and we didnt show dirty
this.updateDirtyState(e.getAfter().resource, true); // no indication needed when auto save is turned off and we didn't show dirty
} else {
this.addEntry(e.getAfter().resource);
}
......
......@@ -294,7 +294,7 @@ export interface ITextFileService extends IDisposable {
isDirty(resource?: URI): boolean;
/**
* Returs all resources that are currently dirty matching the provided resource or all dirty resources.
* Returns all resources that are currently dirty matching the provided resource or all dirty resources.
*
* @param resource the resource to check for being dirty. If it is not specified, will check for
* all dirty resources.
......@@ -342,7 +342,7 @@ export interface ITextFileService extends IDisposable {
revertAll(resources?: URI[], force?: boolean): TPromise<ITextFileOperationResult>;
/**
* Brings up the confirm dialog to either save, dont save or cancel.
* Brings up the confirm dialog to either save, don't save or cancel.
*
* @param resource the resource of the file to ask for confirmation.
*/
......
......@@ -161,7 +161,7 @@ export class FileTracker implements IWorkbenchContribution {
private onTextFileDirty(e: LocalFileChangeEvent): void {
if (!this.contextService.isAutoSaveEnabled() && !this.isDocumentedEdited) {
this.updateDocumentEdited(); // no indication needed when auto save is turned off and we didnt show dirty
this.updateDocumentEdited(); // no indication needed when auto save is turned off and we didn't show dirty
}
}
......
......@@ -233,7 +233,7 @@ export class TextFileService extends BrowserTextFileService {
if (untitled) {
let targetPath: string;
// Untitled with associated file path dont need to prompt
// Untitled with associated file path don't need to prompt
if (this.untitledEditorService.hasAssociatedFilePath(untitled.getResource())) {
targetPath = untitled.getResource().fsPath;
}
......
......@@ -31,7 +31,7 @@ import {IFileService, IFileStat} from 'vs/platform/files/common/files';
import {IInstantiationService} from 'vs/platform/instantiation/common/instantiation';
import wbar = require('vs/workbench/browser/actionRegistry');
import { SyncActionDescriptor } from 'vs/platform/actions/common/actions';
import { OpenChangeAction } from './gitActions';
import { OpenChangeAction, SyncAction } from './gitActions';
import Severity from 'vs/base/common/severity';
function getStatus(gitService: IGitService, contextService: IWorkspaceContextService, input: WorkbenchEditorCommon.IFileEditorInput): IFileStatus {
......@@ -432,5 +432,7 @@ actionBarRegistry.registerActionBarContributor(abr.Scope.EDITOR, GitWorkingTreeD
let workbenchActionRegistry = (<wbar.IWorkbenchActionRegistry> platform.Registry.as(wbar.Extensions.WorkbenchActions));
// Register Action to Open Viewlet
workbenchActionRegistry.registerWorkbenchAction(new SyncActionDescriptor(GlobalOpenChangeAction, GlobalOpenChangeAction.ID, GlobalOpenChangeAction.LABEL), nls.localize('git', "Git"));
// Register Actions
const category = nls.localize('git', "Git");
workbenchActionRegistry.registerWorkbenchAction(new SyncActionDescriptor(GlobalOpenChangeAction, GlobalOpenChangeAction.ID, GlobalOpenChangeAction.LABEL), category);
workbenchActionRegistry.registerWorkbenchAction(new SyncActionDescriptor(SyncAction, SyncAction.ID, SyncAction.LABEL), category);
......@@ -406,7 +406,7 @@ export abstract class BaseUndoAction extends GitAction {
});
});
}).then(null, (errors: any[]): Promise => {
console.error('One or more errors occured', errors);
console.error('One or more errors occurred', errors);
return Promise.wrapError(errors[0]);
});
}
......@@ -941,9 +941,10 @@ export abstract class BaseSyncAction extends GitAction {
export class SyncAction extends BaseSyncAction {
static ID = 'workbench.action.sync';
static LABEL = nls.localize('sync', "Sync");
constructor(@IGitService gitService: IGitService) {
super(SyncAction.ID, nls.localize('sync', "Sync"), 'git-action sync', gitService);
constructor(id: string, label: string, @IGitService gitService: IGitService) {
super(id, label, 'git-action sync', gitService);
}
}
......
......@@ -246,7 +246,7 @@ export class ChangesView extends EventEmitter.EventEmitter implements GitView.IV
public getSecondaryActions(): Actions.IAction[] {
if (!this.secondaryActions) {
this.secondaryActions = [
this.instantiationService.createInstance(GitActions.SyncAction),
this.instantiationService.createInstance(GitActions.SyncAction, GitActions.SyncAction.ID, GitActions.SyncAction.LABEL),
this.instantiationService.createInstance(GitActions.PullAction),
this.instantiationService.createInstance(GitActions.PushAction),
new ActionBar.Separator(),
......
......@@ -69,7 +69,7 @@ export function intersectChangeAndSelection(change:editorcommon.IChange, selecti
}
/**
* Returns all selected changes (there can be mulitple selections due to mulitple cursors).
* Returns all selected changes (there can be multiple selections due to multiple cursors).
* If a change is partially selected, the selected part of the change will be returned.
*/
export function getSelectedChanges(changes:editorcommon.IChange[], selections:editorcommon.IEditorSelection[]):editorcommon.IChange[] {
......
......@@ -87,7 +87,7 @@ suite('Git - Stage ranges', () => {
changesEqual(result, expected);
});
test('Get selected changes test - mulitple changes selected with one selection', () => {
test('Get selected changes test - multiple changes selected with one selection', () => {
var selections: IEditorSelection[] = [];
selections.push(Selection.createSelection(2, 7, 7, 1));
var changes: IChange[] = [];
......@@ -119,7 +119,7 @@ suite('Git - Stage ranges', () => {
changesEqual(result, expected);
});
test('Get selected changes test - mulitple changes partially selected with multiple selections', () => {
test('Get selected changes test - multiple changes partially selected with multiple selections', () => {
var selections: IEditorSelection[] = [];
selections.push(Selection.createSelection(3, 1, 9, 5), Selection.createSelection(115, 2, 129, 1));
var changes: IChange[] = [];
......@@ -130,7 +130,7 @@ suite('Git - Stage ranges', () => {
changesEqual(result, expected);
});
test('Get selected changes test - mulitple changes selected with multiple selections. Multiple changes not selected', () => {
test('Get selected changes test - multiple changes selected with multiple selections. Multiple changes not selected', () => {
var selections: IEditorSelection[] = [];
selections.push(Selection.createSelection(33, 11, 79, 15), Selection.createSelection(155, 21, 189, 11));
var changes: IChange[] = [];
......
......@@ -11,7 +11,7 @@ import * as Platform from 'vs/base/common/platform';
import { SystemVariables } from 'vs/workbench/parts/lib/node/systemVariables';
suite('SystemVariables tests', () => {
test('SytemVariables: subsitute one', () => {
test('SystemVariables: substitute one', () => {
let systemVariables: SystemVariables = new SystemVariables(null, null, URI.parse('file:///VSCode/workspaceLocation'));
if (Platform.isWindows) {
assert.strictEqual(systemVariables.resolve('abc ${workspaceRoot} xyz'), 'abc \\VSCode\\workspaceLocation xyz');
......@@ -20,7 +20,7 @@ suite('SystemVariables tests', () => {
}
});
test('SytemVariables: subsitute many', () => {
test('SystemVariables: substitute many', () => {
let systemVariables: SystemVariables = new SystemVariables(null, null, URI.parse('file:///VSCode/workspaceLocation'));
if (Platform.isWindows) {
assert.strictEqual(systemVariables.resolve('${workspaceRoot} - ${workspaceRoot}'), '\\VSCode\\workspaceLocation - \\VSCode\\workspaceLocation');
......
......@@ -63,7 +63,7 @@ export class GlobalShowOutputAction extends Action {
channelToOpen = channels[0].getChannel();
}
// Fallback to any contributed channel otherwise if we dont have history
// Fallback to any contributed channel otherwise if we don't have history
else {
channelToOpen = (<IOutputChannelRegistry>Registry.as(Extensions.OutputChannels)).getChannels()[0];
}
......
......@@ -29,7 +29,7 @@ export class OpenAnythingHandler extends QuickOpenHandler {
private static SYMBOL_SEARCH_INITIAL_TIMEOUT = 500; // Ignore symbol search after a timeout to not block search results
private static SYMBOL_SEARCH_SUBSEQUENT_TIMEOUT = 100;
private static SEARCH_DELAY = 100; // This delay acommodates for the user typing a word and then stops typing to start searching
private static SEARCH_DELAY = 100; // This delay accommodates for the user typing a word and then stops typing to start searching
private openSymbolHandler: _OpenSymbolHandler;
private openFileHandler: OpenFileHandler;
......
......@@ -84,7 +84,7 @@ export class FileEntry extends EditorQuickOpenEntry {
export class OpenFileHandler extends QuickOpenHandler {
private static SEARCH_DELAY = 500; // This delay acommodates for the user typing a word and then stops typing to start searching
private static SEARCH_DELAY = 500; // This delay accommodates for the user typing a word and then stops typing to start searching
private queryBuilder: QueryBuilder;
private delayer: ThrottledDelayer;
......
......@@ -90,7 +90,7 @@ class SymbolEntry extends EditorQuickOpenEntry {
export class OpenSymbolHandler extends QuickOpenHandler {
private static SUPPORTED_OPEN_TYPES = ['class', 'interface', 'enum', 'function', 'method'];
private static SEARCH_DELAY = 500; // This delay acommodates for the user typing a word and then stops typing to start searching
private static SEARCH_DELAY = 500; // This delay accommodates for the user typing a word and then stops typing to start searching
private delayer: ThrottledDelayer;
private isStandalone: boolean;
......
......@@ -929,7 +929,7 @@ export class SearchViewlet extends Viewlet {
this.viewModel.toggleHighlights(visible);
}
// Open focussed element from results in case the editor area is otherwise empty
// Open focused element from results in case the editor area is otherwise empty
if (visible && !this.editorService.getActiveEditorInput()) {
let focus = this.tree.getFocus();
if (focus) {
......
......@@ -204,12 +204,12 @@ export class StartStopProblemCollector extends AbstractProblemCollector implemen
this.currentResource = resource;
this.currentResourceAsString = resourceAsString;
}
let markerDatas = this.markers[owner];
if (!markerDatas) {
markerDatas = [];
this.markers[owner] = markerDatas;
let markerData = this.markers[owner];
if (!markerData) {
markerData = [];
this.markers[owner] = markerData;
}
markerDatas.push(markerMatch.marker);
markerData.push(markerMatch.marker);
} else {
this.reportedResourcesWithMarkers[owner][resourceAsString] = resource;
}
......@@ -316,12 +316,12 @@ export class WatchingProblemCollector extends AbstractProblemCollector implement
this.currentResource = resource;
this.currentResourceAsString = resourceAsString;
}
let markerDatas = this.markers[owner];
if (!markerDatas) {
markerDatas = [];
this.markers[owner] = markerDatas;
let markerData = this.markers[owner];
if (!markerData) {
markerData = [];
this.markers[owner] = markerData;
}
markerDatas.push(markerMatch.marker);
markerData.push(markerMatch.marker);
} else {
this.removeResourceToClean(owner, resourceAsString);
}
......
......@@ -1025,7 +1025,7 @@ if (Env.enableTasks) {
'isShellCommand': {
'type': 'boolean',
'default': true,
'description': nls.localize('JsonSchema.shell', 'Specifies whether the command is a shell command or an external programm. Defaults to false if omitted.')
'description': nls.localize('JsonSchema.shell', 'Specifies whether the command is a shell command or an external program. Defaults to false if omitted.')
},
'args': {
'type': 'array',
......@@ -1053,7 +1053,7 @@ if (Env.enableTasks) {
},
'showOutput': {
'$ref': '#/definitions/showOutputType',
'description': nls.localize('JsonSchema.showOuput', 'Controls whether the output of the running task is shown or not. If omitted \'always\' is used.')
'description': nls.localize('JsonSchema.showOutput', 'Controls whether the output of the running task is shown or not. If omitted \'always\' is used.')
},
'isWatching': {
'type': 'boolean',
......@@ -1111,7 +1111,7 @@ if (Env.enableTasks) {
},
'showOutput': {
'$ref': '#/definitions/showOutputType',
'description': nls.localize('JsonSchema.tasks.showOuput', 'Controls whether the output of the running task is shown or not. If omitted the globally defined value is used.')
'description': nls.localize('JsonSchema.tasks.showOutput', 'Controls whether the output of the running task is shown or not. If omitted the globally defined value is used.')
},
'echoCommand': {
'type': 'boolean',
......
......@@ -3,5 +3,5 @@
set ATOM_SHELL_INTERNAL_RUN_AS_NODE=1
pushd %~dp0\..
..\Electron-Build\Code.exe .\node_modules\mocha\bin\_mocha %*
.\.build\electron\Code.exe .\node_modules\mocha\bin\_mocha %*
popd
......@@ -10,13 +10,15 @@ fi
# Unit Tests
if [[ "$OSTYPE" == "darwin"* ]]; then
cd $ROOT ; ulimit -n 4096 ; ATOM_SHELL_INTERNAL_RUN_AS_NODE=1 \
../Electron-Build/Electron.app/Contents/MacOS/Electron \
./.build/electron/Electron.app/Contents/MacOS/Electron \
node_modules/mocha/bin/_mocha $*
else
cd $ROOT ; ATOM_SHELL_INTERNAL_RUN_AS_NODE=1 \
../Electron-Build/electron \
./.build/electron/electron \
node_modules/mocha/bin/_mocha $*
fi
# Integration Tests
./scripts/code.sh $ROOT/extensions/vscode-api-tests/testWorkspace --extensionDevelopmentPath=$ROOT/extensions/vscode-api-tests --extensionTestsPath=$ROOT/extensions/vscode-api-tests/out
\ No newline at end of file
if [[ "$SKIP_INTEGRATION_TESTS" == "" ]]; then
./scripts/code.sh $ROOT/extensions/vscode-api-tests/testWorkspace --extensionDevelopmentPath=$ROOT/extensions/vscode-api-tests --extensionTestsPath=$ROOT/extensions/vscode-api-tests/out
fi
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册