custom-electron-titlebar 3.2.5 → 3.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.vscode/launch.json +49 -0
- package/.vscode/tasks.json +34 -0
- package/README.md +15 -24
- package/_config.yml +1 -0
- package/{lib → build}/browser/browser.d.ts +0 -0
- package/{lib → build}/browser/browser.js +1 -0
- package/build/browser/browser.js.map +1 -0
- package/{lib → build}/browser/event.d.ts +0 -0
- package/{lib → build}/browser/event.js +3 -1
- package/build/browser/event.js.map +1 -0
- package/{lib → build}/browser/iframe.d.ts +0 -0
- package/{lib/base → build}/browser/iframe.js +1 -0
- package/build/browser/iframe.js.map +1 -0
- package/{lib → build}/browser/keyboardEvent.d.ts +0 -0
- package/{lib → build}/browser/keyboardEvent.js +1 -0
- package/build/browser/keyboardEvent.js.map +1 -0
- package/{lib → build}/browser/mouseEvent.d.ts +0 -0
- package/{lib → build}/browser/mouseEvent.js +1 -0
- package/build/browser/mouseEvent.js.map +1 -0
- package/{lib → build}/common/arrays.d.ts +0 -0
- package/{lib → build}/common/arrays.js +1 -0
- package/build/common/arrays.js.map +1 -0
- package/{lib → build}/common/async.d.ts +0 -0
- package/{lib → build}/common/async.js +1 -0
- package/build/common/async.js.map +1 -0
- package/{lib → build}/common/charCode.d.ts +0 -0
- package/{lib/base → build}/common/charCode.js +1 -0
- package/build/common/charCode.js.map +1 -0
- package/{lib → build}/common/color.d.ts +0 -0
- package/{lib → build}/common/color.js +1 -0
- package/build/common/color.js.map +1 -0
- package/{lib → build}/common/dom.d.ts +0 -0
- package/{lib → build}/common/dom.js +17 -14
- package/build/common/dom.js.map +1 -0
- package/{lib → build}/common/event.d.ts +0 -0
- package/{lib → build}/common/event.js +2 -1
- package/build/common/event.js.map +1 -0
- package/{lib → build}/common/iterator.d.ts +0 -0
- package/{lib → build}/common/iterator.js +1 -0
- package/build/common/iterator.js.map +1 -0
- package/{lib → build}/common/keyCodes.d.ts +0 -0
- package/{lib → build}/common/keyCodes.js +1 -0
- package/build/common/keyCodes.js.map +1 -0
- package/{lib → build}/common/lifecycle.d.ts +0 -0
- package/{lib → build}/common/lifecycle.js +1 -0
- package/build/common/lifecycle.js.map +1 -0
- package/{lib → build}/common/linkedList.d.ts +0 -0
- package/{lib → build}/common/linkedList.js +1 -0
- package/build/common/linkedList.js.map +1 -0
- package/{lib → build}/common/platform.d.ts +0 -0
- package/{lib → build}/common/platform.js +1 -0
- package/build/common/platform.js.map +1 -0
- package/{lib → build}/index.d.ts +0 -0
- package/{lib → build}/index.js +1 -0
- package/build/index.js.map +1 -0
- package/{lib → build}/menu/menu.d.ts +0 -0
- package/{lib → build}/menu/menu.js +39 -38
- package/build/menu/menu.js.map +1 -0
- package/{lib → build}/menu/menuitem.d.ts +10 -2
- package/{lib → build}/menu/menuitem.js +71 -29
- package/build/menu/menuitem.js.map +1 -0
- package/{lib → build}/menubar.d.ts +0 -0
- package/{lib → build}/menubar.js +38 -34
- package/build/menubar.js.map +1 -0
- package/{lib → build}/themebar.d.ts +0 -0
- package/{lib → build}/themebar.js +31 -2
- package/build/themebar.js.map +1 -0
- package/{lib → build}/titlebar.d.ts +0 -0
- package/{lib → build}/titlebar.js +72 -59
- package/build/titlebar.js.map +1 -0
- package/package.json +13 -7
- package/lib/base/browser/browser.d.ts +0 -25
- package/lib/base/browser/browser.js +0 -117
- package/lib/base/browser/canIUse.d.ts +0 -18
- package/lib/base/browser/canIUse.js +0 -63
- package/lib/base/browser/dom.d.ts +0 -230
- package/lib/base/browser/dom.js +0 -1080
- package/lib/base/browser/event.d.ts +0 -12
- package/lib/base/browser/event.js +0 -28
- package/lib/base/browser/iframe.d.ts +0 -33
- package/lib/base/browser/keyboardEvent.d.ts +0 -40
- package/lib/base/browser/keyboardEvent.js +0 -256
- package/lib/base/browser/mouseEvent.d.ts +0 -69
- package/lib/base/browser/mouseEvent.js +0 -146
- package/lib/base/common/arrays.d.ts +0 -149
- package/lib/base/common/arrays.js +0 -549
- package/lib/base/common/async.d.ts +0 -259
- package/lib/base/common/async.js +0 -728
- package/lib/base/common/cancellation.d.ts +0 -29
- package/lib/base/common/cancellation.js +0 -114
- package/lib/base/common/charCode.d.ts +0 -415
- package/lib/base/common/color.d.ts +0 -163
- package/lib/base/common/color.js +0 -495
- package/lib/base/common/errors.d.ts +0 -65
- package/lib/base/common/errors.js +0 -164
- package/lib/base/common/event.d.ts +0 -248
- package/lib/base/common/event.js +0 -703
- package/lib/base/common/functional.d.ts +0 -1
- package/lib/base/common/functional.js +0 -21
- package/lib/base/common/iterator.d.ts +0 -16
- package/lib/base/common/iterator.js +0 -82
- package/lib/base/common/keyCodes.d.ts +0 -268
- package/lib/base/common/keyCodes.js +0 -292
- package/lib/base/common/lifecycle.d.ts +0 -67
- package/lib/base/common/lifecycle.js +0 -234
- package/lib/base/common/linkedList.d.ts +0 -16
- package/lib/base/common/linkedList.js +0 -128
- package/lib/base/common/network.d.ts +0 -65
- package/lib/base/common/network.js +0 -124
- package/lib/base/common/path.d.ts +0 -39
- package/lib/base/common/path.js +0 -1407
- package/lib/base/common/platform.d.ts +0 -53
- package/lib/base/common/platform.js +0 -176
- package/lib/base/common/process.d.ts +0 -5
- package/lib/base/common/process.js +0 -18
- package/lib/base/common/sequence.d.ts +0 -27
- package/lib/base/common/sequence.js +0 -32
- package/lib/base/common/uri.d.ts +0 -153
- package/lib/base/common/uri.js +0 -612
- package/lib/browser/iframe.js +0 -109
- package/lib/common/charCode.js +0 -6
- package/lib/menu.d.ts +0 -53
- package/lib/menu.js +0 -532
- package/lib/menuitem.d.ts +0 -46
- package/lib/menuitem.js +0 -295
- package/lib/vs/base/browser/browser.d.ts +0 -25
- package/lib/vs/base/browser/browser.js +0 -117
- package/lib/vs/base/browser/canIUse.d.ts +0 -18
- package/lib/vs/base/browser/canIUse.js +0 -63
- package/lib/vs/base/browser/dom.d.ts +0 -230
- package/lib/vs/base/browser/dom.js +0 -1080
- package/lib/vs/base/browser/event.d.ts +0 -12
- package/lib/vs/base/browser/event.js +0 -28
- package/lib/vs/base/browser/iframe.d.ts +0 -33
- package/lib/vs/base/browser/iframe.js +0 -109
- package/lib/vs/base/browser/keyboardEvent.d.ts +0 -40
- package/lib/vs/base/browser/keyboardEvent.js +0 -256
- package/lib/vs/base/browser/mouseEvent.d.ts +0 -69
- package/lib/vs/base/browser/mouseEvent.js +0 -146
- package/lib/vs/base/common/arrays.d.ts +0 -149
- package/lib/vs/base/common/arrays.js +0 -549
- package/lib/vs/base/common/async.d.ts +0 -259
- package/lib/vs/base/common/async.js +0 -728
- package/lib/vs/base/common/cancellation.d.ts +0 -29
- package/lib/vs/base/common/cancellation.js +0 -114
- package/lib/vs/base/common/charCode.d.ts +0 -415
- package/lib/vs/base/common/charCode.js +0 -6
- package/lib/vs/base/common/color.d.ts +0 -163
- package/lib/vs/base/common/color.js +0 -495
- package/lib/vs/base/common/errors.d.ts +0 -65
- package/lib/vs/base/common/errors.js +0 -164
- package/lib/vs/base/common/event.d.ts +0 -248
- package/lib/vs/base/common/event.js +0 -703
- package/lib/vs/base/common/functional.d.ts +0 -1
- package/lib/vs/base/common/functional.js +0 -21
- package/lib/vs/base/common/iterator.d.ts +0 -16
- package/lib/vs/base/common/iterator.js +0 -82
- package/lib/vs/base/common/keyCodes.d.ts +0 -268
- package/lib/vs/base/common/keyCodes.js +0 -292
- package/lib/vs/base/common/lifecycle.d.ts +0 -67
- package/lib/vs/base/common/lifecycle.js +0 -234
- package/lib/vs/base/common/linkedList.d.ts +0 -16
- package/lib/vs/base/common/linkedList.js +0 -128
- package/lib/vs/base/common/network.d.ts +0 -65
- package/lib/vs/base/common/network.js +0 -124
- package/lib/vs/base/common/path.d.ts +0 -39
- package/lib/vs/base/common/path.js +0 -1407
- package/lib/vs/base/common/platform.d.ts +0 -53
- package/lib/vs/base/common/platform.js +0 -176
- package/lib/vs/base/common/process.d.ts +0 -5
- package/lib/vs/base/common/process.js +0 -18
- package/lib/vs/base/common/sequence.d.ts +0 -27
- package/lib/vs/base/common/sequence.js +0 -32
- package/lib/vs/base/common/uri.d.ts +0 -153
- package/lib/vs/base/common/uri.js +0 -612
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
export declare class MultiDisposeError extends Error {
|
|
2
|
-
readonly errors: any[];
|
|
3
|
-
constructor(errors: any[]);
|
|
4
|
-
}
|
|
5
|
-
export interface IDisposable {
|
|
6
|
-
dispose(): void;
|
|
7
|
-
}
|
|
8
|
-
export declare function isDisposable<E extends object>(thing: E): thing is E & IDisposable;
|
|
9
|
-
export declare function dispose<T extends IDisposable>(disposable: T): T;
|
|
10
|
-
export declare function dispose<T extends IDisposable>(disposable: T | undefined): T | undefined;
|
|
11
|
-
export declare function dispose<T extends IDisposable, A extends IterableIterator<T> = IterableIterator<T>>(disposables: IterableIterator<T>): A;
|
|
12
|
-
export declare function dispose<T extends IDisposable>(disposables: Array<T>): Array<T>;
|
|
13
|
-
export declare function dispose<T extends IDisposable>(disposables: ReadonlyArray<T>): ReadonlyArray<T>;
|
|
14
|
-
export declare function combinedDisposable(...disposables: IDisposable[]): IDisposable;
|
|
15
|
-
export declare function toDisposable(fn: () => void): IDisposable;
|
|
16
|
-
export declare class DisposableStore implements IDisposable {
|
|
17
|
-
static DISABLE_DISPOSED_WARNING: boolean;
|
|
18
|
-
private _toDispose;
|
|
19
|
-
private _isDisposed;
|
|
20
|
-
/**
|
|
21
|
-
* Dispose of all registered disposables and mark this object as disposed.
|
|
22
|
-
*
|
|
23
|
-
* Any future disposables added to this object will be disposed of on `add`.
|
|
24
|
-
*/
|
|
25
|
-
dispose(): void;
|
|
26
|
-
/**
|
|
27
|
-
* Dispose of all registered disposables but do not mark this object as disposed.
|
|
28
|
-
*/
|
|
29
|
-
clear(): void;
|
|
30
|
-
add<T extends IDisposable>(t: T): T;
|
|
31
|
-
}
|
|
32
|
-
export declare abstract class Disposable implements IDisposable {
|
|
33
|
-
static readonly None: Readonly<IDisposable>;
|
|
34
|
-
private readonly _store;
|
|
35
|
-
constructor();
|
|
36
|
-
dispose(): void;
|
|
37
|
-
protected _register<T extends IDisposable>(t: T): T;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Manages the lifecycle of a disposable value that may be changed.
|
|
41
|
-
*
|
|
42
|
-
* This ensures that when the disposable value is changed, the previously held disposable is disposed of. You can
|
|
43
|
-
* also register a `MutableDisposable` on a `Disposable` to ensure it is automatically cleaned up.
|
|
44
|
-
*/
|
|
45
|
-
export declare class MutableDisposable<T extends IDisposable> implements IDisposable {
|
|
46
|
-
private _value?;
|
|
47
|
-
private _isDisposed;
|
|
48
|
-
constructor();
|
|
49
|
-
get value(): T | undefined;
|
|
50
|
-
set value(value: T | undefined);
|
|
51
|
-
clear(): void;
|
|
52
|
-
dispose(): void;
|
|
53
|
-
}
|
|
54
|
-
export interface IReference<T> extends IDisposable {
|
|
55
|
-
readonly object: T;
|
|
56
|
-
}
|
|
57
|
-
export declare abstract class ReferenceCollection<T> {
|
|
58
|
-
private readonly references;
|
|
59
|
-
acquire(key: string, ...args: any[]): IReference<T>;
|
|
60
|
-
protected abstract createReferencedObject(key: string, ...args: any[]): T;
|
|
61
|
-
protected abstract destroyReferencedObject(key: string, object: T): void;
|
|
62
|
-
}
|
|
63
|
-
export declare class ImmortalReference<T> implements IReference<T> {
|
|
64
|
-
object: T;
|
|
65
|
-
constructor(object: T);
|
|
66
|
-
dispose(): void;
|
|
67
|
-
}
|
|
@@ -1,234 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*---------------------------------------------------------------------------------------------
|
|
3
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
5
|
-
*--------------------------------------------------------------------------------------------*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.ImmortalReference = exports.ReferenceCollection = exports.MutableDisposable = exports.Disposable = exports.DisposableStore = exports.toDisposable = exports.combinedDisposable = exports.dispose = exports.isDisposable = exports.MultiDisposeError = void 0;
|
|
8
|
-
const functional_1 = require("vs/base/common/functional");
|
|
9
|
-
const iterator_1 = require("vs/base/common/iterator");
|
|
10
|
-
/**
|
|
11
|
-
* Enables logging of potentially leaked disposables.
|
|
12
|
-
*
|
|
13
|
-
* A disposable is considered leaked if it is not disposed or not registered as the child of
|
|
14
|
-
* another disposable. This tracking is very simple an only works for classes that either
|
|
15
|
-
* extend Disposable or use a DisposableStore. This means there are a lot of false positives.
|
|
16
|
-
*/
|
|
17
|
-
const TRACK_DISPOSABLES = false;
|
|
18
|
-
const __is_disposable_tracked__ = '__is_disposable_tracked__';
|
|
19
|
-
function markTracked(x) {
|
|
20
|
-
if (!TRACK_DISPOSABLES) {
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
if (x && x !== Disposable.None) {
|
|
24
|
-
try {
|
|
25
|
-
x[__is_disposable_tracked__] = true;
|
|
26
|
-
}
|
|
27
|
-
catch {
|
|
28
|
-
// noop
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
function trackDisposable(x) {
|
|
33
|
-
if (!TRACK_DISPOSABLES) {
|
|
34
|
-
return x;
|
|
35
|
-
}
|
|
36
|
-
const stack = new Error('Potentially leaked disposable').stack;
|
|
37
|
-
setTimeout(() => {
|
|
38
|
-
if (!x[__is_disposable_tracked__]) {
|
|
39
|
-
console.log(stack);
|
|
40
|
-
}
|
|
41
|
-
}, 3000);
|
|
42
|
-
return x;
|
|
43
|
-
}
|
|
44
|
-
class MultiDisposeError extends Error {
|
|
45
|
-
constructor(errors) {
|
|
46
|
-
super(`Encounter errors while disposing of store. Errors: [${errors.join(', ')}]`);
|
|
47
|
-
this.errors = errors;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
exports.MultiDisposeError = MultiDisposeError;
|
|
51
|
-
function isDisposable(thing) {
|
|
52
|
-
return typeof thing.dispose === 'function' && thing.dispose.length === 0;
|
|
53
|
-
}
|
|
54
|
-
exports.isDisposable = isDisposable;
|
|
55
|
-
function dispose(arg) {
|
|
56
|
-
if (iterator_1.Iterable.is(arg)) {
|
|
57
|
-
let errors = [];
|
|
58
|
-
for (const d of arg) {
|
|
59
|
-
if (d) {
|
|
60
|
-
markTracked(d);
|
|
61
|
-
try {
|
|
62
|
-
d.dispose();
|
|
63
|
-
}
|
|
64
|
-
catch (e) {
|
|
65
|
-
errors.push(e);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
if (errors.length === 1) {
|
|
70
|
-
throw errors[0];
|
|
71
|
-
}
|
|
72
|
-
else if (errors.length > 1) {
|
|
73
|
-
throw new MultiDisposeError(errors);
|
|
74
|
-
}
|
|
75
|
-
return Array.isArray(arg) ? [] : arg;
|
|
76
|
-
}
|
|
77
|
-
else if (arg) {
|
|
78
|
-
markTracked(arg);
|
|
79
|
-
arg.dispose();
|
|
80
|
-
return arg;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
exports.dispose = dispose;
|
|
84
|
-
function combinedDisposable(...disposables) {
|
|
85
|
-
disposables.forEach(markTracked);
|
|
86
|
-
return trackDisposable({ dispose: () => dispose(disposables) });
|
|
87
|
-
}
|
|
88
|
-
exports.combinedDisposable = combinedDisposable;
|
|
89
|
-
function toDisposable(fn) {
|
|
90
|
-
const self = trackDisposable({
|
|
91
|
-
dispose: () => {
|
|
92
|
-
markTracked(self);
|
|
93
|
-
fn();
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
return self;
|
|
97
|
-
}
|
|
98
|
-
exports.toDisposable = toDisposable;
|
|
99
|
-
class DisposableStore {
|
|
100
|
-
constructor() {
|
|
101
|
-
this._toDispose = new Set();
|
|
102
|
-
this._isDisposed = false;
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Dispose of all registered disposables and mark this object as disposed.
|
|
106
|
-
*
|
|
107
|
-
* Any future disposables added to this object will be disposed of on `add`.
|
|
108
|
-
*/
|
|
109
|
-
dispose() {
|
|
110
|
-
if (this._isDisposed) {
|
|
111
|
-
return;
|
|
112
|
-
}
|
|
113
|
-
markTracked(this);
|
|
114
|
-
this._isDisposed = true;
|
|
115
|
-
this.clear();
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* Dispose of all registered disposables but do not mark this object as disposed.
|
|
119
|
-
*/
|
|
120
|
-
clear() {
|
|
121
|
-
try {
|
|
122
|
-
dispose(this._toDispose.values());
|
|
123
|
-
}
|
|
124
|
-
finally {
|
|
125
|
-
this._toDispose.clear();
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
add(t) {
|
|
129
|
-
if (!t) {
|
|
130
|
-
return t;
|
|
131
|
-
}
|
|
132
|
-
if (t === this) {
|
|
133
|
-
throw new Error('Cannot register a disposable on itself!');
|
|
134
|
-
}
|
|
135
|
-
markTracked(t);
|
|
136
|
-
if (this._isDisposed) {
|
|
137
|
-
if (!DisposableStore.DISABLE_DISPOSED_WARNING) {
|
|
138
|
-
console.warn(new Error('Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!').stack);
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
else {
|
|
142
|
-
this._toDispose.add(t);
|
|
143
|
-
}
|
|
144
|
-
return t;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
exports.DisposableStore = DisposableStore;
|
|
148
|
-
DisposableStore.DISABLE_DISPOSED_WARNING = false;
|
|
149
|
-
class Disposable {
|
|
150
|
-
constructor() {
|
|
151
|
-
this._store = new DisposableStore();
|
|
152
|
-
trackDisposable(this);
|
|
153
|
-
}
|
|
154
|
-
dispose() {
|
|
155
|
-
markTracked(this);
|
|
156
|
-
this._store.dispose();
|
|
157
|
-
}
|
|
158
|
-
_register(t) {
|
|
159
|
-
if (t === this) {
|
|
160
|
-
throw new Error('Cannot register a disposable on itself!');
|
|
161
|
-
}
|
|
162
|
-
return this._store.add(t);
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
exports.Disposable = Disposable;
|
|
166
|
-
Disposable.None = Object.freeze({ dispose() { } });
|
|
167
|
-
/**
|
|
168
|
-
* Manages the lifecycle of a disposable value that may be changed.
|
|
169
|
-
*
|
|
170
|
-
* This ensures that when the disposable value is changed, the previously held disposable is disposed of. You can
|
|
171
|
-
* also register a `MutableDisposable` on a `Disposable` to ensure it is automatically cleaned up.
|
|
172
|
-
*/
|
|
173
|
-
class MutableDisposable {
|
|
174
|
-
constructor() {
|
|
175
|
-
this._isDisposed = false;
|
|
176
|
-
trackDisposable(this);
|
|
177
|
-
}
|
|
178
|
-
get value() {
|
|
179
|
-
return this._isDisposed ? undefined : this._value;
|
|
180
|
-
}
|
|
181
|
-
set value(value) {
|
|
182
|
-
if (this._isDisposed || value === this._value) {
|
|
183
|
-
return;
|
|
184
|
-
}
|
|
185
|
-
if (this._value) {
|
|
186
|
-
this._value.dispose();
|
|
187
|
-
}
|
|
188
|
-
if (value) {
|
|
189
|
-
markTracked(value);
|
|
190
|
-
}
|
|
191
|
-
this._value = value;
|
|
192
|
-
}
|
|
193
|
-
clear() {
|
|
194
|
-
this.value = undefined;
|
|
195
|
-
}
|
|
196
|
-
dispose() {
|
|
197
|
-
this._isDisposed = true;
|
|
198
|
-
markTracked(this);
|
|
199
|
-
if (this._value) {
|
|
200
|
-
this._value.dispose();
|
|
201
|
-
}
|
|
202
|
-
this._value = undefined;
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
exports.MutableDisposable = MutableDisposable;
|
|
206
|
-
class ReferenceCollection {
|
|
207
|
-
constructor() {
|
|
208
|
-
this.references = new Map();
|
|
209
|
-
}
|
|
210
|
-
acquire(key, ...args) {
|
|
211
|
-
let reference = this.references.get(key);
|
|
212
|
-
if (!reference) {
|
|
213
|
-
reference = { counter: 0, object: this.createReferencedObject(key, ...args) };
|
|
214
|
-
this.references.set(key, reference);
|
|
215
|
-
}
|
|
216
|
-
const { object } = reference;
|
|
217
|
-
const dispose = functional_1.once(() => {
|
|
218
|
-
if (--reference.counter === 0) {
|
|
219
|
-
this.destroyReferencedObject(key, reference.object);
|
|
220
|
-
this.references.delete(key);
|
|
221
|
-
}
|
|
222
|
-
});
|
|
223
|
-
reference.counter++;
|
|
224
|
-
return { object, dispose };
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
exports.ReferenceCollection = ReferenceCollection;
|
|
228
|
-
class ImmortalReference {
|
|
229
|
-
constructor(object) {
|
|
230
|
-
this.object = object;
|
|
231
|
-
}
|
|
232
|
-
dispose() { }
|
|
233
|
-
}
|
|
234
|
-
exports.ImmortalReference = ImmortalReference;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export declare class LinkedList<E> {
|
|
2
|
-
private _first;
|
|
3
|
-
private _last;
|
|
4
|
-
private _size;
|
|
5
|
-
get size(): number;
|
|
6
|
-
isEmpty(): boolean;
|
|
7
|
-
clear(): void;
|
|
8
|
-
unshift(element: E): () => void;
|
|
9
|
-
push(element: E): () => void;
|
|
10
|
-
private _insert;
|
|
11
|
-
shift(): E | undefined;
|
|
12
|
-
pop(): E | undefined;
|
|
13
|
-
private _remove;
|
|
14
|
-
[Symbol.iterator](): Iterator<E>;
|
|
15
|
-
toArray(): E[];
|
|
16
|
-
}
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*---------------------------------------------------------------------------------------------
|
|
3
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
5
|
-
*--------------------------------------------------------------------------------------------*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.LinkedList = void 0;
|
|
8
|
-
class Node {
|
|
9
|
-
constructor(element) {
|
|
10
|
-
this.element = element;
|
|
11
|
-
this.next = Node.Undefined;
|
|
12
|
-
this.prev = Node.Undefined;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
Node.Undefined = new Node(undefined);
|
|
16
|
-
class LinkedList {
|
|
17
|
-
constructor() {
|
|
18
|
-
this._first = Node.Undefined;
|
|
19
|
-
this._last = Node.Undefined;
|
|
20
|
-
this._size = 0;
|
|
21
|
-
}
|
|
22
|
-
get size() {
|
|
23
|
-
return this._size;
|
|
24
|
-
}
|
|
25
|
-
isEmpty() {
|
|
26
|
-
return this._first === Node.Undefined;
|
|
27
|
-
}
|
|
28
|
-
clear() {
|
|
29
|
-
this._first = Node.Undefined;
|
|
30
|
-
this._last = Node.Undefined;
|
|
31
|
-
this._size = 0;
|
|
32
|
-
}
|
|
33
|
-
unshift(element) {
|
|
34
|
-
return this._insert(element, false);
|
|
35
|
-
}
|
|
36
|
-
push(element) {
|
|
37
|
-
return this._insert(element, true);
|
|
38
|
-
}
|
|
39
|
-
_insert(element, atTheEnd) {
|
|
40
|
-
const newNode = new Node(element);
|
|
41
|
-
if (this._first === Node.Undefined) {
|
|
42
|
-
this._first = newNode;
|
|
43
|
-
this._last = newNode;
|
|
44
|
-
}
|
|
45
|
-
else if (atTheEnd) {
|
|
46
|
-
// push
|
|
47
|
-
const oldLast = this._last;
|
|
48
|
-
this._last = newNode;
|
|
49
|
-
newNode.prev = oldLast;
|
|
50
|
-
oldLast.next = newNode;
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
// unshift
|
|
54
|
-
const oldFirst = this._first;
|
|
55
|
-
this._first = newNode;
|
|
56
|
-
newNode.next = oldFirst;
|
|
57
|
-
oldFirst.prev = newNode;
|
|
58
|
-
}
|
|
59
|
-
this._size += 1;
|
|
60
|
-
let didRemove = false;
|
|
61
|
-
return () => {
|
|
62
|
-
if (!didRemove) {
|
|
63
|
-
didRemove = true;
|
|
64
|
-
this._remove(newNode);
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
shift() {
|
|
69
|
-
if (this._first === Node.Undefined) {
|
|
70
|
-
return undefined;
|
|
71
|
-
}
|
|
72
|
-
else {
|
|
73
|
-
const res = this._first.element;
|
|
74
|
-
this._remove(this._first);
|
|
75
|
-
return res;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
pop() {
|
|
79
|
-
if (this._last === Node.Undefined) {
|
|
80
|
-
return undefined;
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
const res = this._last.element;
|
|
84
|
-
this._remove(this._last);
|
|
85
|
-
return res;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
_remove(node) {
|
|
89
|
-
if (node.prev !== Node.Undefined && node.next !== Node.Undefined) {
|
|
90
|
-
// middle
|
|
91
|
-
const anchor = node.prev;
|
|
92
|
-
anchor.next = node.next;
|
|
93
|
-
node.next.prev = anchor;
|
|
94
|
-
}
|
|
95
|
-
else if (node.prev === Node.Undefined && node.next === Node.Undefined) {
|
|
96
|
-
// only node
|
|
97
|
-
this._first = Node.Undefined;
|
|
98
|
-
this._last = Node.Undefined;
|
|
99
|
-
}
|
|
100
|
-
else if (node.next === Node.Undefined) {
|
|
101
|
-
// last
|
|
102
|
-
this._last = this._last.prev;
|
|
103
|
-
this._last.next = Node.Undefined;
|
|
104
|
-
}
|
|
105
|
-
else if (node.prev === Node.Undefined) {
|
|
106
|
-
// first
|
|
107
|
-
this._first = this._first.next;
|
|
108
|
-
this._first.prev = Node.Undefined;
|
|
109
|
-
}
|
|
110
|
-
// done
|
|
111
|
-
this._size -= 1;
|
|
112
|
-
}
|
|
113
|
-
*[Symbol.iterator]() {
|
|
114
|
-
let node = this._first;
|
|
115
|
-
while (node !== Node.Undefined) {
|
|
116
|
-
yield node.element;
|
|
117
|
-
node = node.next;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
toArray() {
|
|
121
|
-
const result = [];
|
|
122
|
-
for (let node = this._first; node !== Node.Undefined; node = node.next) {
|
|
123
|
-
result.push(node.element);
|
|
124
|
-
}
|
|
125
|
-
return result;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
exports.LinkedList = LinkedList;
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { URI } from 'vs/base/common/uri';
|
|
2
|
-
export declare namespace Schemas {
|
|
3
|
-
/**
|
|
4
|
-
* A schema that is used for models that exist in memory
|
|
5
|
-
* only and that have no correspondence on a server or such.
|
|
6
|
-
*/
|
|
7
|
-
const inMemory = "inmemory";
|
|
8
|
-
/**
|
|
9
|
-
* A schema that is used for setting files
|
|
10
|
-
*/
|
|
11
|
-
const vscode = "vscode";
|
|
12
|
-
/**
|
|
13
|
-
* A schema that is used for internal private files
|
|
14
|
-
*/
|
|
15
|
-
const internal = "private";
|
|
16
|
-
/**
|
|
17
|
-
* A walk-through document.
|
|
18
|
-
*/
|
|
19
|
-
const walkThrough = "walkThrough";
|
|
20
|
-
/**
|
|
21
|
-
* An embedded code snippet.
|
|
22
|
-
*/
|
|
23
|
-
const walkThroughSnippet = "walkThroughSnippet";
|
|
24
|
-
const http = "http";
|
|
25
|
-
const https = "https";
|
|
26
|
-
const file = "file";
|
|
27
|
-
const mailto = "mailto";
|
|
28
|
-
const untitled = "untitled";
|
|
29
|
-
const data = "data";
|
|
30
|
-
const command = "command";
|
|
31
|
-
const vscodeRemote = "vscode-remote";
|
|
32
|
-
const vscodeRemoteResource = "vscode-remote-resource";
|
|
33
|
-
const userData = "vscode-userdata";
|
|
34
|
-
const vscodeCustomEditor = "vscode-custom-editor";
|
|
35
|
-
const vscodeNotebook = "vscode-notebook";
|
|
36
|
-
const vscodeNotebookCell = "vscode-notebook-cell";
|
|
37
|
-
const vscodeSettings = "vscode-settings";
|
|
38
|
-
const webviewPanel = "webview-panel";
|
|
39
|
-
/**
|
|
40
|
-
* Scheme used for loading the wrapper html and script in webviews.
|
|
41
|
-
*/
|
|
42
|
-
const vscodeWebview = "vscode-webview";
|
|
43
|
-
/**
|
|
44
|
-
* Scheme used for loading resources inside of webviews.
|
|
45
|
-
*/
|
|
46
|
-
const vscodeWebviewResource = "vscode-webview-resource";
|
|
47
|
-
/**
|
|
48
|
-
* Scheme used for extension pages
|
|
49
|
-
*/
|
|
50
|
-
const extension = "extension";
|
|
51
|
-
}
|
|
52
|
-
declare class RemoteAuthoritiesImpl {
|
|
53
|
-
private readonly _hosts;
|
|
54
|
-
private readonly _ports;
|
|
55
|
-
private readonly _connectionTokens;
|
|
56
|
-
private _preferredWebSchema;
|
|
57
|
-
private _delegate;
|
|
58
|
-
setPreferredWebSchema(schema: 'http' | 'https'): void;
|
|
59
|
-
setDelegate(delegate: (uri: URI) => URI): void;
|
|
60
|
-
set(authority: string, host: string, port: number): void;
|
|
61
|
-
setConnectionToken(authority: string, connectionToken: string): void;
|
|
62
|
-
rewrite(uri: URI): URI;
|
|
63
|
-
}
|
|
64
|
-
export declare const RemoteAuthorities: RemoteAuthoritiesImpl;
|
|
65
|
-
export {};
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*---------------------------------------------------------------------------------------------
|
|
3
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
5
|
-
*--------------------------------------------------------------------------------------------*/
|
|
6
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
-
if (k2 === undefined) k2 = k;
|
|
8
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.RemoteAuthorities = exports.Schemas = void 0;
|
|
27
|
-
const uri_1 = require("vs/base/common/uri");
|
|
28
|
-
const platform = __importStar(require("vs/base/common/platform"));
|
|
29
|
-
var Schemas;
|
|
30
|
-
(function (Schemas) {
|
|
31
|
-
/**
|
|
32
|
-
* A schema that is used for models that exist in memory
|
|
33
|
-
* only and that have no correspondence on a server or such.
|
|
34
|
-
*/
|
|
35
|
-
Schemas.inMemory = 'inmemory';
|
|
36
|
-
/**
|
|
37
|
-
* A schema that is used for setting files
|
|
38
|
-
*/
|
|
39
|
-
Schemas.vscode = 'vscode';
|
|
40
|
-
/**
|
|
41
|
-
* A schema that is used for internal private files
|
|
42
|
-
*/
|
|
43
|
-
Schemas.internal = 'private';
|
|
44
|
-
/**
|
|
45
|
-
* A walk-through document.
|
|
46
|
-
*/
|
|
47
|
-
Schemas.walkThrough = 'walkThrough';
|
|
48
|
-
/**
|
|
49
|
-
* An embedded code snippet.
|
|
50
|
-
*/
|
|
51
|
-
Schemas.walkThroughSnippet = 'walkThroughSnippet';
|
|
52
|
-
Schemas.http = 'http';
|
|
53
|
-
Schemas.https = 'https';
|
|
54
|
-
Schemas.file = 'file';
|
|
55
|
-
Schemas.mailto = 'mailto';
|
|
56
|
-
Schemas.untitled = 'untitled';
|
|
57
|
-
Schemas.data = 'data';
|
|
58
|
-
Schemas.command = 'command';
|
|
59
|
-
Schemas.vscodeRemote = 'vscode-remote';
|
|
60
|
-
Schemas.vscodeRemoteResource = 'vscode-remote-resource';
|
|
61
|
-
Schemas.userData = 'vscode-userdata';
|
|
62
|
-
Schemas.vscodeCustomEditor = 'vscode-custom-editor';
|
|
63
|
-
Schemas.vscodeNotebook = 'vscode-notebook';
|
|
64
|
-
Schemas.vscodeNotebookCell = 'vscode-notebook-cell';
|
|
65
|
-
Schemas.vscodeSettings = 'vscode-settings';
|
|
66
|
-
Schemas.webviewPanel = 'webview-panel';
|
|
67
|
-
/**
|
|
68
|
-
* Scheme used for loading the wrapper html and script in webviews.
|
|
69
|
-
*/
|
|
70
|
-
Schemas.vscodeWebview = 'vscode-webview';
|
|
71
|
-
/**
|
|
72
|
-
* Scheme used for loading resources inside of webviews.
|
|
73
|
-
*/
|
|
74
|
-
Schemas.vscodeWebviewResource = 'vscode-webview-resource';
|
|
75
|
-
/**
|
|
76
|
-
* Scheme used for extension pages
|
|
77
|
-
*/
|
|
78
|
-
Schemas.extension = 'extension';
|
|
79
|
-
})(Schemas = exports.Schemas || (exports.Schemas = {}));
|
|
80
|
-
class RemoteAuthoritiesImpl {
|
|
81
|
-
constructor() {
|
|
82
|
-
this._hosts = Object.create(null);
|
|
83
|
-
this._ports = Object.create(null);
|
|
84
|
-
this._connectionTokens = Object.create(null);
|
|
85
|
-
this._preferredWebSchema = 'http';
|
|
86
|
-
this._delegate = null;
|
|
87
|
-
}
|
|
88
|
-
setPreferredWebSchema(schema) {
|
|
89
|
-
this._preferredWebSchema = schema;
|
|
90
|
-
}
|
|
91
|
-
setDelegate(delegate) {
|
|
92
|
-
this._delegate = delegate;
|
|
93
|
-
}
|
|
94
|
-
set(authority, host, port) {
|
|
95
|
-
this._hosts[authority] = host;
|
|
96
|
-
this._ports[authority] = port;
|
|
97
|
-
}
|
|
98
|
-
setConnectionToken(authority, connectionToken) {
|
|
99
|
-
this._connectionTokens[authority] = connectionToken;
|
|
100
|
-
}
|
|
101
|
-
rewrite(uri) {
|
|
102
|
-
if (this._delegate) {
|
|
103
|
-
return this._delegate(uri);
|
|
104
|
-
}
|
|
105
|
-
const authority = uri.authority;
|
|
106
|
-
let host = this._hosts[authority];
|
|
107
|
-
if (host && host.indexOf(':') !== -1) {
|
|
108
|
-
host = `[${host}]`;
|
|
109
|
-
}
|
|
110
|
-
const port = this._ports[authority];
|
|
111
|
-
const connectionToken = this._connectionTokens[authority];
|
|
112
|
-
let query = `path=${encodeURIComponent(uri.path)}`;
|
|
113
|
-
if (typeof connectionToken === 'string') {
|
|
114
|
-
query += `&tkn=${encodeURIComponent(connectionToken)}`;
|
|
115
|
-
}
|
|
116
|
-
return uri_1.URI.from({
|
|
117
|
-
scheme: platform.isWeb ? this._preferredWebSchema : Schemas.vscodeRemoteResource,
|
|
118
|
-
authority: `${host}:${port}`,
|
|
119
|
-
path: `/vscode-remote-resource`,
|
|
120
|
-
query
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
exports.RemoteAuthorities = new RemoteAuthoritiesImpl();
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
export interface ParsedPath {
|
|
2
|
-
root: string;
|
|
3
|
-
dir: string;
|
|
4
|
-
base: string;
|
|
5
|
-
ext: string;
|
|
6
|
-
name: string;
|
|
7
|
-
}
|
|
8
|
-
export interface IPath {
|
|
9
|
-
normalize(path: string): string;
|
|
10
|
-
isAbsolute(path: string): boolean;
|
|
11
|
-
join(...paths: string[]): string;
|
|
12
|
-
resolve(...pathSegments: string[]): string;
|
|
13
|
-
relative(from: string, to: string): string;
|
|
14
|
-
dirname(path: string): string;
|
|
15
|
-
basename(path: string, ext?: string): string;
|
|
16
|
-
extname(path: string): string;
|
|
17
|
-
format(pathObject: ParsedPath): string;
|
|
18
|
-
parse(path: string): ParsedPath;
|
|
19
|
-
toNamespacedPath(path: string): string;
|
|
20
|
-
sep: '\\' | '/';
|
|
21
|
-
delimiter: string;
|
|
22
|
-
win32: IPath | null;
|
|
23
|
-
posix: IPath | null;
|
|
24
|
-
}
|
|
25
|
-
export declare const win32: IPath;
|
|
26
|
-
export declare const posix: IPath;
|
|
27
|
-
export declare const normalize: (path: string) => string;
|
|
28
|
-
export declare const isAbsolute: (path: string) => boolean;
|
|
29
|
-
export declare const join: (...paths: string[]) => string;
|
|
30
|
-
export declare const resolve: (...pathSegments: string[]) => string;
|
|
31
|
-
export declare const relative: (from: string, to: string) => string;
|
|
32
|
-
export declare const dirname: (path: string) => string;
|
|
33
|
-
export declare const basename: (path: string, ext?: string) => string;
|
|
34
|
-
export declare const extname: (path: string) => string;
|
|
35
|
-
export declare const format: (pathObject: ParsedPath) => string;
|
|
36
|
-
export declare const parse: (path: string) => ParsedPath;
|
|
37
|
-
export declare const toNamespacedPath: (path: string) => string;
|
|
38
|
-
export declare const sep: "/" | "\\";
|
|
39
|
-
export declare const delimiter: string;
|