custom-electron-titlebar 3.2.6 → 3.2.10
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/.github/FUNDING.yml +1 -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 +0 -0
- package/{lib → build}/browser/browser.js.map +0 -0
- package/{lib → build}/browser/event.d.ts +0 -0
- package/{lib → build}/browser/event.js +2 -1
- package/{lib → build}/browser/event.js.map +1 -1
- package/{lib → build}/browser/iframe.d.ts +0 -0
- package/{lib → build}/browser/iframe.js +0 -0
- package/{lib → build}/browser/iframe.js.map +0 -0
- package/{lib → build}/browser/keyboardEvent.d.ts +0 -0
- package/{lib → build}/browser/keyboardEvent.js +0 -0
- package/{lib → build}/browser/keyboardEvent.js.map +0 -0
- package/{lib → build}/browser/mouseEvent.d.ts +0 -0
- package/{lib → build}/browser/mouseEvent.js +0 -0
- package/{lib → build}/browser/mouseEvent.js.map +0 -0
- package/{lib → build}/common/arrays.d.ts +0 -0
- package/{lib → build}/common/arrays.js +0 -0
- package/{lib → build}/common/arrays.js.map +0 -0
- package/{lib → build}/common/async.d.ts +0 -0
- package/{lib → build}/common/async.js +0 -0
- package/{lib → build}/common/async.js.map +0 -0
- package/{lib → build}/common/charCode.d.ts +0 -0
- package/{lib → build}/common/charCode.js +0 -0
- package/{lib → build}/common/charCode.js.map +0 -0
- package/{lib → build}/common/color.d.ts +0 -0
- package/{lib → build}/common/color.js +0 -0
- package/{lib → build}/common/color.js.map +0 -0
- package/{lib → build}/common/dom.d.ts +0 -0
- package/{lib → build}/common/dom.js +16 -14
- package/build/common/dom.js.map +1 -0
- package/{lib → build}/common/event.d.ts +0 -0
- package/{lib → build}/common/event.js +1 -1
- package/build/common/event.js.map +1 -0
- package/{lib → build}/common/iterator.d.ts +0 -0
- package/{lib → build}/common/iterator.js +0 -0
- package/{lib → build}/common/iterator.js.map +0 -0
- package/{lib → build}/common/keyCodes.d.ts +0 -0
- package/{lib → build}/common/keyCodes.js +0 -0
- package/{lib → build}/common/keyCodes.js.map +0 -0
- package/{lib → build}/common/lifecycle.d.ts +0 -0
- package/{lib → build}/common/lifecycle.js +0 -0
- package/{lib → build}/common/lifecycle.js.map +0 -0
- package/{lib → build}/common/linkedList.d.ts +0 -0
- package/{lib → build}/common/linkedList.js +0 -0
- package/{lib → build}/common/linkedList.js.map +0 -0
- package/{lib → build}/common/platform.d.ts +0 -0
- package/{lib → build}/common/platform.js +0 -0
- package/{lib → build}/common/platform.js.map +0 -0
- package/{lib → build}/index.d.ts +0 -0
- package/{lib → build}/index.js +0 -0
- package/{lib → build}/index.js.map +0 -0
- package/{lib → build}/menu/menu.d.ts +0 -0
- package/{lib → build}/menu/menu.js +38 -38
- package/build/menu/menu.js.map +1 -0
- package/{lib → build}/menu/menuitem.d.ts +10 -2
- package/{lib → build}/menu/menuitem.js +70 -34
- package/build/menu/menuitem.js.map +1 -0
- package/{lib → build}/menubar.d.ts +0 -0
- package/{lib → build}/menubar.js +29 -30
- package/build/menubar.js.map +1 -0
- package/{lib → build}/themebar.d.ts +0 -0
- package/{lib → build}/themebar.js +2 -2
- package/build/themebar.js.map +1 -0
- package/{lib → build}/titlebar.d.ts +0 -0
- package/{lib → build}/titlebar.js +61 -58
- package/build/titlebar.js.map +1 -0
- package/package.json +13 -7
- package/lib/common/dom.js.map +0 -1
- package/lib/common/enableNativeMenuCommands.d.ts +0 -1
- package/lib/common/enableNativeMenuCommands.js +0 -32
- package/lib/common/enableNativeMenuCommands.js.map +0 -1
- package/lib/common/event.js.map +0 -1
- package/lib/main.d.ts +0 -1
- package/lib/main.js +0 -14
- package/lib/main.js.map +0 -1
- package/lib/menu/menu.js.map +0 -1
- package/lib/menu/menuitem.js.map +0 -1
- package/lib/menubar.js.map +0 -1
- package/lib/themebar.js.map +0 -1
- package/lib/titlebar.js.map +0 -1
- package/lib/vs/base/browser/browser.js +0 -150
- package/lib/vs/base/browser/canIUse.js +0 -58
- package/lib/vs/base/browser/codicons.js +0 -37
- package/lib/vs/base/browser/contextmenu.js +0 -9
- package/lib/vs/base/browser/dnd.js +0 -113
- package/lib/vs/base/browser/dom.js +0 -1417
- package/lib/vs/base/browser/event.js +0 -36
- package/lib/vs/base/browser/fastDomNode.js +0 -265
- package/lib/vs/base/browser/formattedTextRenderer.js +0 -248
- package/lib/vs/base/browser/globalMouseMoveMonitor.js +0 -137
- package/lib/vs/base/browser/history.js +0 -9
- package/lib/vs/base/browser/iframe.js +0 -126
- package/lib/vs/base/browser/keyboardEvent.js +0 -599
- package/lib/vs/base/browser/mouseEvent.js +0 -155
- package/lib/vs/base/browser/touch.js +0 -315
- package/lib/vs/base/browser/ui/actionbar/actionViewItems.js +0 -397
- package/lib/vs/base/browser/ui/actionbar/actionbar.js +0 -583
- package/lib/vs/base/browser/ui/checkbox/checkbox.js +0 -251
- package/lib/vs/base/browser/ui/codicons/codiconLabel.js +0 -31
- package/lib/vs/base/browser/ui/codicons/codiconStyles.js +0 -47
- package/lib/vs/base/browser/ui/contextview/contextview.js +0 -367
- package/lib/vs/base/browser/ui/dropdown/dropdown.js +0 -256
- package/lib/vs/base/browser/ui/dropdown/dropdownActionViewItem.js +0 -120
- package/lib/vs/base/browser/ui/keybindingLabel/keybindingLabel.js +0 -118
- package/lib/vs/base/browser/ui/list/list.js +0 -54
- package/lib/vs/base/browser/ui/list/listPaging.js +0 -322
- package/lib/vs/base/browser/ui/list/listView.js +0 -1388
- package/lib/vs/base/browser/ui/list/listWidget.js +0 -1709
- package/lib/vs/base/browser/ui/list/rangeMap.js +0 -223
- package/lib/vs/base/browser/ui/list/rowCache.js +0 -113
- package/lib/vs/base/browser/ui/list/splice.js +0 -23
- package/lib/vs/base/browser/ui/menu/menu.js +0 -1371
- package/lib/vs/base/browser/ui/menu/menubar.js +0 -1139
- package/lib/vs/base/browser/ui/scrollbar/abstractScrollbar.js +0 -278
- package/lib/vs/base/browser/ui/scrollbar/horizontalScrollbar.js +0 -115
- package/lib/vs/base/browser/ui/scrollbar/scrollableElement.js +0 -646
- package/lib/vs/base/browser/ui/scrollbar/scrollableElementOptions.js +0 -9
- package/lib/vs/base/browser/ui/scrollbar/scrollbarArrow.js +0 -106
- package/lib/vs/base/browser/ui/scrollbar/scrollbarState.js +0 -184
- package/lib/vs/base/browser/ui/scrollbar/scrollbarVisibilityController.js +0 -116
- package/lib/vs/base/browser/ui/scrollbar/verticalScrollbar.js +0 -114
- package/lib/vs/base/browser/ui/selectBox/selectBox.js +0 -85
- package/lib/vs/base/browser/ui/selectBox/selectBoxCustom.js +0 -985
- package/lib/vs/base/browser/ui/selectBox/selectBoxNative.js +0 -188
- package/lib/vs/base/browser/ui/toolbar/toolbar.js +0 -206
- package/lib/vs/base/browser/ui/widget.js +0 -69
- package/lib/vs/base/common/actions.js +0 -224
- package/lib/vs/base/common/amd.js +0 -31
- package/lib/vs/base/common/arrays.js +0 -641
- package/lib/vs/base/common/assert.js +0 -21
- package/lib/vs/base/common/async.js +0 -966
- package/lib/vs/base/common/buffer.js +0 -250
- package/lib/vs/base/common/cache.js +0 -40
- package/lib/vs/base/common/cancellation.js +0 -146
- package/lib/vs/base/common/charCode.js +0 -9
- package/lib/vs/base/common/codicon.js +0 -136
- package/lib/vs/base/common/codicons.js +0 -1378
- package/lib/vs/base/common/collections.js +0 -133
- package/lib/vs/base/common/color.js +0 -716
- package/lib/vs/base/common/comparers.js +0 -280
- package/lib/vs/base/common/console.js +0 -142
- package/lib/vs/base/common/date.js +0 -113
- package/lib/vs/base/common/decorators.js +0 -169
- package/lib/vs/base/common/errorMessage.js +0 -93
- package/lib/vs/base/common/errors.js +0 -213
- package/lib/vs/base/common/errorsWithActions.js +0 -28
- package/lib/vs/base/common/event.js +0 -873
- package/lib/vs/base/common/extpath.js +0 -401
- package/lib/vs/base/common/filters.js +0 -948
- package/lib/vs/base/common/functional.js +0 -28
- package/lib/vs/base/common/fuzzyScorer.js +0 -811
- package/lib/vs/base/common/glob.js +0 -696
- package/lib/vs/base/common/hash.js +0 -359
- package/lib/vs/base/common/history.js +0 -116
- package/lib/vs/base/common/htmlContent.js +0 -162
- package/lib/vs/base/common/idGenerator.js +0 -25
- package/lib/vs/base/common/iterator.js +0 -118
- package/lib/vs/base/common/json.js +0 -1624
- package/lib/vs/base/common/jsonEdit.js +0 -272
- package/lib/vs/base/common/jsonErrorMessages.js +0 -69
- package/lib/vs/base/common/jsonFormatter.js +0 -316
- package/lib/vs/base/common/jsonSchema.js +0 -9
- package/lib/vs/base/common/keyCodes.js +0 -591
- package/lib/vs/base/common/keybindingLabels.js +0 -231
- package/lib/vs/base/common/keybindingParser.js +0 -142
- package/lib/vs/base/common/labels.js +0 -430
- package/lib/vs/base/common/lazy.js +0 -71
- package/lib/vs/base/common/lifecycle.js +0 -308
- package/lib/vs/base/common/linkedList.js +0 -152
- package/lib/vs/base/common/linkedText.js +0 -73
- package/lib/vs/base/common/map.js +0 -1108
- package/lib/vs/base/common/marshalling.js +0 -80
- package/lib/vs/base/common/mime.js +0 -321
- package/lib/vs/base/common/navigator.js +0 -50
- package/lib/vs/base/common/network.js +0 -160
- package/lib/vs/base/common/normalization.js +0 -78
- package/lib/vs/base/common/numbers.js +0 -55
- package/lib/vs/base/common/objects.js +0 -268
- package/lib/vs/base/common/paging.js +0 -190
- package/lib/vs/base/common/parsers.js +0 -78
- package/lib/vs/base/common/path.js +0 -1550
- package/lib/vs/base/common/platform.js +0 -245
- package/lib/vs/base/common/process.js +0 -52
- package/lib/vs/base/common/processes.js +0 -32
- package/lib/vs/base/common/range.js +0 -79
- package/lib/vs/base/common/resourceTree.js +0 -185
- package/lib/vs/base/common/resources.js +0 -421
- package/lib/vs/base/common/scanCode.js +0 -1472
- package/lib/vs/base/common/scrollable.js +0 -397
- package/lib/vs/base/common/search.js +0 -55
- package/lib/vs/base/common/sequence.js +0 -64
- package/lib/vs/base/common/severity.js +0 -55
- package/lib/vs/base/common/skipList.js +0 -234
- package/lib/vs/base/common/stopwatch.js +0 -45
- package/lib/vs/base/common/stream.js +0 -418
- package/lib/vs/base/common/strings.js +0 -1283
- package/lib/vs/base/common/styler.js +0 -9
- package/lib/vs/base/common/types.js +0 -296
- package/lib/vs/base/common/uint.js +0 -46
- package/lib/vs/base/common/uri.js +0 -756
- package/lib/vs/base/common/uriIpc.js +0 -154
- package/lib/vs/base/common/uuid.js +0 -70
- package/lib/vs/nls.mock.js +0 -31
- package/lib/vs/platform/actions/browser/menuEntryActionViewItem.js +0 -342
- package/lib/vs/platform/actions/common/actions.js +0 -456
- package/lib/vs/platform/actions/common/menuService.js +0 -194
- package/lib/vs/platform/clipboard/browser/clipboardService.js +0 -99
- package/lib/vs/platform/clipboard/common/clipboardService.js +0 -14
- package/lib/vs/platform/contextkey/common/contextkey.js +0 -1210
- package/lib/vs/platform/contextkey/common/contextkeys.js +0 -23
- package/lib/vs/platform/contextview/browser/contextView.js +0 -15
- package/lib/vs/platform/contextview/browser/contextViewService.js +0 -96
- package/lib/vs/platform/environment/common/argv.js +0 -9
- package/lib/vs/platform/environment/common/environment.js +0 -15
- package/lib/vs/platform/instantiation/common/descriptors.js +0 -25
- package/lib/vs/platform/instantiation/common/extensions.js +0 -26
- package/lib/vs/platform/instantiation/common/graph.js +0 -93
- package/lib/vs/platform/instantiation/common/instantiation.js +0 -84
- package/lib/vs/platform/instantiation/common/instantiationService.js +0 -361
- package/lib/vs/platform/instantiation/common/serviceCollection.js +0 -39
- package/lib/vs/platform/keybinding/common/baseResolvedKeybinding.js +0 -73
- package/lib/vs/platform/keybinding/common/keybinding.js +0 -14
- package/lib/vs/platform/keybinding/common/keybindingResolver.js +0 -391
- package/lib/vs/platform/keybinding/common/keybindingsRegistry.js +0 -229
- package/lib/vs/platform/keybinding/common/resolvedKeybindingItem.js +0 -47
- package/lib/vs/platform/keybinding/common/usLayoutResolvedKeybinding.js +0 -160
- package/lib/vs/platform/layout/browser/layoutService.js +0 -14
- package/lib/vs/platform/menubar/common/menubar.js +0 -34
- package/lib/vs/platform/registry/common/platform.js +0 -38
- package/lib/vs/platform/theme/browser/checkbox.js +0 -32
- package/lib/vs/platform/theme/common/colorRegistry.js +0 -1154
- package/lib/vs/platform/theme/common/styler.js +0 -290
- package/lib/vs/platform/theme/common/theme.js +0 -21
- package/lib/vs/platform/theme/common/themeService.js +0 -176
- package/lib/vs/platform/theme/common/tokenClassificationRegistry.js +0 -540
- package/lib/vs/platform/theme/test/common/testThemeService.js +0 -98
|
@@ -1,245 +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
|
-
|
|
7
|
-
var _a;
|
|
8
|
-
|
|
9
|
-
Object.defineProperty(exports, "__esModule", {
|
|
10
|
-
value: true
|
|
11
|
-
});
|
|
12
|
-
exports.isLittleEndian = exports.OS = exports.setImmediate = exports.globals = exports.translationsConfigFile = exports.locale = exports.Language = exports.language = exports.isRootUser = exports.userAgent = exports.platform = exports.isIOS = exports.isWeb = exports.isNative = exports.isLinux = exports.isMacintosh = exports.isWindows = exports.PlatformToString = void 0;
|
|
13
|
-
const LANGUAGE_DEFAULT = 'en';
|
|
14
|
-
let _isWindows = false;
|
|
15
|
-
let _isMacintosh = false;
|
|
16
|
-
let _isLinux = false;
|
|
17
|
-
let _isNative = false;
|
|
18
|
-
let _isWeb = false;
|
|
19
|
-
let _isIOS = false;
|
|
20
|
-
let _locale = undefined;
|
|
21
|
-
let _language = LANGUAGE_DEFAULT;
|
|
22
|
-
let _translationsConfigFile = undefined;
|
|
23
|
-
let _userAgent = undefined;
|
|
24
|
-
|
|
25
|
-
const _globals = typeof self === 'object' ? self : typeof global === 'object' ? global : {};
|
|
26
|
-
|
|
27
|
-
let nodeProcess = undefined;
|
|
28
|
-
|
|
29
|
-
if (typeof process !== 'undefined') {
|
|
30
|
-
// Native environment (non-sandboxed)
|
|
31
|
-
nodeProcess = process;
|
|
32
|
-
} else if (typeof _globals.vscode !== 'undefined') {
|
|
33
|
-
// Native envionment (sandboxed)
|
|
34
|
-
nodeProcess = _globals.vscode.process;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const isElectronRenderer = typeof ((_a = nodeProcess === null || nodeProcess === void 0 ? void 0 : nodeProcess.versions) === null || _a === void 0 ? void 0 : _a.electron) === 'string' && nodeProcess.type === 'renderer'; // Web environment
|
|
38
|
-
|
|
39
|
-
if (typeof navigator === 'object' && !isElectronRenderer) {
|
|
40
|
-
_userAgent = navigator.userAgent;
|
|
41
|
-
_isWindows = _userAgent.indexOf('Windows') >= 0;
|
|
42
|
-
_isMacintosh = _userAgent.indexOf('Macintosh') >= 0;
|
|
43
|
-
_isIOS = (_userAgent.indexOf('Macintosh') >= 0 || _userAgent.indexOf('iPad') >= 0 || _userAgent.indexOf('iPhone') >= 0) && !!navigator.maxTouchPoints && navigator.maxTouchPoints > 0;
|
|
44
|
-
_isLinux = _userAgent.indexOf('Linux') >= 0;
|
|
45
|
-
_isWeb = true;
|
|
46
|
-
_locale = navigator.language;
|
|
47
|
-
_language = _locale;
|
|
48
|
-
} // Native environment
|
|
49
|
-
else if (typeof nodeProcess === 'object') {
|
|
50
|
-
_isWindows = nodeProcess.platform === 'win32';
|
|
51
|
-
_isMacintosh = nodeProcess.platform === 'darwin';
|
|
52
|
-
_isLinux = nodeProcess.platform === 'linux';
|
|
53
|
-
_locale = LANGUAGE_DEFAULT;
|
|
54
|
-
_language = LANGUAGE_DEFAULT;
|
|
55
|
-
const rawNlsConfig = nodeProcess.env['VSCODE_NLS_CONFIG'];
|
|
56
|
-
|
|
57
|
-
if (rawNlsConfig) {
|
|
58
|
-
try {
|
|
59
|
-
const nlsConfig = JSON.parse(rawNlsConfig);
|
|
60
|
-
const resolved = nlsConfig.availableLanguages['*'];
|
|
61
|
-
_locale = nlsConfig.locale; // VSCode's default language is 'en'
|
|
62
|
-
|
|
63
|
-
_language = resolved ? resolved : LANGUAGE_DEFAULT;
|
|
64
|
-
_translationsConfigFile = nlsConfig._translationsConfigFile;
|
|
65
|
-
} catch (e) {}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
_isNative = true;
|
|
69
|
-
} // Unknown environment
|
|
70
|
-
else {
|
|
71
|
-
console.error('Unable to resolve platform.');
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
function PlatformToString(platform) {
|
|
75
|
-
switch (platform) {
|
|
76
|
-
case 0
|
|
77
|
-
/* Web */
|
|
78
|
-
:
|
|
79
|
-
return 'Web';
|
|
80
|
-
|
|
81
|
-
case 1
|
|
82
|
-
/* Mac */
|
|
83
|
-
:
|
|
84
|
-
return 'Mac';
|
|
85
|
-
|
|
86
|
-
case 2
|
|
87
|
-
/* Linux */
|
|
88
|
-
:
|
|
89
|
-
return 'Linux';
|
|
90
|
-
|
|
91
|
-
case 3
|
|
92
|
-
/* Windows */
|
|
93
|
-
:
|
|
94
|
-
return 'Windows';
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
exports.PlatformToString = PlatformToString;
|
|
99
|
-
let _platform = 0
|
|
100
|
-
/* Web */
|
|
101
|
-
;
|
|
102
|
-
|
|
103
|
-
if (_isMacintosh) {
|
|
104
|
-
_platform = 1
|
|
105
|
-
/* Mac */
|
|
106
|
-
;
|
|
107
|
-
} else if (_isWindows) {
|
|
108
|
-
_platform = 3
|
|
109
|
-
/* Windows */
|
|
110
|
-
;
|
|
111
|
-
} else if (_isLinux) {
|
|
112
|
-
_platform = 2
|
|
113
|
-
/* Linux */
|
|
114
|
-
;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
exports.isWindows = _isWindows;
|
|
118
|
-
exports.isMacintosh = _isMacintosh;
|
|
119
|
-
exports.isLinux = _isLinux;
|
|
120
|
-
exports.isNative = _isNative;
|
|
121
|
-
exports.isWeb = _isWeb;
|
|
122
|
-
exports.isIOS = _isIOS;
|
|
123
|
-
exports.platform = _platform;
|
|
124
|
-
exports.userAgent = _userAgent;
|
|
125
|
-
|
|
126
|
-
function isRootUser() {
|
|
127
|
-
return !!nodeProcess && !_isWindows && nodeProcess.getuid() === 0;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
exports.isRootUser = isRootUser;
|
|
131
|
-
/**
|
|
132
|
-
* The language used for the user interface. The format of
|
|
133
|
-
* the string is all lower case (e.g. zh-tw for Traditional
|
|
134
|
-
* Chinese)
|
|
135
|
-
*/
|
|
136
|
-
|
|
137
|
-
exports.language = _language;
|
|
138
|
-
var Language;
|
|
139
|
-
|
|
140
|
-
(function (Language) {
|
|
141
|
-
function value() {
|
|
142
|
-
return exports.language;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
Language.value = value;
|
|
146
|
-
|
|
147
|
-
function isDefaultVariant() {
|
|
148
|
-
if (exports.language.length === 2) {
|
|
149
|
-
return exports.language === 'en';
|
|
150
|
-
} else if (exports.language.length >= 3) {
|
|
151
|
-
return exports.language[0] === 'e' && exports.language[1] === 'n' && exports.language[2] === '-';
|
|
152
|
-
} else {
|
|
153
|
-
return false;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
Language.isDefaultVariant = isDefaultVariant;
|
|
158
|
-
|
|
159
|
-
function isDefault() {
|
|
160
|
-
return exports.language === 'en';
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
Language.isDefault = isDefault;
|
|
164
|
-
})(Language = exports.Language || (exports.Language = {}));
|
|
165
|
-
/**
|
|
166
|
-
* The OS locale or the locale specified by --locale. The format of
|
|
167
|
-
* the string is all lower case (e.g. zh-tw for Traditional
|
|
168
|
-
* Chinese). The UI is not necessarily shown in the provided locale.
|
|
169
|
-
*/
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
exports.locale = _locale;
|
|
173
|
-
/**
|
|
174
|
-
* The translatios that are available through language packs.
|
|
175
|
-
*/
|
|
176
|
-
|
|
177
|
-
exports.translationsConfigFile = _translationsConfigFile;
|
|
178
|
-
exports.globals = _globals;
|
|
179
|
-
|
|
180
|
-
exports.setImmediate = function defineSetImmediate() {
|
|
181
|
-
if (exports.globals.setImmediate) {
|
|
182
|
-
return exports.globals.setImmediate.bind(exports.globals);
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
if (typeof exports.globals.postMessage === 'function' && !exports.globals.importScripts) {
|
|
186
|
-
let pending = [];
|
|
187
|
-
exports.globals.addEventListener('message', e => {
|
|
188
|
-
if (e.data && e.data.vscodeSetImmediateId) {
|
|
189
|
-
for (let i = 0, len = pending.length; i < len; i++) {
|
|
190
|
-
const candidate = pending[i];
|
|
191
|
-
|
|
192
|
-
if (candidate.id === e.data.vscodeSetImmediateId) {
|
|
193
|
-
pending.splice(i, 1);
|
|
194
|
-
candidate.callback();
|
|
195
|
-
return;
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
});
|
|
200
|
-
let lastId = 0;
|
|
201
|
-
return callback => {
|
|
202
|
-
const myId = ++lastId;
|
|
203
|
-
pending.push({
|
|
204
|
-
id: myId,
|
|
205
|
-
callback: callback
|
|
206
|
-
});
|
|
207
|
-
exports.globals.postMessage({
|
|
208
|
-
vscodeSetImmediateId: myId
|
|
209
|
-
}, '*');
|
|
210
|
-
};
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
if (nodeProcess) {
|
|
214
|
-
return nodeProcess.nextTick.bind(nodeProcess);
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
const _promise = Promise.resolve();
|
|
218
|
-
|
|
219
|
-
return callback => _promise.then(callback);
|
|
220
|
-
}();
|
|
221
|
-
|
|
222
|
-
exports.OS = _isMacintosh || _isIOS ? 2
|
|
223
|
-
/* Macintosh */
|
|
224
|
-
: _isWindows ? 1
|
|
225
|
-
/* Windows */
|
|
226
|
-
: 3
|
|
227
|
-
/* Linux */
|
|
228
|
-
;
|
|
229
|
-
let _isLittleEndian = true;
|
|
230
|
-
let _isLittleEndianComputed = false;
|
|
231
|
-
|
|
232
|
-
function isLittleEndian() {
|
|
233
|
-
if (!_isLittleEndianComputed) {
|
|
234
|
-
_isLittleEndianComputed = true;
|
|
235
|
-
const test = new Uint8Array(2);
|
|
236
|
-
test[0] = 1;
|
|
237
|
-
test[1] = 2;
|
|
238
|
-
const view = new Uint16Array(test.buffer);
|
|
239
|
-
_isLittleEndian = view[0] === (2 << 8) + 1;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
return _isLittleEndian;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
exports.isLittleEndian = isLittleEndian;
|
|
@@ -1,52 +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
|
-
|
|
7
|
-
Object.defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
exports.nextTick = exports.platform = exports.env = exports.cwd = void 0;
|
|
11
|
-
|
|
12
|
-
const platform_1 = require("./platform");
|
|
13
|
-
|
|
14
|
-
let safeProcess; // Native node.js environment
|
|
15
|
-
|
|
16
|
-
if (typeof process !== 'undefined') {
|
|
17
|
-
safeProcess = process;
|
|
18
|
-
} // Native sandbox environment
|
|
19
|
-
else if (typeof platform_1.globals.vscode !== 'undefined') {
|
|
20
|
-
safeProcess = platform_1.globals.vscode.process;
|
|
21
|
-
} // Web environment
|
|
22
|
-
else {
|
|
23
|
-
safeProcess = {
|
|
24
|
-
// Supported
|
|
25
|
-
get platform() {
|
|
26
|
-
return platform_1.isWindows ? 'win32' : platform_1.isMacintosh ? 'darwin' : 'linux';
|
|
27
|
-
},
|
|
28
|
-
|
|
29
|
-
nextTick(callback) {
|
|
30
|
-
return platform_1.setImmediate(callback);
|
|
31
|
-
},
|
|
32
|
-
|
|
33
|
-
// Unsupported
|
|
34
|
-
get env() {
|
|
35
|
-
return Object.create(null);
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
cwd() {
|
|
39
|
-
return '/';
|
|
40
|
-
},
|
|
41
|
-
|
|
42
|
-
getuid() {
|
|
43
|
-
return -1;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
exports.cwd = safeProcess.cwd;
|
|
50
|
-
exports.env = safeProcess.env;
|
|
51
|
-
exports.platform = safeProcess.platform;
|
|
52
|
-
exports.nextTick = safeProcess.nextTick;
|
|
@@ -1,32 +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
|
-
|
|
7
|
-
Object.defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
exports.sanitizeProcessEnvironment = void 0;
|
|
11
|
-
/**
|
|
12
|
-
* Sanitizes a VS Code process environment by removing all Electron/VS Code-related values.
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
function sanitizeProcessEnvironment(env, ...preserve) {
|
|
16
|
-
const set = preserve.reduce((set, key) => {
|
|
17
|
-
set[key] = true;
|
|
18
|
-
return set;
|
|
19
|
-
}, {});
|
|
20
|
-
const keysToRemove = [/^ELECTRON_.+$/, /^GOOGLE_API_KEY$/, /^VSCODE_.+$/, /^SNAP(|_.*)$/];
|
|
21
|
-
const envKeys = Object.keys(env);
|
|
22
|
-
envKeys.filter(key => !set[key]).forEach(envKey => {
|
|
23
|
-
for (let i = 0; i < keysToRemove.length; i++) {
|
|
24
|
-
if (envKey.search(keysToRemove[i]) !== -1) {
|
|
25
|
-
delete env[envKey];
|
|
26
|
-
break;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
exports.sanitizeProcessEnvironment = sanitizeProcessEnvironment;
|
|
@@ -1,79 +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
|
-
|
|
7
|
-
Object.defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
exports.Range = void 0;
|
|
11
|
-
var Range;
|
|
12
|
-
|
|
13
|
-
(function (Range) {
|
|
14
|
-
/**
|
|
15
|
-
* Returns the intersection between two ranges as a range itself.
|
|
16
|
-
* Returns `{ start: 0, end: 0 }` if the intersection is empty.
|
|
17
|
-
*/
|
|
18
|
-
function intersect(one, other) {
|
|
19
|
-
if (one.start >= other.end || other.start >= one.end) {
|
|
20
|
-
return {
|
|
21
|
-
start: 0,
|
|
22
|
-
end: 0
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const start = Math.max(one.start, other.start);
|
|
27
|
-
const end = Math.min(one.end, other.end);
|
|
28
|
-
|
|
29
|
-
if (end - start <= 0) {
|
|
30
|
-
return {
|
|
31
|
-
start: 0,
|
|
32
|
-
end: 0
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
return {
|
|
37
|
-
start,
|
|
38
|
-
end
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
Range.intersect = intersect;
|
|
43
|
-
|
|
44
|
-
function isEmpty(range) {
|
|
45
|
-
return range.end - range.start <= 0;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
Range.isEmpty = isEmpty;
|
|
49
|
-
|
|
50
|
-
function intersects(one, other) {
|
|
51
|
-
return !isEmpty(intersect(one, other));
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
Range.intersects = intersects;
|
|
55
|
-
|
|
56
|
-
function relativeComplement(one, other) {
|
|
57
|
-
const result = [];
|
|
58
|
-
const first = {
|
|
59
|
-
start: one.start,
|
|
60
|
-
end: Math.min(other.start, one.end)
|
|
61
|
-
};
|
|
62
|
-
const second = {
|
|
63
|
-
start: Math.max(other.end, one.start),
|
|
64
|
-
end: one.end
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
if (!isEmpty(first)) {
|
|
68
|
-
result.push(first);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
if (!isEmpty(second)) {
|
|
72
|
-
result.push(second);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
return result;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
Range.relativeComplement = relativeComplement;
|
|
79
|
-
})(Range = exports.Range || (exports.Range = {}));
|
|
@@ -1,185 +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
|
-
|
|
7
|
-
var __decorate = this && this.__decorate || function (decorators, target, key, desc) {
|
|
8
|
-
var c = arguments.length,
|
|
9
|
-
r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
|
|
10
|
-
d;
|
|
11
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
12
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
Object.defineProperty(exports, "__esModule", {
|
|
16
|
-
value: true
|
|
17
|
-
});
|
|
18
|
-
exports.ResourceTree = void 0;
|
|
19
|
-
|
|
20
|
-
const decorators_1 = require("./decorators");
|
|
21
|
-
|
|
22
|
-
const paths = require("./path");
|
|
23
|
-
|
|
24
|
-
const resources_1 = require("./resources");
|
|
25
|
-
|
|
26
|
-
const uri_1 = require("./uri");
|
|
27
|
-
|
|
28
|
-
const map_1 = require("./map");
|
|
29
|
-
|
|
30
|
-
class Node {
|
|
31
|
-
constructor(uri, relativePath, context, element = undefined, parent = undefined) {
|
|
32
|
-
this.uri = uri;
|
|
33
|
-
this.relativePath = relativePath;
|
|
34
|
-
this.context = context;
|
|
35
|
-
this.element = element;
|
|
36
|
-
this.parent = parent;
|
|
37
|
-
this._children = new Map();
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
get childrenCount() {
|
|
41
|
-
return this._children.size;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
get children() {
|
|
45
|
-
return this._children.values();
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
get name() {
|
|
49
|
-
return paths.posix.basename(this.relativePath);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
get(path) {
|
|
53
|
-
return this._children.get(path);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
set(path, child) {
|
|
57
|
-
this._children.set(path, child);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
delete(path) {
|
|
61
|
-
this._children.delete(path);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
clear() {
|
|
65
|
-
this._children.clear();
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
__decorate([decorators_1.memoize], Node.prototype, "name", null);
|
|
71
|
-
|
|
72
|
-
function collect(node, result) {
|
|
73
|
-
if (typeof node.element !== 'undefined') {
|
|
74
|
-
result.push(node.element);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
for (const child of node.children) {
|
|
78
|
-
collect(child, result);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
return result;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
class ResourceTree {
|
|
85
|
-
constructor(context, rootURI = uri_1.URI.file('/')) {
|
|
86
|
-
this.root = new Node(rootURI, '', context);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
static getRoot(node) {
|
|
90
|
-
while (node.parent) {
|
|
91
|
-
node = node.parent;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
return node;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
static collect(node) {
|
|
98
|
-
return collect(node, []);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
static isResourceNode(obj) {
|
|
102
|
-
return obj instanceof Node;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
add(uri, element) {
|
|
106
|
-
const key = resources_1.relativePath(this.root.uri, uri) || uri.fsPath;
|
|
107
|
-
const iterator = new map_1.PathIterator(false).reset(key);
|
|
108
|
-
let node = this.root;
|
|
109
|
-
let path = '';
|
|
110
|
-
|
|
111
|
-
while (true) {
|
|
112
|
-
const name = iterator.value();
|
|
113
|
-
path = path + '/' + name;
|
|
114
|
-
let child = node.get(name);
|
|
115
|
-
|
|
116
|
-
if (!child) {
|
|
117
|
-
child = new Node(resources_1.joinPath(this.root.uri, path), path, this.root.context, iterator.hasNext() ? undefined : element, node);
|
|
118
|
-
node.set(name, child);
|
|
119
|
-
} else if (!iterator.hasNext()) {
|
|
120
|
-
child.element = element;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
node = child;
|
|
124
|
-
|
|
125
|
-
if (!iterator.hasNext()) {
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
iterator.next();
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
delete(uri) {
|
|
134
|
-
const key = resources_1.relativePath(this.root.uri, uri) || uri.fsPath;
|
|
135
|
-
const iterator = new map_1.PathIterator(false).reset(key);
|
|
136
|
-
return this._delete(this.root, iterator);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
_delete(node, iterator) {
|
|
140
|
-
const name = iterator.value();
|
|
141
|
-
const child = node.get(name);
|
|
142
|
-
|
|
143
|
-
if (!child) {
|
|
144
|
-
return undefined;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
if (iterator.hasNext()) {
|
|
148
|
-
const result = this._delete(child, iterator.next());
|
|
149
|
-
|
|
150
|
-
if (typeof result !== 'undefined' && child.childrenCount === 0) {
|
|
151
|
-
node.delete(name);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
return result;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
node.delete(name);
|
|
158
|
-
return child.element;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
clear() {
|
|
162
|
-
this.root.clear();
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
getNode(uri) {
|
|
166
|
-
const key = resources_1.relativePath(this.root.uri, uri) || uri.fsPath;
|
|
167
|
-
const iterator = new map_1.PathIterator(false).reset(key);
|
|
168
|
-
let node = this.root;
|
|
169
|
-
|
|
170
|
-
while (true) {
|
|
171
|
-
const name = iterator.value();
|
|
172
|
-
const child = node.get(name);
|
|
173
|
-
|
|
174
|
-
if (!child || !iterator.hasNext()) {
|
|
175
|
-
return child;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
node = child;
|
|
179
|
-
iterator.next();
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
exports.ResourceTree = ResourceTree;
|