mirror of
https://github.com/microsoft/vscode.git
synced 2026-09-26 09:45:54 +01:00
Merge branch 'master' into alex/perf
This commit is contained in:
@@ -374,8 +374,13 @@ function prepareRpmPackage(arch) {
|
||||
|
||||
function buildRpmPackage(arch) {
|
||||
var rpmArch = getRpmPackageArch(arch);
|
||||
var rpmOut = rpmBuildPath + '/RPMS/' + rpmArch;
|
||||
var destination = '.build/linux/rpm/' + rpmArch;
|
||||
return shell.task([
|
||||
'mkdir -p ' + destination,
|
||||
'fakeroot rpmbuild -bb ' + rpmBuildPath + '/SPECS/' + product.applicationName + '.spec --target=' + rpmArch,
|
||||
'cp "' + rpmOut + '/$(ls ' + rpmOut + ')" ' + destination + '/vscode-' + rpmArch + '.rpm',
|
||||
'createrepo ' + destination
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"account": "monacobuild",
|
||||
"container": "debuggers",
|
||||
"zip": "63e4d82/node-debug.zip",
|
||||
"zip": "0d69bd8/node-debug.zip",
|
||||
"output": ""
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"contributes": {
|
||||
"languages": [{
|
||||
"id": "vb",
|
||||
"extensions": [ ".vb", ".brs", ".vbs" ],
|
||||
"extensions": [ ".vb", ".brs", ".vbs", ".bas" ],
|
||||
"aliases": [ "Visual Basic", "vb" ],
|
||||
"configuration": "./vb.configuration.json"
|
||||
}],
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@
|
||||
"documentdb": "^1.5.1",
|
||||
"event-stream": "^3.1.7",
|
||||
"express": "^4.13.1",
|
||||
"ghooks": "^1.0.1",
|
||||
"ghooks": "1.0.3",
|
||||
"glob": "^5.0.13",
|
||||
"gulp": "^3.8.9",
|
||||
"gulp-atom-electron": "^1.5.2",
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
import 'vs/css!./builder';
|
||||
import {TPromise} from 'vs/base/common/winjs.base';
|
||||
import types = require('vs/base/common/types');
|
||||
import {IDisposable, disposeAll} from 'vs/base/common/lifecycle';
|
||||
import {IDisposable, dispose} from 'vs/base/common/lifecycle';
|
||||
import strings = require('vs/base/common/strings');
|
||||
import assert = require('vs/base/common/assert');
|
||||
import DOM = require('vs/base/browser/dom');
|
||||
@@ -627,11 +627,11 @@ export class Builder implements IDisposable {
|
||||
let type = arg1;
|
||||
if (useCapture) {
|
||||
if (this.captureToUnbind[type]) {
|
||||
this.captureToUnbind[type] = disposeAll(this.captureToUnbind[type]);
|
||||
this.captureToUnbind[type] = dispose(this.captureToUnbind[type]);
|
||||
}
|
||||
} else {
|
||||
if (this.toUnbind[type]) {
|
||||
this.toUnbind[type] = disposeAll(this.toUnbind[type]);
|
||||
this.toUnbind[type] = dispose(this.toUnbind[type]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1769,13 +1769,13 @@ export class Builder implements IDisposable {
|
||||
|
||||
for (type in this.toUnbind) {
|
||||
if (this.toUnbind.hasOwnProperty(type) && types.isArray(this.toUnbind[type])) {
|
||||
this.toUnbind[type] = disposeAll(this.toUnbind[type]);
|
||||
this.toUnbind[type] = dispose(this.toUnbind[type]);
|
||||
}
|
||||
}
|
||||
|
||||
for (type in this.captureToUnbind) {
|
||||
if (this.captureToUnbind.hasOwnProperty(type) && types.isArray(this.captureToUnbind[type])) {
|
||||
this.captureToUnbind[type] = disposeAll(this.captureToUnbind[type]);
|
||||
this.captureToUnbind[type] = dispose(this.captureToUnbind[type]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import {Disposable, IDisposable, disposeAll} from 'vs/base/common/lifecycle';
|
||||
import {Disposable, IDisposable, dispose} from 'vs/base/common/lifecycle';
|
||||
import * as dom from 'vs/base/browser/dom';
|
||||
import {IframeUtils} from 'vs/base/browser/iframe';
|
||||
import {StandardMouseEvent} from 'vs/base/browser/mouseEvent';
|
||||
@@ -64,7 +64,7 @@ export class GlobalMouseMoveMonitor<R> extends Disposable {
|
||||
}
|
||||
|
||||
// Unhook
|
||||
this.hooks = disposeAll(this.hooks);
|
||||
this.hooks = dispose(this.hooks);
|
||||
this.mouseMoveEventMerger = null;
|
||||
this.mouseMoveCallback = null;
|
||||
let onStopCallback = this.onStopCallback;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
'use strict';
|
||||
|
||||
import arrays = require('vs/base/common/arrays');
|
||||
import {IDisposable, disposeAll} from 'vs/base/common/lifecycle';
|
||||
import {IDisposable, dispose} from 'vs/base/common/lifecycle';
|
||||
import DomUtils = require('vs/base/browser/dom');
|
||||
|
||||
export namespace EventType {
|
||||
@@ -90,7 +90,7 @@ export class Gesture implements IDisposable {
|
||||
}
|
||||
|
||||
public set target(element: HTMLElement) {
|
||||
this.callOnTarget = disposeAll(this.callOnTarget);
|
||||
this.callOnTarget = dispose(this.callOnTarget);
|
||||
|
||||
this.activeTouches = {};
|
||||
|
||||
|
||||
@@ -712,7 +712,7 @@ export class ActionBar extends EventEmitter implements IActionRunner {
|
||||
this.focusTracker = null;
|
||||
}
|
||||
|
||||
this.toDispose = lifecycle.disposeAll(this.toDispose);
|
||||
this.toDispose = lifecycle.dispose(this.toDispose);
|
||||
|
||||
this.getContainer().destroy();
|
||||
|
||||
@@ -792,7 +792,7 @@ export class SelectActionItem extends BaseActionItem {
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
this.toDispose = lifecycle.disposeAll(this.toDispose);
|
||||
this.toDispose = lifecycle.dispose(this.toDispose);
|
||||
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
import 'vs/css!./contextview';
|
||||
import {Builder, $} from 'vs/base/browser/builder';
|
||||
import DOM = require('vs/base/browser/dom');
|
||||
import {IDisposable, disposeAll} from 'vs/base/common/lifecycle';
|
||||
import {IDisposable, dispose} from 'vs/base/common/lifecycle';
|
||||
import {EventEmitter} from 'vs/base/common/eventEmitter';
|
||||
|
||||
export interface IAnchor {
|
||||
@@ -251,6 +251,6 @@ export class ContextView extends EventEmitter {
|
||||
super.dispose();
|
||||
this.hide();
|
||||
|
||||
this.toDispose = disposeAll(this.toDispose);
|
||||
this.toDispose = dispose(this.toDispose);
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@ import {Gesture, EventType} from 'vs/base/browser/touch';
|
||||
import {ActionRunner, IAction} from 'vs/base/common/actions';
|
||||
import {ActionItem, IActionItem} from 'vs/base/browser/ui/actionbar/actionbar';
|
||||
import {EventEmitter} from 'vs/base/common/eventEmitter';
|
||||
import {IDisposable, disposeAll} from 'vs/base/common/lifecycle';
|
||||
import {IDisposable, dispose} from 'vs/base/common/lifecycle';
|
||||
import {IContextViewProvider} from 'vs/base/browser/ui/contextview/contextview';
|
||||
import {IMenuOptions} from 'vs/base/browser/ui/menu/menu';
|
||||
|
||||
@@ -120,7 +120,7 @@ export class BaseDropdown extends ActionRunner {
|
||||
super.dispose();
|
||||
this.hide();
|
||||
|
||||
this.toDispose = disposeAll(this.toDispose);
|
||||
this.toDispose = dispose(this.toDispose);
|
||||
|
||||
if (this.$boxContainer) {
|
||||
this.$boxContainer.destroy();
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import { IScrollable, ScrollEvent } from 'vs/base/common/scrollable';
|
||||
import { Emitter } from 'vs/base/common/event';
|
||||
import { toObject, assign } from 'vs/base/common/objects';
|
||||
import { IDisposable, disposeAll } from 'vs/base/common/lifecycle';
|
||||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import { Gesture } from 'vs/base/browser/touch';
|
||||
import * as DOM from 'vs/base/browser/dom';
|
||||
import { IScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement';
|
||||
@@ -355,6 +355,6 @@ export class ListView<T> implements IScrollable, IDisposable {
|
||||
this._domNode = null;
|
||||
}
|
||||
|
||||
this.toDispose = disposeAll(this.toDispose);
|
||||
this.toDispose = dispose(this.toDispose);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import 'vs/css!./list';
|
||||
import { IDisposable, dispose, disposeAll } from 'vs/base/common/lifecycle';
|
||||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import { isNumber } from 'vs/base/common/types';
|
||||
import * as DOM from 'vs/base/browser/dom';
|
||||
import Event, { Emitter, mapEvent, EventBufferer } from 'vs/base/common/event';
|
||||
@@ -134,7 +134,7 @@ class Controller<T> implements IDisposable {
|
||||
}
|
||||
|
||||
dispose() {
|
||||
this.toDispose = disposeAll(this.toDispose);
|
||||
this.toDispose = dispose(this.toDispose);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -140,10 +140,6 @@
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.global-message-list li.message-list-entry .actions-container.multiple .message-action .action-button {
|
||||
min-width: 45px;
|
||||
text-align: center;
|
||||
}
|
||||
.vs .global-message-list {
|
||||
background-color: #2C2C2C;
|
||||
}
|
||||
|
||||
@@ -208,7 +208,7 @@ export class MessageList {
|
||||
|
||||
// Actions (if none provided, add one default action to hide message)
|
||||
let messageActions = this.getMessageActions(message);
|
||||
li.div({ class: (total > 1 || delta < 0) ? 'actions-container multiple' : 'actions-container' }, (actionContainer) => {
|
||||
li.div({ class: 'actions-container' }, (actionContainer) => {
|
||||
for (let i = messageActions.length - 1; i >= 0; i--) {
|
||||
let action = messageActions[i];
|
||||
actionContainer.div({ class: 'message-action' }, (div) => {
|
||||
|
||||
@@ -12,7 +12,7 @@ import browser = require('vs/base/browser/browser');
|
||||
import {Builder, $} from 'vs/base/browser/builder';
|
||||
import DOM = require('vs/base/browser/dom');
|
||||
import uuid = require('vs/base/common/uuid');
|
||||
import {IDisposable,disposeAll} from 'vs/base/common/lifecycle';
|
||||
import {IDisposable,dispose} from 'vs/base/common/lifecycle';
|
||||
|
||||
const css_done = 'done';
|
||||
const css_active = 'active';
|
||||
@@ -239,6 +239,6 @@ export class ProgressBar {
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
this.toUnbind = disposeAll(this.toUnbind);
|
||||
this.toUnbind = dispose(this.toUnbind);
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
'use strict';
|
||||
|
||||
import 'vs/css!./sash';
|
||||
import {IDisposable, disposeAll} from 'vs/base/common/lifecycle';
|
||||
import {IDisposable, dispose} from 'vs/base/common/lifecycle';
|
||||
import {Builder, $} from 'vs/base/browser/builder';
|
||||
import {isIPad} from 'vs/base/browser/browser';
|
||||
import types = require('vs/base/common/types');
|
||||
@@ -188,7 +188,7 @@ export class Sash extends EventEmitter {
|
||||
|
||||
listeners.push(DOM.addDisposableListener(this.$e.getHTMLElement(), EventType.End, (event: GestureEvent) => {
|
||||
this.emit('end');
|
||||
disposeAll(listeners);
|
||||
dispose(listeners);
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import {
|
||||
IScrollableElementOptions, IScrollbar, IDimensions, IMouseWheelEvent, visibilityFromString,
|
||||
IScrollableElement, IScrollableElementCreationOptions, IOverviewRulerLayoutInfo
|
||||
} from 'vs/base/browser/ui/scrollbar/scrollableElement';
|
||||
import {IDisposable, disposeAll} from 'vs/base/common/lifecycle';
|
||||
import {IDisposable, dispose} from 'vs/base/common/lifecycle';
|
||||
import {IScrollable, DelegateScrollable} from 'vs/base/common/scrollable';
|
||||
import {Widget} from 'vs/base/browser/ui/widget';
|
||||
import {TimeoutTimer} from 'vs/base/common/async';
|
||||
@@ -106,7 +106,7 @@ export class ScrollableElement extends Widget implements IScrollableElement {
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
this._mouseWheelToDispose = disposeAll(this._mouseWheelToDispose);
|
||||
this._mouseWheelToDispose = dispose(this._mouseWheelToDispose);
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@@ -175,7 +175,7 @@ export class ScrollableElement extends Widget implements IScrollableElement {
|
||||
}
|
||||
|
||||
// Stop listening (if necessary)
|
||||
this._mouseWheelToDispose = disposeAll(this._mouseWheelToDispose);
|
||||
this._mouseWheelToDispose = dispose(this._mouseWheelToDispose);
|
||||
|
||||
// Start listening (if necessary)
|
||||
if (shouldListen) {
|
||||
|
||||
@@ -807,9 +807,9 @@ export class SplitView implements
|
||||
this.viewElements.forEach(e => this.el.removeChild(e));
|
||||
this.el = null;
|
||||
this.viewElements = [];
|
||||
this.views = lifecycle.disposeAll(this.views);
|
||||
this.sashes = lifecycle.disposeAll(this.sashes);
|
||||
this.sashesListeners = lifecycle.disposeAll(this.sashesListeners);
|
||||
this.views = lifecycle.dispose(this.views);
|
||||
this.sashes = lifecycle.dispose(this.sashes);
|
||||
this.sashesListeners = lifecycle.dispose(this.sashesListeners);
|
||||
this.measureContainerSize = null;
|
||||
this.layoutViewElement = null;
|
||||
this.eventWrapper = null;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import 'vs/css!./timer';
|
||||
import {TimeKeeper, ITimerEvent, getTimeKeeper} from 'vs/base/common/timer';
|
||||
import {IDisposable, disposeAll} from 'vs/base/common/lifecycle';
|
||||
import {IDisposable, dispose} from 'vs/base/common/lifecycle';
|
||||
import DomUtils = require('vs/base/browser/dom');
|
||||
|
||||
interface IUnmatchedStartTimerEvent {
|
||||
@@ -50,7 +50,7 @@ export class TimeKeeperRenderer {
|
||||
public destroy(): void {
|
||||
document.body.removeChild(this.outerDomNode);
|
||||
window.clearInterval(this.intervalTokenId);
|
||||
this.listenersToRemove = disposeAll(this.listenersToRemove);
|
||||
this.listenersToRemove = dispose(this.listenersToRemove);
|
||||
}
|
||||
|
||||
private _createDomNode(): HTMLElement {
|
||||
|
||||
@@ -157,7 +157,7 @@ export function distinct<T>(array: T[], keyFn?: (t: T) => string): T[] {
|
||||
});
|
||||
}
|
||||
|
||||
const seen: { [key: string]: boolean; } = {};
|
||||
const seen: { [key: string]: boolean; } = Object.create(null);
|
||||
return array.filter((elem) => {
|
||||
const key = keyFn(elem);
|
||||
if (seen[key]) {
|
||||
|
||||
@@ -25,7 +25,7 @@ export interface IMatch {
|
||||
* filter.
|
||||
*/
|
||||
export function or(...filter: IFilter[]): IFilter {
|
||||
return function(word: string, wordToMatchAgainst: string): IMatch[] {
|
||||
return function (word: string, wordToMatchAgainst: string): IMatch[] {
|
||||
for (let i = 0, len = filter.length; i < len; i++) {
|
||||
let match = filter[i](word, wordToMatchAgainst);
|
||||
if (match) {
|
||||
@@ -42,7 +42,7 @@ export function or(...filter: IFilter[]): IFilter {
|
||||
* returned if *all* filters match.
|
||||
*/
|
||||
export function and(...filter: IFilter[]): IFilter {
|
||||
return function(word: string, wordToMatchAgainst: string): IMatch[] {
|
||||
return function (word: string, wordToMatchAgainst: string): IMatch[] {
|
||||
let result: IMatch[] = [];
|
||||
for (let i = 0, len = filter.length; i < len; i++) {
|
||||
let match = filter[i](word, wordToMatchAgainst);
|
||||
@@ -242,6 +242,54 @@ export function matchesCamelCase(word: string, camelCaseWord: string): IMatch[]
|
||||
return result;
|
||||
}
|
||||
|
||||
// Matches beginning of words supporting non-ASCII languages
|
||||
// E.g. "gp" or "g p" will match "Git: Pull"
|
||||
// Useful in cases where the target is words (e.g. command labels)
|
||||
|
||||
export function matchesWords(word: string, target: string): IMatch[] {
|
||||
if (target.length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
let result: IMatch[] = null;
|
||||
let i = 0;
|
||||
|
||||
while (i < target.length && (result = _matchesWords(word.toLowerCase(), target, 0, i)) === null) {
|
||||
i = nextWord(target, i + 1);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
function _matchesWords(word: string, target: string, i: number, j: number): IMatch[] {
|
||||
if (i === word.length) {
|
||||
return [];
|
||||
} else if (j === target.length) {
|
||||
return null;
|
||||
} else if (word[i] !== target[j].toLowerCase()) {
|
||||
return null;
|
||||
} else {
|
||||
let result = null;
|
||||
let nextWordIndex = j + 1;
|
||||
result = _matchesWords(word, target, i + 1, j + 1);
|
||||
while (!result && (nextWordIndex = nextWord(target, nextWordIndex)) < target.length) {
|
||||
result = _matchesWords(word, target, i + 1, nextWordIndex);
|
||||
nextWordIndex++;
|
||||
}
|
||||
return result === null ? null : join({ start: j, end: j + 1 }, result);
|
||||
}
|
||||
}
|
||||
|
||||
function nextWord(word: string, start: number): number {
|
||||
for (let i = start; i < word.length; i++) {
|
||||
let c = word.charCodeAt(i);
|
||||
if (isWhitespace(c) || (i > 0 && isWhitespace(word.charCodeAt(i - 1)))) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return word.length;
|
||||
}
|
||||
|
||||
// Fuzzy
|
||||
|
||||
export enum SubstringMatching {
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import { isArray } from './types';
|
||||
|
||||
export const empty: IDisposable = Object.freeze({
|
||||
dispose() { }
|
||||
});
|
||||
@@ -12,44 +14,29 @@ export interface IDisposable {
|
||||
dispose(): void;
|
||||
}
|
||||
|
||||
export function dispose<T extends IDisposable>(disposable: T): T {
|
||||
if (disposable) {
|
||||
disposable.dispose();
|
||||
export function dispose<T extends IDisposable>(disposable: T): T;
|
||||
export function dispose<T extends IDisposable>(disposables: T[]): T[];
|
||||
export function dispose<T extends IDisposable>(...disposables: T[]): T[];
|
||||
export function dispose<T extends IDisposable>(arg: any): T[] {
|
||||
if (isArray(arg)) {
|
||||
const disposables: T[] = arg;
|
||||
disposables.forEach(d => d && d.dispose());
|
||||
return [];
|
||||
}
|
||||
|
||||
const disposable: T = arg;
|
||||
disposable.dispose();
|
||||
return null;
|
||||
}
|
||||
|
||||
export function disposeAll<T extends IDisposable>(arr: T[]): T[] {
|
||||
if (arr) {
|
||||
for (let i = 0, len = arr.length; i < len; i++) {
|
||||
if (arr[i]) {
|
||||
arr[i].dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
||||
export function combinedDispose(...disposables: IDisposable[]): IDisposable {
|
||||
return {
|
||||
dispose: () => disposeAll(disposables)
|
||||
};
|
||||
}
|
||||
|
||||
export function combinedDispose2(disposables: IDisposable[]): IDisposable {
|
||||
return {
|
||||
dispose: () => disposeAll(disposables)
|
||||
};
|
||||
}
|
||||
|
||||
export function fnToDisposable(fn: () => void): IDisposable {
|
||||
return {
|
||||
dispose: () => fn()
|
||||
};
|
||||
export function combinedDisposable(disposables: IDisposable[]): IDisposable;
|
||||
export function combinedDisposable(...disposables: IDisposable[]): IDisposable;
|
||||
export function combinedDisposable(disposables: any): IDisposable {
|
||||
return { dispose: () => dispose(disposables) };
|
||||
}
|
||||
|
||||
export function toDisposable(...fns: (() => void)[]): IDisposable {
|
||||
return combinedDispose2(fns.map(fnToDisposable));
|
||||
return combinedDisposable(fns.map(fn => ({ dispose: fn })));
|
||||
}
|
||||
|
||||
function callAll(arg: any): any {
|
||||
@@ -87,7 +74,7 @@ export abstract class Disposable implements IDisposable {
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
this._toDispose = disposeAll(this._toDispose);
|
||||
this._toDispose = dispose(this._toDispose);
|
||||
}
|
||||
|
||||
protected _register<T extends IDisposable>(t:T): T {
|
||||
|
||||
@@ -98,7 +98,7 @@ export const language = _language;
|
||||
/**
|
||||
* The OS locale or the locale specified by --locale. The format of
|
||||
* the string is all lower case (e.g. zh-tw for Traditional
|
||||
* Chinese)
|
||||
* Chinese). The UI is not necessarily shown in the provided locale.
|
||||
*/
|
||||
export const locale = _locale;
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
* Character score: 1
|
||||
* Same case bonus: 1
|
||||
* Upper case bonus: 1
|
||||
* Consecutive match bonus: 5
|
||||
* Start of word/path bonus: 7
|
||||
* Start of string bonus: 8
|
||||
*/
|
||||
@@ -48,40 +49,44 @@ export function score(target: string, query: string, cache?: {[id: string]: numb
|
||||
const queryLower = query.toLowerCase();
|
||||
|
||||
let index = 0;
|
||||
let lastIndexOf = -1;
|
||||
let startAt = 0;
|
||||
let score = 0;
|
||||
while (index < queryLen) {
|
||||
var indexOf = targetLower.indexOf(queryLower[index], lastIndexOf + 1);
|
||||
let indexOf = targetLower.indexOf(queryLower[index], startAt);
|
||||
if (indexOf < 0) {
|
||||
score = 0; // This makes sure that the query is contained in the target
|
||||
break;
|
||||
}
|
||||
|
||||
lastIndexOf = indexOf;
|
||||
|
||||
// Character Match Bonus
|
||||
// Character match bonus
|
||||
score += 1;
|
||||
|
||||
// Same Case Bonous
|
||||
// Consecutive match bonus
|
||||
if (startAt === indexOf) {
|
||||
score += 5;
|
||||
}
|
||||
|
||||
// Same case bonus
|
||||
if (target[indexOf] === query[indexOf]) {
|
||||
score += 1;
|
||||
}
|
||||
|
||||
// Prefix Bonus
|
||||
// Start of word bonus
|
||||
if (indexOf === 0) {
|
||||
score += 8;
|
||||
}
|
||||
|
||||
// Start of Word/Path Bonous
|
||||
// After separator bonus
|
||||
else if (wordPathBoundary.some(w => w === target[indexOf - 1])) {
|
||||
score += 7;
|
||||
}
|
||||
|
||||
// Inside Word Upper Case Bonus
|
||||
// Inside word upper case bonus
|
||||
else if (isUpper(target.charCodeAt(indexOf))) {
|
||||
score += 1;
|
||||
}
|
||||
|
||||
startAt = indexOf + 1;
|
||||
index++;
|
||||
}
|
||||
|
||||
@@ -110,7 +115,7 @@ export function matches(target: string, queryLower: string): boolean {
|
||||
let index = 0;
|
||||
let lastIndexOf = -1;
|
||||
while (index < queryLen) {
|
||||
var indexOf = targetLower.indexOf(queryLower[index], lastIndexOf + 1);
|
||||
let indexOf = targetLower.indexOf(queryLower[index], lastIndexOf + 1);
|
||||
if (indexOf < 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import { Promise, TPromise } from 'vs/base/common/winjs.base';
|
||||
import { assign } from 'vs/base/common/objects';
|
||||
import { IDisposable, fnToDisposable } from 'vs/base/common/lifecycle';
|
||||
import { IDisposable, toDisposable } from 'vs/base/common/lifecycle';
|
||||
import { Emitter } from 'vs/base/common/event';
|
||||
|
||||
enum RequestType {
|
||||
@@ -174,7 +174,7 @@ export class Server {
|
||||
this.protocol.send(<IRawResponse> { id, data, type: ResponseType.Progress });
|
||||
});
|
||||
|
||||
this.activeRequests[request.id] = fnToDisposable(() => requestPromise.cancel());
|
||||
this.activeRequests[request.id] = toDisposable(() => requestPromise.cancel());
|
||||
}
|
||||
|
||||
private onCancelRequest(request: IRawRequest): void {
|
||||
|
||||
@@ -26,7 +26,7 @@ import {DefaultController, ClickBehavior} from 'vs/base/parts/tree/browser/treeD
|
||||
import DOM = require('vs/base/browser/dom');
|
||||
import {IActionProvider} from 'vs/base/parts/tree/browser/actionsRenderer';
|
||||
import {KeyCode} from 'vs/base/common/keyCodes';
|
||||
import {IDisposable,disposeAll} from 'vs/base/common/lifecycle';
|
||||
import {IDisposable,dispose} from 'vs/base/common/lifecycle';
|
||||
|
||||
export interface IQuickOpenCallbacks {
|
||||
onOk: () => void;
|
||||
@@ -609,7 +609,7 @@ export class QuickOpenWidget implements IModelProvider {
|
||||
if (!complete) {
|
||||
complete = true;
|
||||
|
||||
unbind = disposeAll(unbind);
|
||||
unbind = dispose(unbind);
|
||||
|
||||
c(null);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
import Assert = require('vs/base/common/assert');
|
||||
import { onUnexpectedError } from 'vs/base/common/errors';
|
||||
import { IDisposable, combinedDispose } from 'vs/base/common/lifecycle';
|
||||
import { IDisposable, combinedDisposable } from 'vs/base/common/lifecycle';
|
||||
import arrays = require('vs/base/common/arrays');
|
||||
import { INavigator } from 'vs/base/common/iterator';
|
||||
import Events = require('vs/base/common/eventEmitter');
|
||||
@@ -804,13 +804,13 @@ export class TreeModel extends Events.EventEmitter {
|
||||
|
||||
this.registry = new ItemRegistry();
|
||||
|
||||
this.registryDisposable = combinedDispose(
|
||||
this.registryDisposable = combinedDisposable([
|
||||
this.addEmitter2(this.registry),
|
||||
this.registry.addListener2('item:dispose', (event: IItemDisposeEvent) => {
|
||||
event.item.getAllTraits()
|
||||
.forEach(trait => delete this.traitsToItems[trait][event.item.id]);
|
||||
})
|
||||
);
|
||||
]);
|
||||
|
||||
var id = this.context.dataSource.getId(this.context.tree, element);
|
||||
this.input = new RootItem(id, this.registry, this.context, this.lock, element);
|
||||
|
||||
@@ -1655,7 +1655,7 @@ export class TreeView extends HeightMap implements IScrollable {
|
||||
this.releaseModel();
|
||||
this.modelListeners = null;
|
||||
|
||||
this.viewListeners = Lifecycle.disposeAll(this.viewListeners);
|
||||
this.viewListeners = Lifecycle.dispose(this.viewListeners);
|
||||
|
||||
if (this.domNode.parentNode) {
|
||||
this.domNode.parentNode.removeChild(this.domNode);
|
||||
|
||||
@@ -101,7 +101,7 @@ class EventCounter {
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
this.listeners = lifecycle.disposeAll(this.listeners);
|
||||
this.listeners = lifecycle.dispose(this.listeners);
|
||||
this._count = -1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,5 +48,17 @@ suite('Arrays', () => {
|
||||
assert.equal(arrays.binarySearch(array, 70, compare), ~10);
|
||||
|
||||
});
|
||||
|
||||
test('distinct', function() {
|
||||
function compare(a: string): string {
|
||||
return a;
|
||||
}
|
||||
|
||||
assert.deepEqual(arrays.distinct(['32', '4', '5'], compare), ['32', '4', '5']);
|
||||
assert.deepEqual(arrays.distinct(['32', '4', '5', '4'], compare), ['32', '4', '5']);
|
||||
assert.deepEqual(arrays.distinct(['32', 'constructor', '5', '1'], compare), ['32', 'constructor', '5', '1']);
|
||||
assert.deepEqual(arrays.distinct(['32', 'constructor', 'proto', 'proto', 'constructor'], compare), ['32', 'constructor', 'proto']);
|
||||
assert.deepEqual(arrays.distinct(['32', '4', '5', '32', '4', '5', '32', '4', '5', '5'], compare), ['32', '4', '5']);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
'use strict';
|
||||
|
||||
import * as assert from 'assert';
|
||||
import { IFilter, or, matchesPrefix, matchesStrictPrefix, matchesCamelCase, matchesSubString, matchesContiguousSubString } from 'vs/base/common/filters';
|
||||
import { IFilter, or, matchesPrefix, matchesStrictPrefix, matchesCamelCase, matchesSubString, matchesContiguousSubString, matchesWords } from 'vs/base/common/filters';
|
||||
|
||||
function filterOk(filter: IFilter, word: string, wordToMatchAgainst: string, highlights?: { start: number; end: number; }[]) {
|
||||
var r = filter(word, wordToMatchAgainst);
|
||||
@@ -19,8 +19,8 @@ function filterNotOk(filter, word, suggestion) {
|
||||
assert(!filter(word, suggestion));
|
||||
}
|
||||
|
||||
suite("Filters", () => {
|
||||
test("or", function () {
|
||||
suite('Filters', () => {
|
||||
test('or', function () {
|
||||
var filter, counters;
|
||||
var newFilter = function (i, r) {
|
||||
return function () { counters[i]++; return r; };
|
||||
@@ -28,136 +28,163 @@ suite("Filters", () => {
|
||||
|
||||
counters = [0,0];
|
||||
filter = or(newFilter(0, false), newFilter(1, false));
|
||||
filterNotOk(filter, "anything", "anything");
|
||||
filterNotOk(filter, 'anything', 'anything');
|
||||
assert.deepEqual(counters, [1,1]);
|
||||
|
||||
counters = [0,0];
|
||||
filter = or(newFilter(0, true), newFilter(1, false));
|
||||
filterOk(filter, "anything", "anything");
|
||||
filterOk(filter, 'anything', 'anything');
|
||||
assert.deepEqual(counters, [1,0]);
|
||||
|
||||
counters = [0,0];
|
||||
filter = or(newFilter(0, true), newFilter(1, true));
|
||||
filterOk(filter, "anything", "anything");
|
||||
filterOk(filter, 'anything', 'anything');
|
||||
assert.deepEqual(counters, [1,0]);
|
||||
|
||||
counters = [0,0];
|
||||
filter = or(newFilter(0, false), newFilter(1, true));
|
||||
filterOk(filter, "anything", "anything");
|
||||
filterOk(filter, 'anything', 'anything');
|
||||
assert.deepEqual(counters, [1,1]);
|
||||
});
|
||||
|
||||
test("PrefixFilter - case sensitive", function () {
|
||||
filterNotOk(matchesStrictPrefix, "", "");
|
||||
filterOk(matchesStrictPrefix, "", "anything", []);
|
||||
filterOk(matchesStrictPrefix, "alpha", "alpha", [{ start: 0, end: 5 }]);
|
||||
filterOk(matchesStrictPrefix, "alpha", "alphasomething", [{ start: 0, end: 5 }]);
|
||||
filterNotOk(matchesStrictPrefix, "alpha", "alp");
|
||||
filterOk(matchesStrictPrefix, "a", "alpha", [{ start: 0, end: 1 }]);
|
||||
filterNotOk(matchesStrictPrefix, "x", "alpha");
|
||||
filterNotOk(matchesStrictPrefix, "A", "alpha");
|
||||
filterNotOk(matchesStrictPrefix, "AlPh", "alPHA");
|
||||
test('PrefixFilter - case sensitive', function () {
|
||||
filterNotOk(matchesStrictPrefix, '', '');
|
||||
filterOk(matchesStrictPrefix, '', 'anything', []);
|
||||
filterOk(matchesStrictPrefix, 'alpha', 'alpha', [{ start: 0, end: 5 }]);
|
||||
filterOk(matchesStrictPrefix, 'alpha', 'alphasomething', [{ start: 0, end: 5 }]);
|
||||
filterNotOk(matchesStrictPrefix, 'alpha', 'alp');
|
||||
filterOk(matchesStrictPrefix, 'a', 'alpha', [{ start: 0, end: 1 }]);
|
||||
filterNotOk(matchesStrictPrefix, 'x', 'alpha');
|
||||
filterNotOk(matchesStrictPrefix, 'A', 'alpha');
|
||||
filterNotOk(matchesStrictPrefix, 'AlPh', 'alPHA');
|
||||
});
|
||||
|
||||
test("PrefixFilter - ignore case", function () {
|
||||
filterOk(matchesPrefix, "alpha", "alpha", [{ start: 0, end: 5 }]);
|
||||
filterOk(matchesPrefix, "alpha", "alphasomething", [{ start: 0, end: 5 }]);
|
||||
filterNotOk(matchesPrefix, "alpha", "alp");
|
||||
filterOk(matchesPrefix, "a", "alpha", [{ start: 0, end: 1 }]);
|
||||
filterNotOk(matchesPrefix, "x", "alpha");
|
||||
filterOk(matchesPrefix, "A", "alpha", [{ start: 0, end: 1 }]);
|
||||
filterOk(matchesPrefix, "AlPh", "alPHA", [{ start: 0, end: 4 }]);
|
||||
test('PrefixFilter - ignore case', function () {
|
||||
filterOk(matchesPrefix, 'alpha', 'alpha', [{ start: 0, end: 5 }]);
|
||||
filterOk(matchesPrefix, 'alpha', 'alphasomething', [{ start: 0, end: 5 }]);
|
||||
filterNotOk(matchesPrefix, 'alpha', 'alp');
|
||||
filterOk(matchesPrefix, 'a', 'alpha', [{ start: 0, end: 1 }]);
|
||||
filterNotOk(matchesPrefix, 'x', 'alpha');
|
||||
filterOk(matchesPrefix, 'A', 'alpha', [{ start: 0, end: 1 }]);
|
||||
filterOk(matchesPrefix, 'AlPh', 'alPHA', [{ start: 0, end: 4 }]);
|
||||
});
|
||||
|
||||
test("CamelCaseFilter", function () {
|
||||
filterNotOk(matchesCamelCase, "", "");
|
||||
filterOk(matchesCamelCase, "", "anything", []);
|
||||
filterOk(matchesCamelCase, "alpha", "alpha", [{ start: 0, end: 5 }]);
|
||||
filterOk(matchesCamelCase, "AlPhA", "alpha", [{ start: 0, end: 5 }]);
|
||||
filterOk(matchesCamelCase, "alpha", "alphasomething", [{ start: 0, end: 5 }]);
|
||||
filterNotOk(matchesCamelCase, "alpha", "alp");
|
||||
test('CamelCaseFilter', function () {
|
||||
filterNotOk(matchesCamelCase, '', '');
|
||||
filterOk(matchesCamelCase, '', 'anything', []);
|
||||
filterOk(matchesCamelCase, 'alpha', 'alpha', [{ start: 0, end: 5 }]);
|
||||
filterOk(matchesCamelCase, 'AlPhA', 'alpha', [{ start: 0, end: 5 }]);
|
||||
filterOk(matchesCamelCase, 'alpha', 'alphasomething', [{ start: 0, end: 5 }]);
|
||||
filterNotOk(matchesCamelCase, 'alpha', 'alp');
|
||||
|
||||
filterOk(matchesCamelCase, "c", "CamelCaseRocks", [
|
||||
filterOk(matchesCamelCase, 'c', 'CamelCaseRocks', [
|
||||
{ start: 0, end: 1 }
|
||||
]);
|
||||
filterOk(matchesCamelCase, "cc", "CamelCaseRocks", [
|
||||
filterOk(matchesCamelCase, 'cc', 'CamelCaseRocks', [
|
||||
{ start: 0, end: 1 },
|
||||
{ start: 5, end: 6 }
|
||||
]);
|
||||
filterOk(matchesCamelCase, "ccr", "CamelCaseRocks", [
|
||||
filterOk(matchesCamelCase, 'ccr', 'CamelCaseRocks', [
|
||||
{ start: 0, end: 1 },
|
||||
{ start: 5, end: 6 },
|
||||
{ start: 9, end: 10 }
|
||||
]);
|
||||
filterOk(matchesCamelCase, "cacr", "CamelCaseRocks", [
|
||||
filterOk(matchesCamelCase, 'cacr', 'CamelCaseRocks', [
|
||||
{ start: 0, end: 2 },
|
||||
{ start: 5, end: 6 },
|
||||
{ start: 9, end: 10 }
|
||||
]);
|
||||
filterOk(matchesCamelCase, "cacar", "CamelCaseRocks", [
|
||||
filterOk(matchesCamelCase, 'cacar', 'CamelCaseRocks', [
|
||||
{ start: 0, end: 2 },
|
||||
{ start: 5, end: 7 },
|
||||
{ start: 9, end: 10 }
|
||||
]);
|
||||
filterOk(matchesCamelCase, "ccarocks", "CamelCaseRocks", [
|
||||
filterOk(matchesCamelCase, 'ccarocks', 'CamelCaseRocks', [
|
||||
{ start: 0, end: 1 },
|
||||
{ start: 5, end: 7 },
|
||||
{ start: 9, end: 14 }
|
||||
]);
|
||||
filterOk(matchesCamelCase, "cr", "CamelCaseRocks", [
|
||||
filterOk(matchesCamelCase, 'cr', 'CamelCaseRocks', [
|
||||
{ start: 0, end: 1 },
|
||||
{ start: 9, end: 10 }
|
||||
]);
|
||||
filterOk(matchesCamelCase, "fba", "FooBarAbe", [
|
||||
filterOk(matchesCamelCase, 'fba', 'FooBarAbe', [
|
||||
{ start: 0, end: 1 },
|
||||
{ start: 3, end: 5 }
|
||||
]);
|
||||
filterOk(matchesCamelCase, "fbar", "FooBarAbe", [
|
||||
filterOk(matchesCamelCase, 'fbar', 'FooBarAbe', [
|
||||
{ start: 0, end: 1 },
|
||||
{ start: 3, end: 6 }
|
||||
]);
|
||||
filterOk(matchesCamelCase, "fbara", "FooBarAbe", [
|
||||
filterOk(matchesCamelCase, 'fbara', 'FooBarAbe', [
|
||||
{ start: 0, end: 1 },
|
||||
{ start: 3, end: 7 }
|
||||
]);
|
||||
filterOk(matchesCamelCase, "fbaa", "FooBarAbe", [
|
||||
filterOk(matchesCamelCase, 'fbaa', 'FooBarAbe', [
|
||||
{ start: 0, end: 1 },
|
||||
{ start: 3, end: 5 },
|
||||
{ start: 6, end: 7 }
|
||||
]);
|
||||
filterOk(matchesCamelCase, "fbaab", "FooBarAbe", [
|
||||
filterOk(matchesCamelCase, 'fbaab', 'FooBarAbe', [
|
||||
{ start: 0, end: 1 },
|
||||
{ start: 3, end: 5 },
|
||||
{ start: 6, end: 8 }
|
||||
]);
|
||||
filterOk(matchesCamelCase, "c2d", "canvasCreation2D", [
|
||||
filterOk(matchesCamelCase, 'c2d', 'canvasCreation2D', [
|
||||
{ start: 0, end: 1 },
|
||||
{ start: 14, end: 16 }
|
||||
]);
|
||||
filterOk(matchesCamelCase, "cce", "_canvasCreationEvent", [
|
||||
filterOk(matchesCamelCase, 'cce', '_canvasCreationEvent', [
|
||||
{ start: 1, end: 2 },
|
||||
{ start: 7, end: 8 },
|
||||
{ start: 15, end: 16 }
|
||||
]);
|
||||
});
|
||||
|
||||
test("CamelCaseFilter - #19256", function () {
|
||||
test('CamelCaseFilter - #19256', function () {
|
||||
assert(matchesCamelCase('Debug Console', 'Open: Debug Console'));
|
||||
assert(matchesCamelCase('Debug console', 'Open: Debug Console'));
|
||||
assert(matchesCamelCase('debug console', 'Open: Debug Console'));
|
||||
});
|
||||
|
||||
test("matchesContiguousSubString", function () {
|
||||
filterOk(matchesContiguousSubString, "cela", "cancelAnimationFrame()", [
|
||||
test('matchesContiguousSubString', function () {
|
||||
filterOk(matchesContiguousSubString, 'cela', 'cancelAnimationFrame()', [
|
||||
{ start: 3, end: 7 }
|
||||
]);
|
||||
});
|
||||
|
||||
test("matchesSubString", function () {
|
||||
filterOk(matchesSubString, "cmm", "cancelAnimationFrame()", [
|
||||
test('matchesSubString', function () {
|
||||
filterOk(matchesSubString, 'cmm', 'cancelAnimationFrame()', [
|
||||
{ start: 0, end: 1 },
|
||||
{ start: 9, end: 10 },
|
||||
{ start: 18, end: 19 }
|
||||
]);
|
||||
});
|
||||
|
||||
test('WordFilter', function () {
|
||||
filterOk(matchesWords, 'alpha', 'alpha', [{ start: 0, end: 5 }]);
|
||||
filterOk(matchesWords, 'alpha', 'alphasomething', [{ start: 0, end: 5 }]);
|
||||
filterNotOk(matchesWords, 'alpha', 'alp');
|
||||
filterOk(matchesWords, 'a', 'alpha', [{ start: 0, end: 1 }]);
|
||||
filterNotOk(matchesWords, 'x', 'alpha');
|
||||
filterOk(matchesWords, 'A', 'alpha', [{ start: 0, end: 1 }]);
|
||||
filterOk(matchesWords, 'AlPh', 'alPHA', [{ start: 0, end: 4 }]);
|
||||
assert(matchesWords('Debug Console', 'Open: Debug Console'));
|
||||
|
||||
filterOk(matchesWords, 'gp', 'Git: Pull', [{ start: 0, end: 1 }, { start: 5, end: 6}]);
|
||||
filterOk(matchesWords, 'g p', 'Git: Pull', [{ start: 0, end: 1 }, { start: 4, end: 6}]);
|
||||
filterOk(matchesWords, 'gipu', 'Git: Pull', [{ start: 0, end: 2 }, { start: 5, end: 7}]);
|
||||
|
||||
filterOk(matchesWords, 'gp', 'Category: Git: Pull', [{ start: 10, end: 11 }, { start: 15, end: 16}]);
|
||||
filterOk(matchesWords, 'g p', 'Category: Git: Pull', [{ start: 10, end: 11 }, { start: 14, end: 16}]);
|
||||
filterOk(matchesWords, 'gipu', 'Category: Git: Pull', [{ start: 10, end: 12 }, { start: 15, end: 17}]);
|
||||
|
||||
filterNotOk(matchesWords, 'it', 'Git: Pull');
|
||||
filterNotOk(matchesWords, 'll', 'Git: Pull');
|
||||
|
||||
filterOk(matchesWords, 'git: プル', 'git: プル', [{ start: 0, end: 7 }]);
|
||||
filterOk(matchesWords, 'git プル', 'git: プル', [{ start: 0, end: 3 }, { start: 4, end: 7}]);
|
||||
|
||||
filterOk(matchesWords, 'öäk', 'Öhm: Älles Klar', [{ start: 0, end: 1 }, { start: 5, end: 6 }, { start: 11, end: 12 }]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
'use strict';
|
||||
|
||||
import * as flags from 'vs/base/common/flags';
|
||||
import {IDisposable, disposeAll} from 'vs/base/common/lifecycle';
|
||||
import {IDisposable, dispose} from 'vs/base/common/lifecycle';
|
||||
import {IWorker, IWorkerCallback, IWorkerFactory} from 'vs/base/common/worker/workerClient';
|
||||
import * as dom from 'vs/base/browser/dom';
|
||||
|
||||
@@ -87,7 +87,7 @@ class FrameWorker implements IWorker {
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
this._listeners = disposeAll(this._listeners);
|
||||
this._listeners = dispose(this._listeners);
|
||||
window.removeEventListener('message', this.onMessage);
|
||||
window.frames[this.iframeId()].close();
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
'use strict';
|
||||
|
||||
import Event, {Emitter} from 'vs/base/common/event';
|
||||
import {Disposable, IDisposable, disposeAll} from 'vs/base/common/lifecycle';
|
||||
import {Disposable, IDisposable, dispose} from 'vs/base/common/lifecycle';
|
||||
import * as browser from 'vs/base/browser/browser';
|
||||
import * as dom from 'vs/base/browser/dom';
|
||||
import {IKeyboardEvent} from 'vs/base/browser/keyboardEvent';
|
||||
@@ -275,7 +275,7 @@ export class KeyboardHandler extends ViewEventHandler implements IDisposable {
|
||||
this.context.removeEventHandler(this);
|
||||
this.textAreaHandler.dispose();
|
||||
this.textArea.dispose();
|
||||
this._toDispose = disposeAll(this._toDispose);
|
||||
this._toDispose = dispose(this._toDispose);
|
||||
}
|
||||
|
||||
private _getStrategy(): TextAreaStrategy {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import {IDisposable, disposeAll, Disposable} from 'vs/base/common/lifecycle';
|
||||
import {IDisposable, dispose, Disposable} from 'vs/base/common/lifecycle';
|
||||
import * as platform from 'vs/base/common/platform';
|
||||
import * as browser from 'vs/base/browser/browser';
|
||||
import * as dom from 'vs/base/browser/dom';
|
||||
@@ -144,8 +144,8 @@ export class MouseHandler extends ViewEventHandler implements IDisposable {
|
||||
|
||||
public dispose(): void {
|
||||
this.context.removeEventHandler(this);
|
||||
this.listenersToRemove = disposeAll(this.listenersToRemove);
|
||||
this.toDispose = disposeAll(this.toDispose);
|
||||
this.listenersToRemove = dispose(this.listenersToRemove);
|
||||
this.toDispose = dispose(this.toDispose);
|
||||
this._mouseDownOperation.dispose();
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
'use strict';
|
||||
|
||||
import {IJSONSchema} from 'vs/base/common/jsonSchema';
|
||||
import {IDisposable, disposeAll} from 'vs/base/common/lifecycle';
|
||||
import {IDisposable, dispose} from 'vs/base/common/lifecycle';
|
||||
import URI from 'vs/base/common/uri';
|
||||
import {TPromise} from 'vs/base/common/winjs.base';
|
||||
import {IContextViewService} from 'vs/platform/contextview/browser/contextView';
|
||||
@@ -101,7 +101,7 @@ class StandaloneEditor extends CodeEditorWidget {
|
||||
|
||||
public dispose(): void {
|
||||
super.dispose();
|
||||
this._toDispose2 = disposeAll(this._toDispose2);
|
||||
this._toDispose2 = dispose(this._toDispose2);
|
||||
}
|
||||
|
||||
public destroy(): void {
|
||||
@@ -210,7 +210,7 @@ class StandaloneDiffEditor extends DiffEditorWidget {
|
||||
|
||||
public dispose(): void {
|
||||
super.dispose();
|
||||
this._toDispose2 = disposeAll(this._toDispose2);
|
||||
this._toDispose2 = dispose(this._toDispose2);
|
||||
}
|
||||
|
||||
public destroy(): void {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
import {onUnexpectedError} from 'vs/base/common/errors';
|
||||
import {EventEmitter, IEmitterEvent, IEventEmitter, ListenerUnbind} from 'vs/base/common/eventEmitter';
|
||||
import {IDisposable, disposeAll} from 'vs/base/common/lifecycle';
|
||||
import {IDisposable, dispose} from 'vs/base/common/lifecycle';
|
||||
import * as timer from 'vs/base/common/timer';
|
||||
import * as browser from 'vs/base/browser/browser';
|
||||
import * as dom from 'vs/base/browser/dom';
|
||||
@@ -502,7 +502,7 @@ export class View extends ViewEventHandler implements editorBrowser.IView, IDisp
|
||||
});
|
||||
this.listenersToRemove = [];
|
||||
|
||||
this.listenersToDispose = disposeAll(this.listenersToDispose);
|
||||
this.listenersToDispose = dispose(this.listenersToDispose);
|
||||
|
||||
this.keyboardHandler.dispose();
|
||||
this.pointerHandler.dispose();
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import {IDisposable, disposeAll} from 'vs/base/common/lifecycle';
|
||||
import {IDisposable, dispose} from 'vs/base/common/lifecycle';
|
||||
import * as dom from 'vs/base/browser/dom';
|
||||
import {IOverviewRulerLayoutInfo, IScrollableElement, IScrollableElementCreationOptions} from 'vs/base/browser/ui/scrollbar/scrollableElement';
|
||||
import {ScrollableElement} from 'vs/base/browser/ui/scrollbar/scrollableElementImpl';
|
||||
@@ -103,7 +103,7 @@ export class ScrollManager implements IDisposable {
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
this.toDispose = disposeAll(this.toDispose);
|
||||
this.toDispose = dispose(this.toDispose);
|
||||
}
|
||||
|
||||
public renderScrollbar(): void {
|
||||
|
||||
@@ -9,7 +9,7 @@ import 'vs/css!./media/diffEditor';
|
||||
import {IAction} from 'vs/base/common/actions';
|
||||
import {RunOnceScheduler} from 'vs/base/common/async';
|
||||
import {EventEmitter, IEmitterEvent} from 'vs/base/common/eventEmitter';
|
||||
import {IDisposable, disposeAll} from 'vs/base/common/lifecycle';
|
||||
import {IDisposable, dispose} from 'vs/base/common/lifecycle';
|
||||
import * as objects from 'vs/base/common/objects';
|
||||
import * as dom from 'vs/base/browser/dom';
|
||||
import {StyleMutator} from 'vs/base/browser/styleMutator';
|
||||
@@ -339,7 +339,7 @@ export class DiffEditorWidget extends EventEmitter implements editorBrowser.IDif
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
this._toDispose = disposeAll(this._toDispose);
|
||||
this._toDispose = dispose(this._toDispose);
|
||||
|
||||
window.clearInterval(this._measureDomElementToken);
|
||||
|
||||
@@ -1594,7 +1594,7 @@ class DiffEdtorWidgetInline extends DiffEditorWidgetStyle implements IDiffEditor
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
this.toDispose = disposeAll(this.toDispose);
|
||||
this.toDispose = dispose(this.toDispose);
|
||||
}
|
||||
|
||||
public setEnableSplitViewResizing(enableSplitViewResizing:boolean): void {
|
||||
|
||||
@@ -8,7 +8,7 @@ import * as nls from 'vs/nls';
|
||||
import {IAction, IActionProvider, isAction} from 'vs/base/common/actions';
|
||||
import {onUnexpectedError} from 'vs/base/common/errors';
|
||||
import {EventEmitter, IEventEmitter, ListenerUnbind} from 'vs/base/common/eventEmitter';
|
||||
import {IDisposable, disposeAll} from 'vs/base/common/lifecycle';
|
||||
import {IDisposable, dispose} from 'vs/base/common/lifecycle';
|
||||
import * as objects from 'vs/base/common/objects';
|
||||
import * as timer from 'vs/base/common/timer';
|
||||
import {TPromise} from 'vs/base/common/winjs.base';
|
||||
@@ -145,7 +145,7 @@ export abstract class CommonCodeEditor extends EventEmitter implements IActionPr
|
||||
|
||||
public dispose(): void {
|
||||
this._codeEditorService.removeCodeEditor(this);
|
||||
this._lifetimeDispose = disposeAll(this._lifetimeDispose);
|
||||
this._lifetimeDispose = dispose(this._lifetimeDispose);
|
||||
|
||||
let keys = Object.keys(this.contributions);
|
||||
for (let i = 0, len = keys.length; i < len; i++) {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
import * as nls from 'vs/nls';
|
||||
import {onUnexpectedError} from 'vs/base/common/errors';
|
||||
import {EventEmitter} from 'vs/base/common/eventEmitter';
|
||||
import {IDisposable, disposeAll} from 'vs/base/common/lifecycle';
|
||||
import {IDisposable, dispose} from 'vs/base/common/lifecycle';
|
||||
import {ReplaceCommand} from 'vs/editor/common/commands/replaceCommand';
|
||||
import {CursorCollection, ICursorCollectionState} from 'vs/editor/common/controller/cursorCollection';
|
||||
import {DispatcherEvent} from 'vs/editor/common/controller/handlerDispatcher';
|
||||
@@ -145,7 +145,7 @@ export class Cursor extends EventEmitter {
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
this.modelUnbinds = disposeAll(this.modelUnbinds);
|
||||
this.modelUnbinds = dispose(this.modelUnbinds);
|
||||
this.model = null;
|
||||
this.cursors.dispose();
|
||||
this.cursors = null;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import {IDisposable, disposeAll} from 'vs/base/common/lifecycle';
|
||||
import {IDisposable, dispose} from 'vs/base/common/lifecycle';
|
||||
import {EventType, ICommonCodeEditor} from 'vs/editor/common/editorCommon';
|
||||
|
||||
export enum Behaviour {
|
||||
@@ -144,7 +144,7 @@ class InternalEnablementState extends CachingEnablementState {
|
||||
|
||||
public dispose():void {
|
||||
super.dispose();
|
||||
disposeAll(this._callOnDispose);
|
||||
dispose(this._callOnDispose);
|
||||
}
|
||||
|
||||
public _computeValue():boolean {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import {disposeAll} from 'vs/base/common/lifecycle';
|
||||
import {dispose} from 'vs/base/common/lifecycle';
|
||||
import URI from 'vs/base/common/uri';
|
||||
import {TPromise} from 'vs/base/common/winjs.base';
|
||||
import * as editorCommon from 'vs/editor/common/editorCommon';
|
||||
@@ -284,7 +284,7 @@ export class MirrorModel extends AbstractMirrorModel implements editorCommon.IMi
|
||||
super.dispose();
|
||||
var embeddedModels = Object.keys(this._embeddedModels).map((modeId) => this._embeddedModels[modeId]);
|
||||
embeddedModels.forEach((embeddedModel) => this._resourceService.remove(embeddedModel.getAssociatedResource()));
|
||||
disposeAll(embeddedModels);
|
||||
dispose(embeddedModels);
|
||||
this._embeddedModels = {};
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
import * as nls from 'vs/nls';
|
||||
import {RunOnceScheduler} from 'vs/base/common/async';
|
||||
import {onUnexpectedError} from 'vs/base/common/errors';
|
||||
import {IDisposable, disposeAll} from 'vs/base/common/lifecycle';
|
||||
import {IDisposable, dispose} from 'vs/base/common/lifecycle';
|
||||
import {StopWatch} from 'vs/base/common/stopwatch';
|
||||
import * as timer from 'vs/base/common/timer';
|
||||
import {TPromise} from 'vs/base/common/winjs.base';
|
||||
@@ -263,7 +263,7 @@ export class TextModelWithTokens extends TextModel implements editorCommon.IToke
|
||||
this._mode = null;
|
||||
this._lastState = null;
|
||||
this._tokensInflatorMap = null;
|
||||
this._retokenizers = disposeAll(this._retokenizers);
|
||||
this._retokenizers = dispose(this._retokenizers);
|
||||
this._scheduleRetokenizeNow.dispose();
|
||||
|
||||
super.dispose();
|
||||
@@ -378,7 +378,7 @@ export class TextModelWithTokens extends TextModel implements editorCommon.IToke
|
||||
}
|
||||
|
||||
_resetTokenizationState(): void {
|
||||
this._retokenizers = disposeAll(this._retokenizers);
|
||||
this._retokenizers = dispose(this._retokenizers);
|
||||
this._scheduleRetokenizeNow.cancel();
|
||||
this._clearTimers();
|
||||
for (var i = 0; i < this._lines.length; i++) {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
'use strict';
|
||||
|
||||
import {IntervalTimer} from 'vs/base/common/async';
|
||||
import {Disposable, IDisposable, disposeAll} from 'vs/base/common/lifecycle';
|
||||
import {Disposable, IDisposable, dispose} from 'vs/base/common/lifecycle';
|
||||
import URI from 'vs/base/common/uri';
|
||||
import {TPromise} from 'vs/base/common/winjs.base';
|
||||
import {SimpleWorkerClient} from 'vs/base/common/worker/simpleWorker';
|
||||
@@ -128,7 +128,7 @@ class EditorWorkerClient extends Disposable {
|
||||
|
||||
public dispose(): void {
|
||||
for (let modelUrl in this._syncedModels) {
|
||||
disposeAll(this._syncedModels[modelUrl]);
|
||||
dispose(this._syncedModels[modelUrl]);
|
||||
}
|
||||
this._syncedModels = Object.create(null);
|
||||
this._syncedModelsLastUsedTime = Object.create(null);
|
||||
@@ -259,6 +259,6 @@ class EditorWorkerClient extends Disposable {
|
||||
let toDispose = this._syncedModels[modelUrl];
|
||||
delete this._syncedModels[modelUrl];
|
||||
delete this._syncedModelsLastUsedTime[modelUrl];
|
||||
disposeAll(toDispose);
|
||||
dispose(toDispose);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
import * as nls from 'vs/nls';
|
||||
import {onUnexpectedError} from 'vs/base/common/errors';
|
||||
import Event, {Emitter} from 'vs/base/common/event';
|
||||
import {IDisposable, combinedDispose, empty as EmptyDisposable} from 'vs/base/common/lifecycle'; // TODO@Alex
|
||||
import {IDisposable, combinedDisposable, empty as EmptyDisposable} from 'vs/base/common/lifecycle'; // TODO@Alex
|
||||
import * as objects from 'vs/base/common/objects';
|
||||
import * as paths from 'vs/base/common/paths';
|
||||
import {TPromise} from 'vs/base/common/winjs.base';
|
||||
@@ -433,7 +433,7 @@ export class ModeServiceImpl implements IModeService {
|
||||
}
|
||||
|
||||
protected doRegisterMonarchDefinition(modeId:string, lexer: ILexer): IDisposable {
|
||||
return combinedDispose(
|
||||
return combinedDisposable(
|
||||
this.registerTokenizationSupport(modeId, (mode: modes.IMode) => {
|
||||
return createTokenizationSupport(this, mode, lexer);
|
||||
}),
|
||||
@@ -614,7 +614,7 @@ export class MainThreadModeServiceImpl extends ModeServiceImpl {
|
||||
public registerMonarchDefinition(modelService: IModelService, editorWorkerService:IEditorWorkerService, modeId:string, language:ILanguage): IDisposable {
|
||||
this._getModeServiceWorkerHelper().registerMonarchDefinition(modeId, language);
|
||||
var lexer = compile(objects.clone(language));
|
||||
return combinedDispose(
|
||||
return combinedDisposable(
|
||||
super.doRegisterMonarchDefinition(modeId, lexer),
|
||||
|
||||
this.registerModeSupport(modeId, 'suggestSupport', (mode) => {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
'use strict';
|
||||
|
||||
import {EmitterEvent, EventEmitter, IEmitterEvent, IEventEmitter, ListenerUnbind} from 'vs/base/common/eventEmitter';
|
||||
import {IDisposable, disposeAll} from 'vs/base/common/lifecycle';
|
||||
import {IDisposable, dispose} from 'vs/base/common/lifecycle';
|
||||
import * as strings from 'vs/base/common/strings';
|
||||
import {Position} from 'vs/editor/common/core/position';
|
||||
import {Range} from 'vs/editor/common/core/range';
|
||||
@@ -98,7 +98,7 @@ export class ViewModel extends EventEmitter implements editorCommon.IViewModel {
|
||||
this.listenersToRemove.forEach((element) => {
|
||||
element();
|
||||
});
|
||||
this._toDispose = disposeAll(this._toDispose);
|
||||
this._toDispose = dispose(this._toDispose);
|
||||
this.listenersToRemove = [];
|
||||
this.decorations.dispose();
|
||||
this.decorations = null;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
import {RunOnceScheduler} from 'vs/base/common/async';
|
||||
import {IEmitterEvent} from 'vs/base/common/eventEmitter';
|
||||
import {IDisposable, disposeAll} from 'vs/base/common/lifecycle';
|
||||
import {IDisposable, dispose} from 'vs/base/common/lifecycle';
|
||||
import URI from 'vs/base/common/uri';
|
||||
import {IMirrorModel} from 'vs/editor/common/editorCommon';
|
||||
import {IResourceAddedEvent, IResourceRemovedEvent, IResourceService, ResourceEvents} from 'vs/editor/common/services/resourceService';
|
||||
@@ -37,7 +37,7 @@ class ValidationModel implements IDisposable {
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
this._toDispose = disposeAll(this._toDispose);
|
||||
this._toDispose = dispose(this._toDispose);
|
||||
this._changeCallback = null;
|
||||
}
|
||||
|
||||
@@ -107,9 +107,9 @@ export class ValidationHelper implements IDisposable {
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
this._toDispose = disposeAll(this._toDispose);
|
||||
this._toDispose = dispose(this._toDispose);
|
||||
|
||||
disposeAll(Object.keys(this._models).map((modelUrl) => this._models[modelUrl]));
|
||||
dispose(Object.keys(this._models).map((modelUrl) => this._models[modelUrl]));
|
||||
this._models = null;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
import 'vs/css!./codelens';
|
||||
import {RunOnceScheduler} from 'vs/base/common/async';
|
||||
import {onUnexpectedError} from 'vs/base/common/errors';
|
||||
import {IDisposable, disposeAll} from 'vs/base/common/lifecycle';
|
||||
import {IDisposable, dispose} from 'vs/base/common/lifecycle';
|
||||
import Severity from 'vs/base/common/severity';
|
||||
import {format} from 'vs/base/common/strings';
|
||||
import {TPromise} from 'vs/base/common/winjs.base';
|
||||
@@ -386,7 +386,7 @@ export class CodeLensContribution implements editorCommon.IEditorContribution {
|
||||
|
||||
public dispose(): void {
|
||||
this.localDispose();
|
||||
this._globalToDispose = disposeAll(this._globalToDispose);
|
||||
this._globalToDispose = dispose(this._globalToDispose);
|
||||
}
|
||||
|
||||
private localDispose(): void {
|
||||
@@ -399,7 +399,7 @@ export class CodeLensContribution implements editorCommon.IEditorContribution {
|
||||
this._currentFindOccPromise.cancel();
|
||||
this._currentFindOccPromise = null;
|
||||
}
|
||||
this._localToDispose = disposeAll(this._localToDispose);
|
||||
this._localToDispose = dispose(this._localToDispose);
|
||||
}
|
||||
|
||||
public getId(): string {
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
import 'vs/css!./color';
|
||||
import {RunOnceScheduler} from 'vs/base/common/async';
|
||||
import {onUnexpectedError} from 'vs/base/common/errors';
|
||||
import {IDisposable, cAll, disposeAll} from 'vs/base/common/lifecycle';
|
||||
import {IDisposable, cAll, dispose} from 'vs/base/common/lifecycle';
|
||||
import * as strings from 'vs/base/common/strings';
|
||||
import {TPromise} from 'vs/base/common/winjs.base';
|
||||
import * as dom from 'vs/base/browser/dom';
|
||||
@@ -118,7 +118,7 @@ export class ColorContribution implements editorCommon.IEditorContribution {
|
||||
}
|
||||
this._style.parentNode.removeChild(this._style);
|
||||
this._style = null;
|
||||
this._callOnDispose = disposeAll(this._callOnDispose);
|
||||
this._callOnDispose = dispose(this._callOnDispose);
|
||||
}
|
||||
|
||||
public getId():string {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
import * as nls from 'vs/nls';
|
||||
import {IAction} from 'vs/base/common/actions';
|
||||
import {KeyCode, KeyMod, Keybinding} from 'vs/base/common/keyCodes';
|
||||
import {IDisposable, disposeAll} from 'vs/base/common/lifecycle';
|
||||
import {IDisposable, dispose} from 'vs/base/common/lifecycle';
|
||||
import {SortedList} from 'vs/base/common/sortedList';
|
||||
import {TPromise} from 'vs/base/common/winjs.base';
|
||||
import * as dom from 'vs/base/browser/dom';
|
||||
@@ -248,7 +248,7 @@ class ContextMenuController implements IEditorContribution {
|
||||
this.contextViewService.hideContextView();
|
||||
}
|
||||
|
||||
this._toDispose = disposeAll(this._toDispose);
|
||||
this._toDispose = dispose(this._toDispose);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import * as nls from 'vs/nls';
|
||||
import {RunOnceScheduler} from 'vs/base/common/async';
|
||||
import {IHTMLContentElement} from 'vs/base/common/htmlContent';
|
||||
import {CommonKeybindings, KeyCode, KeyMod, Keybinding} from 'vs/base/common/keyCodes';
|
||||
import {IDisposable, disposeAll} from 'vs/base/common/lifecycle';
|
||||
import {IDisposable, dispose} from 'vs/base/common/lifecycle';
|
||||
import {TPromise} from 'vs/base/common/winjs.base';
|
||||
import * as dom from 'vs/base/browser/dom';
|
||||
import {renderHtml} from 'vs/base/browser/htmlContentRenderer';
|
||||
@@ -89,8 +89,8 @@ export class DefineKeybindingController implements editorCommon.IEditorContribut
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
this._modelToDispose = disposeAll(this._modelToDispose);
|
||||
this._toDispose = disposeAll(this._toDispose);
|
||||
this._modelToDispose = dispose(this._modelToDispose);
|
||||
this._toDispose = dispose(this._toDispose);
|
||||
this._launchWidget.dispose();
|
||||
this._launchWidget = null;
|
||||
this._defineWidget.dispose();
|
||||
@@ -116,7 +116,7 @@ export class DefineKeybindingController implements editorCommon.IEditorContribut
|
||||
}
|
||||
|
||||
private _onModel(): void {
|
||||
this._modelToDispose = disposeAll(this._modelToDispose);
|
||||
this._modelToDispose = dispose(this._modelToDispose);
|
||||
|
||||
let model = this._editor.getModel();
|
||||
if (!model) {
|
||||
@@ -258,7 +258,7 @@ class DefineKeybindingLauncherWidget implements IOverlayWidget {
|
||||
|
||||
public dispose(): void {
|
||||
this._editor.removeOverlayWidget(this);
|
||||
this._toDispose = disposeAll(this._toDispose);
|
||||
this._toDispose = dispose(this._toDispose);
|
||||
}
|
||||
|
||||
public show(): void {
|
||||
@@ -387,7 +387,7 @@ class DefineKeybindingWidget implements IOverlayWidget {
|
||||
|
||||
public dispose(): void {
|
||||
this._editor.removeOverlayWidget(this);
|
||||
this._toDispose = disposeAll(this._toDispose);
|
||||
this._toDispose = dispose(this._toDispose);
|
||||
}
|
||||
|
||||
public getId(): string {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
'use strict';
|
||||
|
||||
import {RunOnceScheduler} from 'vs/base/common/async';
|
||||
import {IDisposable, disposeAll} from 'vs/base/common/lifecycle';
|
||||
import {IDisposable, dispose} from 'vs/base/common/lifecycle';
|
||||
import * as strings from 'vs/base/common/strings';
|
||||
import {ReplaceCommand} from 'vs/editor/common/commands/replaceCommand';
|
||||
import {Position} from 'vs/editor/common/core/position';
|
||||
@@ -80,7 +80,7 @@ export class FindModelBoundToEditorModel {
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
this._toDispose = disposeAll(this._toDispose);
|
||||
this._toDispose = dispose(this._toDispose);
|
||||
}
|
||||
|
||||
private _onStateChanged(e:FindReplaceStateChangedEvent): void {
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
import * as nls from 'vs/nls';
|
||||
import {RunOnceScheduler} from 'vs/base/common/async';
|
||||
import {KeyCode, KeyMod} from 'vs/base/common/keyCodes';
|
||||
import {IDisposable, disposeAll} from 'vs/base/common/lifecycle';
|
||||
import {IDisposable, dispose} from 'vs/base/common/lifecycle';
|
||||
import {TPromise} from 'vs/base/common/winjs.base';
|
||||
import {EditorAction} from 'vs/editor/common/editorAction';
|
||||
import {Behaviour} from 'vs/editor/common/editorActionEnablement';
|
||||
@@ -173,7 +173,7 @@ export class FoldingController implements editorCommon.IEditorContribution {
|
||||
|
||||
public dispose(): void {
|
||||
this.cleanState();
|
||||
this.globalToDispose = disposeAll(this.globalToDispose);
|
||||
this.globalToDispose = dispose(this.globalToDispose);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -214,7 +214,7 @@ export class FoldingController implements editorCommon.IEditorContribution {
|
||||
}
|
||||
|
||||
private cleanState(): void {
|
||||
this.localToDispose = disposeAll(this.localToDispose);
|
||||
this.localToDispose = dispose(this.localToDispose);
|
||||
}
|
||||
|
||||
private applyRegions(regions: IFoldingRange[]) {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
import * as nls from 'vs/nls';
|
||||
import * as arrays from 'vs/base/common/arrays';
|
||||
import {KeyCode, KeyMod} from 'vs/base/common/keyCodes';
|
||||
import {IDisposable, cAll, disposeAll} from 'vs/base/common/lifecycle';
|
||||
import {IDisposable, cAll, dispose} from 'vs/base/common/lifecycle';
|
||||
import {TPromise} from 'vs/base/common/winjs.base';
|
||||
import {EditorAction} from 'vs/editor/common/editorAction';
|
||||
import {Behaviour} from 'vs/editor/common/editorActionEnablement';
|
||||
@@ -137,7 +137,7 @@ class FormatOnType implements editorCommon.IEditorContribution {
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
this.callOnDispose = disposeAll(this.callOnDispose);
|
||||
this.callOnDispose = dispose(this.callOnDispose);
|
||||
while (this.callOnModel.length > 0) {
|
||||
this.callOnModel.pop()();
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import * as nls from 'vs/nls';
|
||||
import {onUnexpectedError} from 'vs/base/common/errors';
|
||||
import {Emitter} from 'vs/base/common/event';
|
||||
import {CommonKeybindings, KeyCode, KeyMod} from 'vs/base/common/keyCodes';
|
||||
import {IDisposable, cAll, disposeAll} from 'vs/base/common/lifecycle';
|
||||
import {IDisposable, cAll, dispose} from 'vs/base/common/lifecycle';
|
||||
import severity from 'vs/base/common/severity';
|
||||
import * as strings from 'vs/base/common/strings';
|
||||
import URI from 'vs/base/common/uri';
|
||||
@@ -296,7 +296,7 @@ class MarkerNavigationWidget extends ZoneWidget {
|
||||
break;
|
||||
}
|
||||
|
||||
this._localCleanup = disposeAll(this._localCleanup);
|
||||
this._localCleanup = dispose(this._localCleanup);
|
||||
|
||||
// update label and show
|
||||
let text = strings.format('({0}/{1}) ', this._model.indexOf(marker) + 1, this._model.length());
|
||||
@@ -379,7 +379,7 @@ class MarkerNavigationWidget extends ZoneWidget {
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
this._callOnDispose = disposeAll(this._callOnDispose);
|
||||
this._callOnDispose = dispose(this._callOnDispose);
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
@@ -448,7 +448,7 @@ class MarkerController implements editorCommon.IEditorContribution {
|
||||
|
||||
private _cleanUp(): void {
|
||||
this._markersNavigationVisible.reset();
|
||||
this._callOnClose = disposeAll(this._callOnClose);
|
||||
this._callOnClose = dispose(this._callOnClose);
|
||||
this._zone = null;
|
||||
this._model = null;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
'use strict';
|
||||
|
||||
import {CommonKeybindings} from 'vs/base/common/keyCodes';
|
||||
import {IDisposable, disposeAll} from 'vs/base/common/lifecycle';
|
||||
import {IDisposable, dispose} from 'vs/base/common/lifecycle';
|
||||
import * as dom from 'vs/base/browser/dom';
|
||||
import {IKeyboardEvent} from 'vs/base/browser/keyboardEvent';
|
||||
import {StyleMutator} from 'vs/base/browser/styleMutator';
|
||||
@@ -112,7 +112,7 @@ export class ContentHoverWidget implements editorBrowser.IContentWidget {
|
||||
|
||||
public dispose(): void {
|
||||
this.hide();
|
||||
this._toDispose = disposeAll(this._toDispose);
|
||||
this._toDispose = dispose(this._toDispose);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
'use strict';
|
||||
|
||||
import 'vs/css!./iPadShowKeyboard';
|
||||
import {IDisposable, disposeAll} from 'vs/base/common/lifecycle';
|
||||
import {IDisposable, dispose} from 'vs/base/common/lifecycle';
|
||||
import * as browser from 'vs/base/browser/browser';
|
||||
import * as dom from 'vs/base/browser/dom';
|
||||
import {EventType, IEditorContribution} from 'vs/editor/common/editorCommon';
|
||||
@@ -51,7 +51,7 @@ export class IPadShowKeyboard implements IEditorContribution {
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
this.toDispose = disposeAll(this.toDispose);
|
||||
this.toDispose = dispose(this.toDispose);
|
||||
if (this.widget) {
|
||||
this.widget.dispose();
|
||||
this.widget = null;
|
||||
@@ -86,7 +86,7 @@ class ShowKeyboardWidget implements IOverlayWidget {
|
||||
|
||||
public dispose(): void {
|
||||
this.editor.removeOverlayWidget(this);
|
||||
this._toDispose = disposeAll(this._toDispose);
|
||||
this._toDispose = dispose(this._toDispose);
|
||||
}
|
||||
|
||||
// ----- IOverlayWidget API
|
||||
|
||||
@@ -87,7 +87,7 @@ export class ChangeIndentationSizeAction extends EditorAction {
|
||||
const autoFocusIndex = Math.min(model.getOptions().tabSize - 1, 7);
|
||||
|
||||
return TPromise.timeout(50 /* quick open is sensitive to being opened so soon after another */).then(() =>
|
||||
this.quickOpenService.pick(picks, { placeHolder: nls.localize('selectTabWidth', "Select Tab Size for Current File"), autoFocus: { autoFocusIndex } }).then(pick => {
|
||||
this.quickOpenService.pick(picks, { placeHolder: nls.localize({key: 'selectTabWidth', comment: ['Tab corresponds to the tab key'] }, "Select Tab Size for Current File"), autoFocus: { autoFocusIndex } }).then(pick => {
|
||||
if (pick) {
|
||||
model.updateOptions({
|
||||
tabSize: parseInt(pick.label, 10),
|
||||
|
||||
@@ -83,7 +83,7 @@ CommonEditorRegistry.registerEditorAction(new EditorActionDescriptor(InsertCurso
|
||||
secondary: [KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.DownArrow]
|
||||
}
|
||||
}));
|
||||
CommonEditorRegistry.registerEditorAction(new EditorActionDescriptor(InsertCursorAtEndOfEachLineSelected, InsertCursorAtEndOfEachLineSelected.ID, nls.localize('mutlicursor.insertAtEndOfEachLineSelected', "Create multiple cursors from selected lines"), {
|
||||
CommonEditorRegistry.registerEditorAction(new EditorActionDescriptor(InsertCursorAtEndOfEachLineSelected, InsertCursorAtEndOfEachLineSelected.ID, nls.localize('mutlicursor.insertAtEndOfEachLineSelected', "Create Multiple Cursors from Selected Lines"), {
|
||||
context: ContextKey.EditorTextFocus,
|
||||
primary: KeyMod.Shift | KeyMod.Alt | KeyCode.KEY_I
|
||||
}));
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
import 'vs/css!./outlineMarker';
|
||||
import {RunOnceScheduler} from 'vs/base/common/async';
|
||||
import {onUnexpectedError} from 'vs/base/common/errors';
|
||||
import {IDisposable, disposeAll} from 'vs/base/common/lifecycle';
|
||||
import {IDisposable, dispose} from 'vs/base/common/lifecycle';
|
||||
import {TPromise} from 'vs/base/common/winjs.base';
|
||||
import {Range} from 'vs/editor/common/core/range';
|
||||
import * as editorCommon from 'vs/editor/common/editorCommon';
|
||||
@@ -146,14 +146,14 @@ export class OutlineMarkerContribution implements editorCommon.IEditorContributi
|
||||
|
||||
public dispose(): void {
|
||||
this.localDispose();
|
||||
this._globalToDispose = disposeAll(this._globalToDispose);
|
||||
this._globalToDispose = dispose(this._globalToDispose);
|
||||
}
|
||||
|
||||
private localDispose(): void {
|
||||
if (this._currentOutlinePromise) {
|
||||
this._currentOutlinePromise.cancel();
|
||||
}
|
||||
this._localToDispose = disposeAll(this._localToDispose);
|
||||
this._localToDispose = dispose(this._localToDispose);
|
||||
}
|
||||
|
||||
public getId():string {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
import {ThrottledDelayer} from 'vs/base/common/async';
|
||||
import {onUnexpectedError} from 'vs/base/common/errors';
|
||||
import {EventEmitter, IEventEmitter, ListenerCallback} from 'vs/base/common/eventEmitter';
|
||||
import {IDisposable, disposeAll} from 'vs/base/common/lifecycle';
|
||||
import {IDisposable, dispose} from 'vs/base/common/lifecycle';
|
||||
import {TPromise} from 'vs/base/common/winjs.base';
|
||||
import {EventType, ICommonCodeEditor, ICursorSelectionChangedEvent, IModeSupportChangedEvent} from 'vs/editor/common/editorCommon';
|
||||
import {IParameterHints} from 'vs/editor/common/modes';
|
||||
@@ -96,7 +96,7 @@ export class ParameterHintsModel extends EventEmitter {
|
||||
}
|
||||
|
||||
private onModelChanged(): void {
|
||||
this.triggerCharactersListeners = disposeAll(this.triggerCharactersListeners);
|
||||
this.triggerCharactersListeners = dispose(this.triggerCharactersListeners);
|
||||
|
||||
var model = this.editor.getModel();
|
||||
if (!model) {
|
||||
@@ -145,8 +145,8 @@ export class ParameterHintsModel extends EventEmitter {
|
||||
public dispose(): void {
|
||||
this.cancel(true);
|
||||
|
||||
this.triggerCharactersListeners = disposeAll(this.triggerCharactersListeners);
|
||||
this.toDispose = disposeAll(this.toDispose);
|
||||
this.triggerCharactersListeners = dispose(this.triggerCharactersListeners);
|
||||
this.toDispose = dispose(this.toDispose);
|
||||
|
||||
this.emit('destroy', null);
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
import 'vs/css!./parameterHints';
|
||||
import nls = require('vs/nls');
|
||||
import {ListenerUnbind} from 'vs/base/common/eventEmitter';
|
||||
import {IDisposable, disposeAll} from 'vs/base/common/lifecycle';
|
||||
import {IDisposable, dispose} from 'vs/base/common/lifecycle';
|
||||
import {TPromise} from 'vs/base/common/winjs.base';
|
||||
import {Builder, $} from 'vs/base/browser/builder';
|
||||
import aria = require('vs/base/browser/ui/aria/aria');
|
||||
@@ -307,7 +307,7 @@ export class ParameterHintsWidget implements IContentWidget {
|
||||
}
|
||||
|
||||
public destroy(): void {
|
||||
this.toDispose = disposeAll(this.toDispose);
|
||||
this.toDispose = dispose(this.toDispose);
|
||||
this.releaseModel();
|
||||
|
||||
if (this.$overloads) {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import {IDisposable, disposeAll} from 'vs/base/common/lifecycle';
|
||||
import {IDisposable, dispose} from 'vs/base/common/lifecycle';
|
||||
import * as dom from 'vs/base/browser/dom';
|
||||
import {IPosition} from 'vs/editor/common/editorCommon';
|
||||
import {Position} from 'vs/editor/common/core/position';
|
||||
@@ -31,7 +31,7 @@ export class LightBulpWidget implements IContentWidget, IDisposable {
|
||||
|
||||
public dispose(): void {
|
||||
this.editor.removeContentWidget(this);
|
||||
this.toDispose = disposeAll(this.toDispose);
|
||||
this.toDispose = dispose(this.toDispose);
|
||||
}
|
||||
|
||||
public getId(): string {
|
||||
|
||||
@@ -8,7 +8,7 @@ import * as arrays from 'vs/base/common/arrays';
|
||||
import {RunOnceScheduler} from 'vs/base/common/async';
|
||||
import {onUnexpectedError} from 'vs/base/common/errors';
|
||||
import {EventEmitter} from 'vs/base/common/eventEmitter';
|
||||
import {IDisposable, disposeAll} from 'vs/base/common/lifecycle';
|
||||
import {IDisposable, dispose} from 'vs/base/common/lifecycle';
|
||||
import * as timer from 'vs/base/common/timer';
|
||||
import URI from 'vs/base/common/uri';
|
||||
import {TPromise} from 'vs/base/common/winjs.base';
|
||||
@@ -350,7 +350,7 @@ export class QuickFixModel extends EventEmitter {
|
||||
}
|
||||
|
||||
private localDispose(): void {
|
||||
this.toLocalDispose = disposeAll(this.toLocalDispose);
|
||||
this.toLocalDispose = dispose(this.toLocalDispose);
|
||||
if (this.quickFixRequestPromise) {
|
||||
this.quickFixRequestPromise.cancel();
|
||||
this.quickFixRequestPromise = null;
|
||||
@@ -359,7 +359,7 @@ export class QuickFixModel extends EventEmitter {
|
||||
|
||||
public dispose(): void {
|
||||
this.localDispose();
|
||||
this.toDispose = disposeAll(this.toDispose);
|
||||
this.toDispose = dispose(this.toDispose);
|
||||
this.emit('destroy', null);
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import * as nls from 'vs/nls';
|
||||
import * as collections from 'vs/base/common/collections';
|
||||
import {onUnexpectedError} from 'vs/base/common/errors';
|
||||
import {getPathLabel} from 'vs/base/common/labels';
|
||||
import {IDisposable, cAll, disposeAll} from 'vs/base/common/lifecycle';
|
||||
import {IDisposable, cAll, dispose} from 'vs/base/common/lifecycle';
|
||||
import {Schemas} from 'vs/base/common/network';
|
||||
import * as strings from 'vs/base/common/strings';
|
||||
import URI from 'vs/base/common/uri';
|
||||
@@ -494,7 +494,7 @@ export class ReferenceWidget extends PeekViewWidget {
|
||||
|
||||
public setModel(newModel: ReferencesModel): void {
|
||||
// clean up
|
||||
this.callOnModel = disposeAll(this.callOnModel);
|
||||
this.callOnModel = dispose(this.callOnModel);
|
||||
this.model = newModel;
|
||||
if (this.model) {
|
||||
this._onNewModel();
|
||||
@@ -617,7 +617,7 @@ export class ReferenceWidget extends PeekViewWidget {
|
||||
|
||||
public dispose(): void {
|
||||
this.setModel(null);
|
||||
disposeAll(<IDisposable[]>[this.preview, this.previewNotAvailableMessage, this.tree]);
|
||||
dispose(<IDisposable[]>[this.preview, this.previewNotAvailableMessage, this.tree]);
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@
|
||||
import 'vs/css!./rename';
|
||||
import {localize} from 'vs/nls';
|
||||
import {canceled} from 'vs/base/common/errors';
|
||||
import {IDisposable, disposeAll} from 'vs/base/common/lifecycle';
|
||||
import {IDisposable, dispose} from 'vs/base/common/lifecycle';
|
||||
import {TPromise} from 'vs/base/common/winjs.base';
|
||||
import {Range} from 'vs/editor/common/core/range';
|
||||
import {EventType, IPosition, IRange} from 'vs/editor/common/editorCommon';
|
||||
@@ -85,7 +85,7 @@ export default class RenameInputField implements IContentWidget, IDisposable {
|
||||
always: Function;
|
||||
|
||||
always = () => {
|
||||
disposeAll(disposeOnDone);
|
||||
dispose(disposeOnDone);
|
||||
this._hide();
|
||||
};
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
import * as nls from 'vs/nls';
|
||||
import {onUnexpectedError} from 'vs/base/common/errors';
|
||||
import {KeyCode, KeyMod} from 'vs/base/common/keyCodes';
|
||||
import {IDisposable, cAll, disposeAll} from 'vs/base/common/lifecycle';
|
||||
import {IDisposable, cAll, dispose} from 'vs/base/common/lifecycle';
|
||||
import {TPromise} from 'vs/base/common/winjs.base';
|
||||
import {IInstantiationService} from 'vs/platform/instantiation/common/instantiation';
|
||||
import {IKeybindingContextKey, IKeybindingService, KbExpr} from 'vs/platform/keybinding/common/keybindingService';
|
||||
@@ -70,7 +70,7 @@ export class SuggestController implements IEditorContribution {
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
this.toDispose = disposeAll(this.toDispose);
|
||||
this.toDispose = dispose(this.toDispose);
|
||||
this.triggerCharacterListeners = cAll(this.triggerCharacterListeners);
|
||||
|
||||
if (this.widget) {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
import {onUnexpectedError} from 'vs/base/common/errors';
|
||||
import Event, { Emitter } from 'vs/base/common/event';
|
||||
import {IDisposable, disposeAll} from 'vs/base/common/lifecycle';
|
||||
import {IDisposable, dispose} from 'vs/base/common/lifecycle';
|
||||
import {startsWith} from 'vs/base/common/strings';
|
||||
import {TPromise} from 'vs/base/common/winjs.base';
|
||||
import {EventType, ICommonCodeEditor, ICursorSelectionChangedEvent, IPosition} from 'vs/editor/common/editorCommon';
|
||||
@@ -387,6 +387,6 @@ export class SuggestModel implements IDisposable {
|
||||
|
||||
public dispose(): void {
|
||||
this.cancel(true);
|
||||
this.toDispose = disposeAll(this.toDispose);
|
||||
this.toDispose = dispose(this.toDispose);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import * as nls from 'vs/nls';
|
||||
import * as strings from 'vs/base/common/strings';
|
||||
import {isPromiseCanceledError, onUnexpectedError} from 'vs/base/common/errors';
|
||||
import Event, { Emitter } from 'vs/base/common/event';
|
||||
import {IDisposable, disposeAll} from 'vs/base/common/lifecycle';
|
||||
import {IDisposable, dispose} from 'vs/base/common/lifecycle';
|
||||
import * as timer from 'vs/base/common/timer';
|
||||
import {TPromise} from 'vs/base/common/winjs.base';
|
||||
import {addClass, append, emmet as $, hide, removeClass, show, toggleClass} from 'vs/base/browser/dom';
|
||||
@@ -830,7 +830,7 @@ export class SuggestWidget implements IContentWidget, IDisposable {
|
||||
this.details = null;
|
||||
this.list.dispose();
|
||||
this.list = null;
|
||||
this.toDispose = disposeAll(this.toDispose);
|
||||
this.toDispose = dispose(this.toDispose);
|
||||
this._onDidVisibilityChange.dispose();
|
||||
this._onDidVisibilityChange = null;
|
||||
if (this.loadingTimeout) {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
'use strict';
|
||||
|
||||
import 'vs/css!./workerStatusReporter';
|
||||
import {IDisposable, disposeAll} from 'vs/base/common/lifecycle';
|
||||
import {IDisposable, dispose} from 'vs/base/common/lifecycle';
|
||||
import * as browser from 'vs/base/browser/browser';
|
||||
import {IThreadService, IThreadServiceStatus, IThreadServiceStatusListener} from 'vs/platform/thread/common/thread';
|
||||
import {IEditorContribution} from 'vs/editor/common/editorCommon';
|
||||
@@ -46,7 +46,7 @@ class WorkerStatusReporter implements IEditorContribution, IThreadServiceStatusL
|
||||
|
||||
public dispose(): void {
|
||||
this._threadService.removeStatusListener(this);
|
||||
this._toDispose = disposeAll(this._toDispose);
|
||||
this._toDispose = dispose(this._toDispose);
|
||||
}
|
||||
|
||||
public getDomNode():HTMLElement {
|
||||
|
||||
@@ -297,7 +297,7 @@ export class TypeScriptMode<W extends typescriptWorker.TypeScriptWorker2> extend
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
this._disposables = lifecycle.disposeAll(this._disposables);
|
||||
this._disposables = lifecycle.dispose(this._disposables);
|
||||
}
|
||||
|
||||
_shouldBeValidated(model: EditorCommon.IModel): boolean {
|
||||
|
||||
@@ -77,7 +77,7 @@ export class TypeScriptWorker2 {
|
||||
this._modelListener[key]();
|
||||
delete this._modelListener[key];
|
||||
}
|
||||
this._disposables = lifecycle.disposeAll(this._disposables);
|
||||
this._disposables = lifecycle.dispose(this._disposables);
|
||||
}
|
||||
|
||||
// ---- typescript project
|
||||
|
||||
@@ -11,6 +11,7 @@ import objects = require('vs/base/common/objects');
|
||||
import errors = require('vs/base/common/errors');
|
||||
import uri from 'vs/base/common/uri';
|
||||
import model = require('./model');
|
||||
import {RunOnceScheduler} from 'vs/base/common/async';
|
||||
import lifecycle = require('vs/base/common/lifecycle');
|
||||
import collections = require('vs/base/common/collections');
|
||||
import {IConfigurationService, ConfigurationServiceEventTypes} from './configuration';
|
||||
@@ -42,8 +43,11 @@ interface ILoadConfigResult {
|
||||
}
|
||||
|
||||
export abstract class ConfigurationService extends eventEmitter.EventEmitter implements IConfigurationService, lifecycle.IDisposable {
|
||||
|
||||
public serviceId = IConfigurationService;
|
||||
|
||||
private static RELOAD_CONFIGURATION_DELAY = 50;
|
||||
|
||||
public onDidUpdateConfiguration: Event<{ config: any }>;
|
||||
|
||||
protected contextService: IWorkspaceContextService;
|
||||
@@ -54,6 +58,7 @@ export abstract class ConfigurationService extends eventEmitter.EventEmitter imp
|
||||
private bulkFetchFromWorkspacePromise: winjs.TPromise<any>;
|
||||
private workspaceFilePathToConfiguration: { [relativeWorkspacePath: string]: winjs.TPromise<model.IConfigFile> };
|
||||
private callOnDispose: Function;
|
||||
private reloadConfigurationScheduler: RunOnceScheduler;
|
||||
|
||||
constructor(contextService: IWorkspaceContextService, eventService: IEventService, workspaceSettingsRootFolder: string = '.vscode') {
|
||||
super();
|
||||
@@ -65,7 +70,7 @@ export abstract class ConfigurationService extends eventEmitter.EventEmitter imp
|
||||
this.workspaceFilePathToConfiguration = Object.create(null);
|
||||
|
||||
let unbind = this.eventService.addListener(Files.EventType.FILE_CHANGES, (events) => this.handleFileEvents(events));
|
||||
let subscription = (<IConfigurationRegistry>Registry.as(Extensions.Configuration)).onDidRegisterConfiguration(() => this.reloadAndEmit());
|
||||
let subscription = (<IConfigurationRegistry>Registry.as(Extensions.Configuration)).onDidRegisterConfiguration(() => this.reloadConfiguration());
|
||||
this.callOnDispose = () => {
|
||||
unbind();
|
||||
subscription.dispose();
|
||||
@@ -81,6 +86,10 @@ export abstract class ConfigurationService extends eventEmitter.EventEmitter imp
|
||||
protected abstract resolveStat(resource: uri): winjs.TPromise<IStat>;
|
||||
|
||||
public dispose(): void {
|
||||
if (this.reloadConfigurationScheduler) {
|
||||
this.reloadConfigurationScheduler.dispose();
|
||||
}
|
||||
|
||||
this.callOnDispose = lifecycle.cAll(this.callOnDispose);
|
||||
|
||||
super.dispose();
|
||||
@@ -175,11 +184,19 @@ export abstract class ConfigurationService extends eventEmitter.EventEmitter imp
|
||||
});
|
||||
}
|
||||
|
||||
protected reloadAndEmit(): winjs.TPromise<void> {
|
||||
return this.reloadConfiguration().then((config) => this.emit(ConfigurationServiceEventTypes.UPDATED, { config: config }));
|
||||
protected reloadConfiguration(): void {
|
||||
if (!this.reloadConfigurationScheduler) {
|
||||
this.reloadConfigurationScheduler = new RunOnceScheduler(() => {
|
||||
this.doReloadConfiguration().then((config) => this.emit(ConfigurationServiceEventTypes.UPDATED, { config: config })).done(null, errors.onUnexpectedError);
|
||||
}, ConfigurationService.RELOAD_CONFIGURATION_DELAY);
|
||||
}
|
||||
|
||||
if (!this.reloadConfigurationScheduler.isScheduled()) {
|
||||
this.reloadConfigurationScheduler.schedule();
|
||||
}
|
||||
}
|
||||
|
||||
private reloadConfiguration(section?: string): winjs.TPromise<any> {
|
||||
private doReloadConfiguration(section?: string): winjs.TPromise<any> {
|
||||
this.loadConfigurationPromise = null;
|
||||
|
||||
return this.loadConfiguration(section);
|
||||
@@ -219,7 +236,7 @@ export abstract class ConfigurationService extends eventEmitter.EventEmitter imp
|
||||
}
|
||||
|
||||
if (affectedByChanges) {
|
||||
this.reloadAndEmit();
|
||||
this.reloadConfiguration();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ export class ContextMenuHandler {
|
||||
|
||||
menu.focus();
|
||||
|
||||
return Lifecycle.combinedDispose(listener1, listener2, menu);
|
||||
return Lifecycle.combinedDisposable(listener1, listener2, menu);
|
||||
},
|
||||
|
||||
onHide: (didCancel?: boolean) => {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import {disposeAll} from 'vs/base/common/lifecycle';
|
||||
import {dispose} from 'vs/base/common/lifecycle';
|
||||
import {IDisposable} from 'vs/base/common/lifecycle';
|
||||
import * as paths from 'vs/base/common/paths';
|
||||
import Severity from 'vs/base/common/severity';
|
||||
@@ -296,7 +296,7 @@ export class ExtHostExtensionService extends AbstractExtensionService<ExtHostExt
|
||||
|
||||
// clean up subscriptions
|
||||
try {
|
||||
disposeAll(extension.subscriptions);
|
||||
dispose(extension.subscriptions);
|
||||
} catch (err) {
|
||||
// TODO: Do something with err if this is not the shutdown case
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'vs/css!./keybindings';
|
||||
import * as nls from 'vs/nls';
|
||||
import {IHTMLContentElement} from 'vs/base/common/htmlContent';
|
||||
import {KeyCode, Keybinding} from 'vs/base/common/keyCodes';
|
||||
import {IDisposable, disposeAll} from 'vs/base/common/lifecycle';
|
||||
import {IDisposable, dispose} from 'vs/base/common/lifecycle';
|
||||
import Severity from 'vs/base/common/severity';
|
||||
import {TPromise} from 'vs/base/common/winjs.base';
|
||||
import * as dom from 'vs/base/browser/dom';
|
||||
@@ -218,7 +218,7 @@ export abstract class KeybindingService extends AbstractKeybindingService implem
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
this._toDispose = disposeAll(this._toDispose);
|
||||
this._toDispose = dispose(this._toDispose);
|
||||
}
|
||||
|
||||
public getLabelFor(keybinding: Keybinding): string {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
'use strict';
|
||||
|
||||
import {clone} from 'vs/base/common/objects';
|
||||
import {IDisposable, disposeAll} from 'vs/base/common/lifecycle';
|
||||
import {IDisposable, dispose} from 'vs/base/common/lifecycle';
|
||||
import {IThreadService, Remotable} from 'vs/platform/thread/common/thread';
|
||||
import {IConfigurationService, ConfigurationServiceEventTypes, IConfigurationServiceEvent} from 'vs/platform/configuration/common/configuration';
|
||||
import Event, {Emitter} from 'vs/base/common/event';
|
||||
@@ -94,6 +94,6 @@ export class MainThreadConfiguration {
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
this._toDispose = disposeAll(this._toDispose);
|
||||
this._toDispose = dispose(this._toDispose);
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@ import {MirrorModel2} from 'vs/editor/common/model/mirrorModel2';
|
||||
import {Remotable, IThreadService} from 'vs/platform/thread/common/thread';
|
||||
import Event, {Emitter} from 'vs/base/common/event';
|
||||
import URI from 'vs/base/common/uri';
|
||||
import {IDisposable, disposeAll} from 'vs/base/common/lifecycle';
|
||||
import {IDisposable, dispose} from 'vs/base/common/lifecycle';
|
||||
import {Range, Position, Disposable} from 'vs/workbench/api/node/extHostTypes';
|
||||
import {IEventService} from 'vs/platform/event/common/event';
|
||||
import {IWorkbenchEditorService} from 'vs/workbench/services/editor/common/editorService';
|
||||
@@ -520,7 +520,7 @@ export class MainThreadDocuments {
|
||||
this._modelToDisposeMap[modelUrl].dispose();
|
||||
});
|
||||
this._modelToDisposeMap = Object.create(null);
|
||||
this._toDispose = disposeAll(this._toDispose);
|
||||
this._toDispose = dispose(this._toDispose);
|
||||
}
|
||||
|
||||
private _shouldHandleFileEvent(e: LocalFileChangeEvent): boolean {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
import URI from 'vs/base/common/uri';
|
||||
import Event, {Emitter} from 'vs/base/common/event';
|
||||
import {IDisposable, disposeAll} from 'vs/base/common/lifecycle';
|
||||
import {IDisposable, dispose} from 'vs/base/common/lifecycle';
|
||||
import {TPromise} from 'vs/base/common/winjs.base';
|
||||
import {Remotable, IThreadService} from 'vs/platform/thread/common/thread';
|
||||
import {ExtHostModelService, ExtHostDocumentData} from 'vs/workbench/api/node/extHostDocuments';
|
||||
@@ -508,10 +508,10 @@ export class MainThreadEditors {
|
||||
|
||||
public dispose(): void {
|
||||
Object.keys(this._textEditorsListenersMap).forEach((editorId) => {
|
||||
disposeAll(this._textEditorsListenersMap[editorId]);
|
||||
dispose(this._textEditorsListenersMap[editorId]);
|
||||
});
|
||||
this._textEditorsListenersMap = Object.create(null);
|
||||
this._toDispose = disposeAll(this._toDispose);
|
||||
this._toDispose = dispose(this._toDispose);
|
||||
}
|
||||
|
||||
private _onTextEditorAdd(textEditor: MainThreadTextEditor): void {
|
||||
@@ -537,7 +537,7 @@ export class MainThreadEditors {
|
||||
|
||||
private _onTextEditorRemove(textEditor: MainThreadTextEditor): void {
|
||||
let id = textEditor.getId();
|
||||
disposeAll(this._textEditorsListenersMap[id]);
|
||||
dispose(this._textEditorsListenersMap[id]);
|
||||
delete this._textEditorsListenersMap[id];
|
||||
delete this._textEditorsMap[id];
|
||||
this._proxy._acceptTextEditorRemove(id);
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
import URI from 'vs/base/common/uri';
|
||||
import {DefaultFilter} from 'vs/editor/common/modes/modesFilters';
|
||||
import {TPromise} from 'vs/base/common/winjs.base';
|
||||
import {IDisposable, disposeAll} from 'vs/base/common/lifecycle';
|
||||
import {IDisposable, dispose} from 'vs/base/common/lifecycle';
|
||||
import {Remotable, IThreadService} from 'vs/platform/thread/common/thread';
|
||||
import {Range as EditorRange} from 'vs/editor/common/core/range';
|
||||
import * as vscode from 'vscode';
|
||||
@@ -115,7 +115,7 @@ class CodeLensAdapter implements modes.ICodeLensSupport {
|
||||
return new ShallowCancelThenPromise(newCodeLensData.then(newCached => {
|
||||
if (entry) {
|
||||
// only now dispose old commands et al
|
||||
entry.data.then(oldCached => disposeAll(oldCached.disposables));
|
||||
entry.data.then(oldCached => dispose(oldCached.disposables));
|
||||
}
|
||||
return newCached && newCached.symbols;
|
||||
}));
|
||||
@@ -320,7 +320,7 @@ class QuickFixAdapter implements modes.IQuickFixSupport {
|
||||
return diag;
|
||||
});
|
||||
|
||||
this._cachedCommands = disposeAll(this._cachedCommands);
|
||||
this._cachedCommands = dispose(this._cachedCommands);
|
||||
const ctx = { commands: this._commands, disposables: this._cachedCommands };
|
||||
|
||||
return asWinJsPromise(token => this._provider.provideCodeActions(doc, ran, { diagnostics: <any>diagnostics }, token)).then(commands => {
|
||||
|
||||
@@ -9,7 +9,7 @@ import Event, {Emitter} from 'vs/base/common/event';
|
||||
import {IEditor} from 'vs/platform/editor/common/editor';
|
||||
import {ICodeEditorService} from 'vs/editor/common/services/codeEditorService';
|
||||
import {IModelService} from 'vs/editor/common/services/modelService';
|
||||
import {IDisposable, disposeAll} from 'vs/base/common/lifecycle';
|
||||
import {IDisposable, dispose} from 'vs/base/common/lifecycle';
|
||||
import {RunOnceScheduler} from 'vs/base/common/async';
|
||||
import {Range} from 'vs/editor/common/core/range';
|
||||
import {Selection} from 'vs/editor/common/core/selection';
|
||||
@@ -99,9 +99,9 @@ export class MainThreadTextEditor {
|
||||
|
||||
public dispose(): void {
|
||||
this._model = null;
|
||||
this._modelListeners = disposeAll(this._modelListeners);
|
||||
this._modelListeners = dispose(this._modelListeners);
|
||||
this._codeEditor = null;
|
||||
this._codeEditorListeners = disposeAll(this._codeEditorListeners);
|
||||
this._codeEditorListeners = dispose(this._codeEditorListeners);
|
||||
}
|
||||
|
||||
public getId(): string {
|
||||
@@ -121,7 +121,7 @@ export class MainThreadTextEditor {
|
||||
// Nothing to do...
|
||||
return;
|
||||
}
|
||||
this._codeEditorListeners = disposeAll(this._codeEditorListeners);
|
||||
this._codeEditorListeners = dispose(this._codeEditorListeners);
|
||||
|
||||
this._codeEditor = codeEditor;
|
||||
if (this._codeEditor) {
|
||||
@@ -387,7 +387,7 @@ export class MainThreadEditorsTracker {
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
this._toDispose = disposeAll(this._toDispose);
|
||||
this._toDispose = dispose(this._toDispose);
|
||||
}
|
||||
|
||||
private _onModelAdded(model: EditorCommon.IModel): void {
|
||||
|
||||
@@ -19,7 +19,7 @@ import {Action} from 'vs/base/common/actions';
|
||||
import {IMode} from 'vs/editor/common/modes';
|
||||
import {UntitledEditorInput} from 'vs/workbench/common/editor/untitledEditorInput';
|
||||
import {IFileEditorInput, EncodingMode, IEncodingSupport, asFileEditorInput, getUntitledOrFileResource} from 'vs/workbench/common/editor';
|
||||
import {IDisposable, combinedDispose} from 'vs/base/common/lifecycle';
|
||||
import {IDisposable, combinedDisposable} from 'vs/base/common/lifecycle';
|
||||
import {IMessageService, Severity} from 'vs/platform/message/common/message';
|
||||
import {ICommonCodeEditor} from 'vs/editor/common/editorCommon';
|
||||
import {OpenGlobalSettingsAction} from 'vs/workbench/browser/actions/openSettings';
|
||||
@@ -298,7 +298,7 @@ export class EditorStatus implements IStatusbarItem {
|
||||
this.eventService.addListener2(EventType.TEXT_EDITOR_CONTENT_OPTIONS_CHANGED, (e: EditorEvent) => this.onIndentationChange(e.editor))
|
||||
);
|
||||
|
||||
return combinedDispose(...this.toDispose);
|
||||
return combinedDisposable(this.toDispose);
|
||||
}
|
||||
|
||||
private updateState(update: StateDelta): void {
|
||||
@@ -488,7 +488,7 @@ export class EditorStatus implements IStatusbarItem {
|
||||
update.indentation = (
|
||||
modelOpts.insertSpaces
|
||||
? nls.localize('spacesSize', "Spaces: {0}", modelOpts.tabSize)
|
||||
: nls.localize('tabSize', "Tab Size: {0}", modelOpts.tabSize)
|
||||
: nls.localize({ key: 'tabSize', comment: ['Tab corresponds to the tab key']}, "Tab Size: {0}", modelOpts.tabSize)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import types = require('vs/base/common/types');
|
||||
import nls = require('vs/nls');
|
||||
import {toErrorMessage} from 'vs/base/common/errors';
|
||||
import {TPromise} from 'vs/base/common/winjs.base';
|
||||
import {disposeAll, IDisposable} from 'vs/base/common/lifecycle';
|
||||
import {dispose, IDisposable} from 'vs/base/common/lifecycle';
|
||||
import {Builder, $} from 'vs/base/browser/builder';
|
||||
import {OcticonLabel} from 'vs/base/browser/ui/octiconLabel/octiconLabel';
|
||||
import {Registry} from 'vs/platform/platform';
|
||||
@@ -145,7 +145,7 @@ export class StatusbarPart extends Part implements IStatusbarService {
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
this.toDispose = disposeAll(this.toDispose);
|
||||
this.toDispose = dispose(this.toDispose);
|
||||
|
||||
super.dispose();
|
||||
}
|
||||
@@ -196,7 +196,7 @@ class StatusBarEntryItem implements IStatusbarItem {
|
||||
|
||||
return {
|
||||
dispose: () => {
|
||||
toDispose = disposeAll(toDispose);
|
||||
toDispose = dispose(toDispose);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ import {ITree, IFocusEvent, ISelectionEvent} from 'vs/base/parts/tree/browser/tr
|
||||
import {prepareActions} from 'vs/workbench/browser/actionBarRegistry';
|
||||
import {ToolBar} from 'vs/base/browser/ui/toolbar/toolbar';
|
||||
import {DelayedDragHandler} from 'vs/base/browser/dnd';
|
||||
import {disposeAll, IDisposable} from 'vs/base/common/lifecycle';
|
||||
import {dispose, IDisposable} from 'vs/base/common/lifecycle';
|
||||
import {CollapsibleView, CollapsibleState, FixedCollapsibleView} from 'vs/base/browser/ui/splitview/splitview';
|
||||
import {IViewletService} from 'vs/workbench/services/viewlet/common/viewletService';
|
||||
import {IWorkbenchEditorService} from 'vs/workbench/services/editor/common/editorService';
|
||||
@@ -402,7 +402,7 @@ export class AdaptiveCollapsibleViewletView extends FixedCollapsibleView impleme
|
||||
|
||||
this.dragHandler.dispose();
|
||||
|
||||
this.toDispose = disposeAll(this.toDispose);
|
||||
this.toDispose = dispose(this.toDispose);
|
||||
|
||||
if (this.toolBar) {
|
||||
this.toolBar.dispose();
|
||||
@@ -529,7 +529,7 @@ export class CollapsibleViewletView extends CollapsibleView implements IViewletV
|
||||
|
||||
this.dragHandler.dispose();
|
||||
|
||||
this.toDispose = disposeAll(this.toDispose);
|
||||
this.toDispose = dispose(this.toDispose);
|
||||
|
||||
if (this.toolBar) {
|
||||
this.toolBar.dispose();
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
import 'vs/css!./media/workbench';
|
||||
import {TPromise, ValueCallback} from 'vs/base/common/winjs.base';
|
||||
import types = require('vs/base/common/types');
|
||||
import {IDisposable, disposeAll} from 'vs/base/common/lifecycle';
|
||||
import {IDisposable, dispose} from 'vs/base/common/lifecycle';
|
||||
import strings = require('vs/base/common/strings');
|
||||
import DOM = require('vs/base/browser/dom');
|
||||
import {Box, Builder, withElementById, $} from 'vs/base/browser/builder';
|
||||
@@ -649,7 +649,7 @@ export class Workbench implements IPartService {
|
||||
public dispose(): void {
|
||||
|
||||
// Dispose all
|
||||
this.toDispose = disposeAll(this.toDispose);
|
||||
this.toDispose = dispose(this.toDispose);
|
||||
|
||||
// Event
|
||||
this.eventService.emit(EventType.WORKBENCH_DISPOSED);
|
||||
|
||||
@@ -17,7 +17,7 @@ import {Dimension, Builder, $} from 'vs/base/browser/builder';
|
||||
import objects = require('vs/base/common/objects');
|
||||
import dom = require('vs/base/browser/dom');
|
||||
import aria = require('vs/base/browser/ui/aria/aria');
|
||||
import {disposeAll, IDisposable} from 'vs/base/common/lifecycle';
|
||||
import {dispose, IDisposable} from 'vs/base/common/lifecycle';
|
||||
import errors = require('vs/base/common/errors');
|
||||
import {ContextViewService} from 'vs/platform/contextview/browser/contextViewService';
|
||||
import {ContextMenuService} from 'vs/workbench/services/contextview/electron-browser/contextmenuService';
|
||||
@@ -255,8 +255,7 @@ export class WorkbenchShell {
|
||||
let lifecycleService = new LifecycleService(this.messageService, this.windowService);
|
||||
lifecycleService.onShutdown(() => fileService.dispose());
|
||||
|
||||
this.threadService = new MainThreadService(this.contextService, this.messageService, this.windowService);
|
||||
lifecycleService.onShutdown(() => this.threadService.dispose());
|
||||
this.threadService = new MainThreadService(this.contextService, this.messageService, this.windowService, lifecycleService);
|
||||
|
||||
let requestService = new RequestService(
|
||||
this.contextService,
|
||||
@@ -510,7 +509,7 @@ export class WorkbenchShell {
|
||||
this.storageService.dispose();
|
||||
|
||||
// Listeners
|
||||
this.toUnbind = disposeAll(this.toUnbind);
|
||||
this.toUnbind = dispose(this.toUnbind);
|
||||
|
||||
// Container
|
||||
$(this.container).empty();
|
||||
|
||||
@@ -103,7 +103,7 @@ export class BreakpointWidget extends ZoneWidget {
|
||||
super.dispose();
|
||||
this.breakpointWidgetVisible.reset();
|
||||
BreakpointWidget.INSTANCE = undefined;
|
||||
lifecycle.disposeAll(this.toDispose);
|
||||
lifecycle.dispose(this.toDispose);
|
||||
setTimeout(() => this.editor.focus(), 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ export class SelectConfigActionItem extends BaseActionItem {
|
||||
|
||||
public dispose(): void {
|
||||
this.debugService = null;
|
||||
this.toDispose = lifecycle.disposeAll(this.toDispose);
|
||||
this.toDispose = lifecycle.dispose(this.toDispose);
|
||||
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@@ -76,7 +76,8 @@ export class DebugActionsWidget implements wbext.IWorkbenchContribution {
|
||||
}
|
||||
|
||||
private onDebugStateChange(): void {
|
||||
if (this.debugService.getState() === debug.State.Inactive) {
|
||||
const state = this.debugService.getState();
|
||||
if (state === debug.State.Disabled || state === debug.State.Inactive || state === debug.State.Initializing) {
|
||||
return this.hide();
|
||||
}
|
||||
|
||||
@@ -127,7 +128,7 @@ export class DebugActionsWidget implements wbext.IWorkbenchContribution {
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
this.toDispose = lifecycle.disposeAll(this.toDispose);
|
||||
this.toDispose = lifecycle.dispose(this.toDispose);
|
||||
|
||||
if (this.$el) {
|
||||
this.$el.destroy();
|
||||
|
||||
@@ -214,6 +214,6 @@ export class DebugEditorContribution implements debug.IDebugEditorContribution {
|
||||
};
|
||||
|
||||
public dispose(): void {
|
||||
this.toDispose = lifecycle.disposeAll(this.toDispose);
|
||||
this.toDispose = lifecycle.dispose(this.toDispose);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,12 +65,12 @@ export class DebugEditorModelManager implements IWorkbenchContribution {
|
||||
for (let modelUrlStr in this.modelData) {
|
||||
if (this.modelData.hasOwnProperty(modelUrlStr)) {
|
||||
const modelData = this.modelData[modelUrlStr];
|
||||
lifecycle.disposeAll(modelData.toDispose);
|
||||
lifecycle.dispose(modelData.toDispose);
|
||||
modelData.model.deltaDecorations(modelData.breakpointDecorationIds, []);
|
||||
modelData.model.deltaDecorations(modelData.currentStackDecorations, []);
|
||||
}
|
||||
}
|
||||
this.toDispose = lifecycle.disposeAll(this.toDispose);
|
||||
this.toDispose = lifecycle.dispose(this.toDispose);
|
||||
|
||||
this.modelData = null;
|
||||
}
|
||||
@@ -117,7 +117,7 @@ export class DebugEditorModelManager implements IWorkbenchContribution {
|
||||
const modelData = this.modelData[modelUrlStr];
|
||||
delete this.modelData[modelUrlStr];
|
||||
|
||||
lifecycle.disposeAll(modelData.toDispose);
|
||||
lifecycle.dispose(modelData.toDispose);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -237,7 +237,7 @@ export class DebugHoverWidget implements editorbrowser.IContentWidget {
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
this.toDispose = lifecycle.disposeAll(this.toDispose);
|
||||
this.toDispose = lifecycle.dispose(this.toDispose);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ function renderRenameBox(debugService: debug.IDebugService, contextViewService:
|
||||
|
||||
// need to remove the input box since this template will be reused.
|
||||
container.removeChild(inputBoxContainer);
|
||||
lifecycle.disposeAll(toDispose);
|
||||
lifecycle.dispose(toDispose);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -635,7 +635,7 @@ export class WatchExpressionsRenderer implements tree.IRenderer {
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
this.toDispose = lifecycle.disposeAll(this.toDispose);
|
||||
this.toDispose = lifecycle.dispose(this.toDispose);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -868,7 +868,7 @@ export class BreakpointsRenderer implements tree.IRenderer {
|
||||
}
|
||||
|
||||
public renderElement(tree: tree.ITree, element: any, templateId: string, templateData: any): void {
|
||||
templateData.toDisposeBeforeRender = lifecycle.disposeAll(templateData.toDisposeBeforeRender);
|
||||
templateData.toDisposeBeforeRender = lifecycle.dispose(templateData.toDisposeBeforeRender);
|
||||
templateData.toDisposeBeforeRender.push(dom.addStandardDisposableListener(templateData.checkbox, 'change', (e) => {
|
||||
this.debugService.toggleEnablement(element);
|
||||
}));
|
||||
|
||||
@@ -576,7 +576,7 @@ export class DebugViewlet extends viewlet.Viewlet {
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
this.toDispose = lifecycle.disposeAll(this.toDispose);
|
||||
this.toDispose = lifecycle.dispose(this.toDispose);
|
||||
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@@ -182,7 +182,7 @@ export class Repl extends Panel {
|
||||
|
||||
public dispose(): void {
|
||||
// destroy container
|
||||
this.toDispose = lifecycle.disposeAll(this.toDispose);
|
||||
this.toDispose = lifecycle.dispose(this.toDispose);
|
||||
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@@ -460,6 +460,7 @@ export class ReplExpressionsActionProvider implements renderer.IActionProvider {
|
||||
actions.push(this.instantiationService.createInstance(debugactions.AddToWatchExpressionsAction, debugactions.AddToWatchExpressionsAction.ID, debugactions.AddToWatchExpressionsAction.LABEL, element));
|
||||
actions.push(new actionbar.Separator());
|
||||
}
|
||||
actions.push(new debugactions.CopyAction(debugactions.CopyAction.ID, debugactions.CopyAction.LABEL));
|
||||
actions.push(this.instantiationService.createInstance(debugactions.ClearReplAction, debugactions.ClearReplAction.ID, debugactions.ClearReplAction.LABEL));
|
||||
|
||||
return TPromise.as(actions);
|
||||
|
||||
@@ -722,6 +722,6 @@ export class Model extends ee.EventEmitter implements debug.IModel {
|
||||
this.functionBreakpoints = null;
|
||||
this.watchExpressions = null;
|
||||
this.replElements = null;
|
||||
this.toDispose = lifecycle.disposeAll(this.toDispose);
|
||||
this.toDispose = lifecycle.dispose(this.toDispose);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -382,6 +382,8 @@ declare module DebugProtocol {
|
||||
export interface StackTraceArguments {
|
||||
/** Retrieve the stacktrace for this thread. */
|
||||
threadId: number;
|
||||
/** the index of the first frames to return; if omitted frames start at 0. */
|
||||
startFrame?: number;
|
||||
/** The maximum number of frames to return. If levels is not specified or 0, all frames are returned. */
|
||||
levels?: number;
|
||||
}
|
||||
@@ -391,6 +393,8 @@ declare module DebugProtocol {
|
||||
/** The frames of the stackframe. If the array has length zero, there are no stackframes available.
|
||||
This means that there is no location information available. */
|
||||
stackFrames: StackFrame[];
|
||||
/** The total number of frames available. */
|
||||
totalFrames?: number;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ export class AbstractDebugAction extends actions.Action {
|
||||
|
||||
public dispose(): void {
|
||||
this.debugService = null;
|
||||
this.toDispose = lifecycle.disposeAll(this.toDispose);
|
||||
this.toDispose = lifecycle.dispose(this.toDispose);
|
||||
|
||||
super.dispose();
|
||||
}
|
||||
@@ -705,6 +705,16 @@ export class ClearReplAction extends AbstractDebugAction {
|
||||
}
|
||||
}
|
||||
|
||||
export class CopyAction extends actions.Action {
|
||||
static ID = 'workbench.debug.action.copy';
|
||||
static LABEL = nls.localize('copy', "Copy");
|
||||
|
||||
public run(): TPromise<any> {
|
||||
clipboard.writeText(window.getSelection().toString());
|
||||
return TPromise.as(null);
|
||||
}
|
||||
}
|
||||
|
||||
export class ToggleReplAction extends AbstractDebugAction {
|
||||
static ID = 'workbench.debug.action.toggleRepl';
|
||||
static LABEL = nls.localize('toggleRepl', "Debug Console");
|
||||
|
||||
@@ -48,7 +48,7 @@ import { ITextFileService } from 'vs/workbench/parts/files/common/files';
|
||||
import { IWorkspaceContextService } from 'vs/workbench/services/workspace/common/contextService';
|
||||
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { IWindowService, IBroadcast } from 'vs/workbench/services/window/electron-browser/windowService';
|
||||
import { ILogEntry, PLUGIN_LOG_BROADCAST_CHANNEL, PLUGIN_ATTACH_BROADCAST_CHANNEL } from 'vs/workbench/services/thread/electron-browser/threadService';
|
||||
import { ILogEntry, EXTENSION_LOG_BROADCAST_CHANNEL, EXTENSION_ATTACH_BROADCAST_CHANNEL, EXTENSION_TERMINATE_BROADCAST_CHANNEL } from 'vs/workbench/services/thread/electron-browser/threadService';
|
||||
import { ipcRenderer as ipc } from 'electron';
|
||||
|
||||
const DEBUG_BREAKPOINTS_KEY = 'debug.breakpoint';
|
||||
@@ -142,9 +142,13 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService
|
||||
private onBroadcast(broadcast: IBroadcast): void {
|
||||
|
||||
// attach: PH is ready to be attached to
|
||||
if (broadcast.channel === PLUGIN_ATTACH_BROADCAST_CHANNEL) {
|
||||
if (broadcast.channel === EXTENSION_ATTACH_BROADCAST_CHANNEL) {
|
||||
this.rawAttach(broadcast.payload.port);
|
||||
return;
|
||||
}
|
||||
|
||||
if (broadcast.channel === EXTENSION_TERMINATE_BROADCAST_CHANNEL) {
|
||||
this.onSessionEnd();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -155,7 +159,7 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService
|
||||
}
|
||||
|
||||
// a plugin logged output, show it inside the REPL
|
||||
if (broadcast.channel === PLUGIN_LOG_BROADCAST_CHANNEL) {
|
||||
if (broadcast.channel === EXTENSION_LOG_BROADCAST_CHANNEL) {
|
||||
let extensionOutput: ILogEntry = broadcast.payload;
|
||||
let sev = extensionOutput.severity === 'warn' ? severity.Warning : extensionOutput.severity === 'error' ? severity.Error : severity.Info;
|
||||
|
||||
@@ -523,11 +527,12 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService
|
||||
}
|
||||
|
||||
public createSession(noDebug: boolean, changeViewState = !this.partService.isSideBarHidden()): TPromise<any> {
|
||||
this.setStateAndEmit(debug.State.Initializing);
|
||||
this.clearReplExpressions();
|
||||
|
||||
return this.textFileService.saveAll().then(() => this.extensionService.onReady()).then(() => this.setConfiguration(this.configurationManager.getConfigurationName())).then(() => {
|
||||
|
||||
return this.textFileService.saveAll()
|
||||
.then(() => this.extensionService.onReady()
|
||||
.then(() => this.setConfiguration(this.configurationManager.getConfigurationName())
|
||||
.then(() => {
|
||||
const configuration = this.configurationManager.getConfiguration();
|
||||
if (!configuration) {
|
||||
return this.configurationManager.openConfigFile(false).then(openend => {
|
||||
@@ -571,10 +576,11 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService
|
||||
actions: [CloseAction, this.taskService.configureAction()]
|
||||
});
|
||||
});
|
||||
});
|
||||
})));
|
||||
}
|
||||
|
||||
private doCreateSession(configuration: debug.IConfig, changeViewState: boolean): TPromise<any> {
|
||||
this.setStateAndEmit(debug.State.Initializing);
|
||||
const key = this.configurationManager.getAdapter().aiKey;
|
||||
const telemetryInfo = Object.create(null);
|
||||
this.telemetryService.getTelemetryInfo().then(info => {
|
||||
@@ -612,6 +618,7 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService
|
||||
this.telemetryService.publicLog('debugSessionStart', { type: configuration.type, breakpointCount: this.model.getBreakpoints().length, exceptionBreakpoints: this.model.getExceptionBreakpoints(), watchExpressionsCount: this.model.getWatchExpressions().length });
|
||||
}).then(undefined, (error: any) => {
|
||||
this.telemetryService.publicLog('debugMisconfiguration', { type: configuration ? configuration.type : undefined });
|
||||
this.setStateAndEmit(debug.State.Inactive);
|
||||
if (this.session) {
|
||||
this.session.disconnect();
|
||||
}
|
||||
@@ -703,7 +710,7 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService
|
||||
|
||||
private onSessionEnd(): void {
|
||||
try {
|
||||
this.debugStringEditorInputs = lifecycle.disposeAll(this.debugStringEditorInputs);
|
||||
this.debugStringEditorInputs = lifecycle.dispose(this.debugStringEditorInputs);
|
||||
} catch (e) {
|
||||
// an internal module might be open so the dispose can throw -> ignore and continue with stop session.
|
||||
}
|
||||
@@ -721,7 +728,7 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService
|
||||
}
|
||||
|
||||
this.session = null;
|
||||
this.toDisposeOnSessionEnd = lifecycle.disposeAll(this.toDisposeOnSessionEnd);
|
||||
this.toDisposeOnSessionEnd = lifecycle.dispose(this.toDisposeOnSessionEnd);
|
||||
this.partService.removeClass('debugging');
|
||||
this.editorService.focusEditor();
|
||||
|
||||
@@ -930,7 +937,7 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService
|
||||
this.session = null;
|
||||
}
|
||||
this.model.dispose();
|
||||
this.toDispose = lifecycle.disposeAll(this.toDispose);
|
||||
this.toDisposeOnSessionEnd = lifecycle.disposeAll(this.toDisposeOnSessionEnd);
|
||||
this.toDispose = lifecycle.dispose(this.toDispose);
|
||||
this.toDisposeOnSessionEnd = lifecycle.dispose(this.toDisposeOnSessionEnd);
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user