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,540 +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.tokenStylingSchemaId = exports.getTokenClassificationRegistry = exports.parseClassifierString = exports.Extensions = exports.SemanticTokenRule = exports.TokenStyle = exports.fontStylePattern = exports.selectorPattern = exports.typeAndModifierIdPattern = exports.idPattern = exports.CLASSIFIER_MODIFIER_SEPARATOR = exports.TOKEN_CLASSIFIER_LANGUAGE_SEPARATOR = exports.TOKEN_TYPE_WILDCARD = void 0;
|
|
11
|
-
|
|
12
|
-
const platform = require("../../registry/common/platform");
|
|
13
|
-
|
|
14
|
-
const color_1 = require("../../../base/common/color");
|
|
15
|
-
|
|
16
|
-
const nls = require("../../../nls");
|
|
17
|
-
|
|
18
|
-
const event_1 = require("../../../base/common/event");
|
|
19
|
-
|
|
20
|
-
exports.TOKEN_TYPE_WILDCARD = '*';
|
|
21
|
-
exports.TOKEN_CLASSIFIER_LANGUAGE_SEPARATOR = ':';
|
|
22
|
-
exports.CLASSIFIER_MODIFIER_SEPARATOR = '.';
|
|
23
|
-
exports.idPattern = '\\w+[-_\\w+]*';
|
|
24
|
-
exports.typeAndModifierIdPattern = `^${exports.idPattern}$`;
|
|
25
|
-
exports.selectorPattern = `^(${exports.idPattern}|\\*)(\\${exports.CLASSIFIER_MODIFIER_SEPARATOR}${exports.idPattern})*(\\${exports.TOKEN_CLASSIFIER_LANGUAGE_SEPARATOR}${exports.idPattern})?$`;
|
|
26
|
-
exports.fontStylePattern = '^(\\s*(italic|bold|underline))*\\s*$';
|
|
27
|
-
|
|
28
|
-
class TokenStyle {
|
|
29
|
-
constructor(foreground, bold, underline, italic) {
|
|
30
|
-
this.foreground = foreground;
|
|
31
|
-
this.bold = bold;
|
|
32
|
-
this.underline = underline;
|
|
33
|
-
this.italic = italic;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
exports.TokenStyle = TokenStyle;
|
|
39
|
-
|
|
40
|
-
(function (TokenStyle) {
|
|
41
|
-
function toJSONObject(style) {
|
|
42
|
-
return {
|
|
43
|
-
_foreground: style.foreground === undefined ? null : color_1.Color.Format.CSS.formatHexA(style.foreground, true),
|
|
44
|
-
_bold: style.bold === undefined ? null : style.bold,
|
|
45
|
-
_underline: style.underline === undefined ? null : style.underline,
|
|
46
|
-
_italic: style.italic === undefined ? null : style.italic
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
TokenStyle.toJSONObject = toJSONObject;
|
|
51
|
-
|
|
52
|
-
function fromJSONObject(obj) {
|
|
53
|
-
if (obj) {
|
|
54
|
-
const boolOrUndef = b => typeof b === 'boolean' ? b : undefined;
|
|
55
|
-
|
|
56
|
-
const colorOrUndef = s => typeof s === 'string' ? color_1.Color.fromHex(s) : undefined;
|
|
57
|
-
|
|
58
|
-
return new TokenStyle(colorOrUndef(obj._foreground), boolOrUndef(obj._bold), boolOrUndef(obj._underline), boolOrUndef(obj._italic));
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
return undefined;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
TokenStyle.fromJSONObject = fromJSONObject;
|
|
65
|
-
|
|
66
|
-
function equals(s1, s2) {
|
|
67
|
-
if (s1 === s2) {
|
|
68
|
-
return true;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
return s1 !== undefined && s2 !== undefined && (s1.foreground instanceof color_1.Color ? s1.foreground.equals(s2.foreground) : s2.foreground === undefined) && s1.bold === s2.bold && s1.underline === s2.underline && s1.italic === s2.italic;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
TokenStyle.equals = equals;
|
|
75
|
-
|
|
76
|
-
function is(s) {
|
|
77
|
-
return s instanceof TokenStyle;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
TokenStyle.is = is;
|
|
81
|
-
|
|
82
|
-
function fromData(data) {
|
|
83
|
-
return new TokenStyle(data.foreground, data.bold, data.underline, data.italic);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
TokenStyle.fromData = fromData;
|
|
87
|
-
|
|
88
|
-
function fromSettings(foreground, fontStyle, bold, underline, italic) {
|
|
89
|
-
let foregroundColor = undefined;
|
|
90
|
-
|
|
91
|
-
if (foreground !== undefined) {
|
|
92
|
-
foregroundColor = color_1.Color.fromHex(foreground);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
if (fontStyle !== undefined) {
|
|
96
|
-
bold = italic = underline = false;
|
|
97
|
-
const expression = /italic|bold|underline/g;
|
|
98
|
-
let match;
|
|
99
|
-
|
|
100
|
-
while (match = expression.exec(fontStyle)) {
|
|
101
|
-
switch (match[0]) {
|
|
102
|
-
case 'bold':
|
|
103
|
-
bold = true;
|
|
104
|
-
break;
|
|
105
|
-
|
|
106
|
-
case 'italic':
|
|
107
|
-
italic = true;
|
|
108
|
-
break;
|
|
109
|
-
|
|
110
|
-
case 'underline':
|
|
111
|
-
underline = true;
|
|
112
|
-
break;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
return new TokenStyle(foregroundColor, bold, underline, italic);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
TokenStyle.fromSettings = fromSettings;
|
|
121
|
-
})(TokenStyle = exports.TokenStyle || (exports.TokenStyle = {}));
|
|
122
|
-
|
|
123
|
-
var SemanticTokenRule;
|
|
124
|
-
|
|
125
|
-
(function (SemanticTokenRule) {
|
|
126
|
-
function fromJSONObject(registry, o) {
|
|
127
|
-
if (o && typeof o._selector === 'string' && o._style) {
|
|
128
|
-
const style = TokenStyle.fromJSONObject(o._style);
|
|
129
|
-
|
|
130
|
-
if (style) {
|
|
131
|
-
try {
|
|
132
|
-
return {
|
|
133
|
-
selector: registry.parseTokenSelector(o._selector),
|
|
134
|
-
style
|
|
135
|
-
};
|
|
136
|
-
} catch (_ignore) {}
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
return undefined;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
SemanticTokenRule.fromJSONObject = fromJSONObject;
|
|
144
|
-
|
|
145
|
-
function toJSONObject(rule) {
|
|
146
|
-
return {
|
|
147
|
-
_selector: rule.selector.id,
|
|
148
|
-
_style: TokenStyle.toJSONObject(rule.style)
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
SemanticTokenRule.toJSONObject = toJSONObject;
|
|
153
|
-
|
|
154
|
-
function equals(r1, r2) {
|
|
155
|
-
if (r1 === r2) {
|
|
156
|
-
return true;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
return r1 !== undefined && r2 !== undefined && r1.selector && r2.selector && r1.selector.id === r2.selector.id && TokenStyle.equals(r1.style, r2.style);
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
SemanticTokenRule.equals = equals;
|
|
163
|
-
|
|
164
|
-
function is(r) {
|
|
165
|
-
return r && r.selector && typeof r.selector.id === 'string' && TokenStyle.is(r.style);
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
SemanticTokenRule.is = is;
|
|
169
|
-
})(SemanticTokenRule = exports.SemanticTokenRule || (exports.SemanticTokenRule = {})); // TokenStyle registry
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
exports.Extensions = {
|
|
173
|
-
TokenClassificationContribution: 'base.contributions.tokenClassification'
|
|
174
|
-
};
|
|
175
|
-
|
|
176
|
-
class TokenClassificationRegistry {
|
|
177
|
-
constructor() {
|
|
178
|
-
this._onDidChangeSchema = new event_1.Emitter();
|
|
179
|
-
this.onDidChangeSchema = this._onDidChangeSchema.event;
|
|
180
|
-
this.currentTypeNumber = 0;
|
|
181
|
-
this.currentModifierBit = 1;
|
|
182
|
-
this.tokenStylingDefaultRules = [];
|
|
183
|
-
this.tokenStylingSchema = {
|
|
184
|
-
type: 'object',
|
|
185
|
-
properties: {},
|
|
186
|
-
patternProperties: {
|
|
187
|
-
[exports.selectorPattern]: getStylingSchemeEntry()
|
|
188
|
-
},
|
|
189
|
-
//errorMessage: nls.localize('schema.token.errors', 'Valid token selectors have the form (*|tokenType)(.tokenModifier)*(:tokenLanguage)?.'),
|
|
190
|
-
additionalProperties: false,
|
|
191
|
-
definitions: {
|
|
192
|
-
style: {
|
|
193
|
-
type: 'object',
|
|
194
|
-
description: nls.localize('schema.token.settings', 'Colors and styles for the token.'),
|
|
195
|
-
properties: {
|
|
196
|
-
foreground: {
|
|
197
|
-
type: 'string',
|
|
198
|
-
description: nls.localize('schema.token.foreground', 'Foreground color for the token.'),
|
|
199
|
-
format: 'color-hex',
|
|
200
|
-
default: '#ff0000'
|
|
201
|
-
},
|
|
202
|
-
background: {
|
|
203
|
-
type: 'string',
|
|
204
|
-
deprecationMessage: nls.localize('schema.token.background.warning', 'Token background colors are currently not supported.')
|
|
205
|
-
},
|
|
206
|
-
fontStyle: {
|
|
207
|
-
type: 'string',
|
|
208
|
-
description: nls.localize('schema.token.fontStyle', 'Sets the all font styles of the rule: \'italic\', \'bold\' or \'underline\' or a combination. All styles that are not listed are unset. The empty string unsets all styles.'),
|
|
209
|
-
pattern: exports.fontStylePattern,
|
|
210
|
-
patternErrorMessage: nls.localize('schema.fontStyle.error', 'Font style must be \'italic\', \'bold\' or \'underline\' or a combination. The empty string unsets all styles.'),
|
|
211
|
-
defaultSnippets: [{
|
|
212
|
-
label: nls.localize('schema.token.fontStyle.none', 'None (clear inherited style)'),
|
|
213
|
-
bodyText: '""'
|
|
214
|
-
}, {
|
|
215
|
-
body: 'italic'
|
|
216
|
-
}, {
|
|
217
|
-
body: 'bold'
|
|
218
|
-
}, {
|
|
219
|
-
body: 'underline'
|
|
220
|
-
}, {
|
|
221
|
-
body: 'italic underline'
|
|
222
|
-
}, {
|
|
223
|
-
body: 'bold underline'
|
|
224
|
-
}, {
|
|
225
|
-
body: 'italic bold underline'
|
|
226
|
-
}]
|
|
227
|
-
},
|
|
228
|
-
bold: {
|
|
229
|
-
type: 'boolean',
|
|
230
|
-
description: nls.localize('schema.token.bold', 'Sets or unsets the font style to bold. Note, the presence of \'fontStyle\' overrides this setting.')
|
|
231
|
-
},
|
|
232
|
-
italic: {
|
|
233
|
-
type: 'boolean',
|
|
234
|
-
description: nls.localize('schema.token.italic', 'Sets or unsets the font style to italic. Note, the presence of \'fontStyle\' overrides this setting.')
|
|
235
|
-
},
|
|
236
|
-
underline: {
|
|
237
|
-
type: 'boolean',
|
|
238
|
-
description: nls.localize('schema.token.underline', 'Sets or unsets the font style to underline. Note, the presence of \'fontStyle\' overrides this setting.')
|
|
239
|
-
}
|
|
240
|
-
},
|
|
241
|
-
defaultSnippets: [{
|
|
242
|
-
body: {
|
|
243
|
-
foreground: '${1:#FF0000}',
|
|
244
|
-
fontStyle: '${2:bold}'
|
|
245
|
-
}
|
|
246
|
-
}]
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
};
|
|
250
|
-
this.tokenTypeById = Object.create(null);
|
|
251
|
-
this.tokenModifierById = Object.create(null);
|
|
252
|
-
this.typeHierarchy = Object.create(null);
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
registerTokenType(id, description, superType, deprecationMessage) {
|
|
256
|
-
if (!id.match(exports.typeAndModifierIdPattern)) {
|
|
257
|
-
throw new Error('Invalid token type id.');
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
if (superType && !superType.match(exports.typeAndModifierIdPattern)) {
|
|
261
|
-
throw new Error('Invalid token super type id.');
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
const num = this.currentTypeNumber++;
|
|
265
|
-
let tokenStyleContribution = {
|
|
266
|
-
num,
|
|
267
|
-
id,
|
|
268
|
-
superType,
|
|
269
|
-
description,
|
|
270
|
-
deprecationMessage
|
|
271
|
-
};
|
|
272
|
-
this.tokenTypeById[id] = tokenStyleContribution;
|
|
273
|
-
const stylingSchemeEntry = getStylingSchemeEntry(description, deprecationMessage);
|
|
274
|
-
this.tokenStylingSchema.properties[id] = stylingSchemeEntry;
|
|
275
|
-
this.typeHierarchy = Object.create(null);
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
registerTokenModifier(id, description, deprecationMessage) {
|
|
279
|
-
if (!id.match(exports.typeAndModifierIdPattern)) {
|
|
280
|
-
throw new Error('Invalid token modifier id.');
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
const num = this.currentModifierBit;
|
|
284
|
-
this.currentModifierBit = this.currentModifierBit * 2;
|
|
285
|
-
let tokenStyleContribution = {
|
|
286
|
-
num,
|
|
287
|
-
id,
|
|
288
|
-
description,
|
|
289
|
-
deprecationMessage
|
|
290
|
-
};
|
|
291
|
-
this.tokenModifierById[id] = tokenStyleContribution;
|
|
292
|
-
this.tokenStylingSchema.properties[`*.${id}`] = getStylingSchemeEntry(description, deprecationMessage);
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
parseTokenSelector(selectorString, language) {
|
|
296
|
-
const selector = parseClassifierString(selectorString, language);
|
|
297
|
-
|
|
298
|
-
if (!selector.type) {
|
|
299
|
-
return {
|
|
300
|
-
match: () => -1,
|
|
301
|
-
id: '$invalid'
|
|
302
|
-
};
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
return {
|
|
306
|
-
match: (type, modifiers, language) => {
|
|
307
|
-
let score = 0;
|
|
308
|
-
|
|
309
|
-
if (selector.language !== undefined) {
|
|
310
|
-
if (selector.language !== language) {
|
|
311
|
-
return -1;
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
score += 10;
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
if (selector.type !== exports.TOKEN_TYPE_WILDCARD) {
|
|
318
|
-
const hierarchy = this.getTypeHierarchy(type);
|
|
319
|
-
const level = hierarchy.indexOf(selector.type);
|
|
320
|
-
|
|
321
|
-
if (level === -1) {
|
|
322
|
-
return -1;
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
score += 100 - level;
|
|
326
|
-
} // all selector modifiers must be present
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
for (const selectorModifier of selector.modifiers) {
|
|
330
|
-
if (modifiers.indexOf(selectorModifier) === -1) {
|
|
331
|
-
return -1;
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
return score + selector.modifiers.length * 100;
|
|
336
|
-
},
|
|
337
|
-
id: `${[selector.type, ...selector.modifiers.sort()].join('.')}${selector.language !== undefined ? ':' + selector.language : ''}`
|
|
338
|
-
};
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
registerTokenStyleDefault(selector, defaults) {
|
|
342
|
-
this.tokenStylingDefaultRules.push({
|
|
343
|
-
selector,
|
|
344
|
-
defaults
|
|
345
|
-
});
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
deregisterTokenStyleDefault(selector) {
|
|
349
|
-
const selectorString = selector.id;
|
|
350
|
-
this.tokenStylingDefaultRules = this.tokenStylingDefaultRules.filter(r => r.selector.id !== selectorString);
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
deregisterTokenType(id) {
|
|
354
|
-
delete this.tokenTypeById[id];
|
|
355
|
-
delete this.tokenStylingSchema.properties[id];
|
|
356
|
-
this.typeHierarchy = Object.create(null);
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
deregisterTokenModifier(id) {
|
|
360
|
-
delete this.tokenModifierById[id];
|
|
361
|
-
delete this.tokenStylingSchema.properties[`*.${id}`];
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
getTokenTypes() {
|
|
365
|
-
return Object.keys(this.tokenTypeById).map(id => this.tokenTypeById[id]);
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
getTokenModifiers() {
|
|
369
|
-
return Object.keys(this.tokenModifierById).map(id => this.tokenModifierById[id]);
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
getTokenStylingSchema() {
|
|
373
|
-
return this.tokenStylingSchema;
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
getTokenStylingDefaultRules() {
|
|
377
|
-
return this.tokenStylingDefaultRules;
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
getTypeHierarchy(typeId) {
|
|
381
|
-
let hierarchy = this.typeHierarchy[typeId];
|
|
382
|
-
|
|
383
|
-
if (!hierarchy) {
|
|
384
|
-
this.typeHierarchy[typeId] = hierarchy = [typeId];
|
|
385
|
-
let type = this.tokenTypeById[typeId];
|
|
386
|
-
|
|
387
|
-
while (type && type.superType) {
|
|
388
|
-
hierarchy.push(type.superType);
|
|
389
|
-
type = this.tokenTypeById[type.superType];
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
return hierarchy;
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
toString() {
|
|
397
|
-
let sorter = (a, b) => {
|
|
398
|
-
let cat1 = a.indexOf('.') === -1 ? 0 : 1;
|
|
399
|
-
let cat2 = b.indexOf('.') === -1 ? 0 : 1;
|
|
400
|
-
|
|
401
|
-
if (cat1 !== cat2) {
|
|
402
|
-
return cat1 - cat2;
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
return a.localeCompare(b);
|
|
406
|
-
};
|
|
407
|
-
|
|
408
|
-
return Object.keys(this.tokenTypeById).sort(sorter).map(k => `- \`${k}\`: ${this.tokenTypeById[k].description}`).join('\n');
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
const CHAR_LANGUAGE = exports.TOKEN_CLASSIFIER_LANGUAGE_SEPARATOR.charCodeAt(0);
|
|
414
|
-
const CHAR_MODIFIER = exports.CLASSIFIER_MODIFIER_SEPARATOR.charCodeAt(0);
|
|
415
|
-
|
|
416
|
-
function parseClassifierString(s, defaultLanguage) {
|
|
417
|
-
let k = s.length;
|
|
418
|
-
let language = defaultLanguage;
|
|
419
|
-
const modifiers = [];
|
|
420
|
-
|
|
421
|
-
for (let i = k - 1; i >= 0; i--) {
|
|
422
|
-
const ch = s.charCodeAt(i);
|
|
423
|
-
|
|
424
|
-
if (ch === CHAR_LANGUAGE || ch === CHAR_MODIFIER) {
|
|
425
|
-
const segment = s.substring(i + 1, k);
|
|
426
|
-
k = i;
|
|
427
|
-
|
|
428
|
-
if (ch === CHAR_LANGUAGE) {
|
|
429
|
-
language = segment;
|
|
430
|
-
} else {
|
|
431
|
-
modifiers.push(segment);
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
const type = s.substring(0, k);
|
|
437
|
-
return {
|
|
438
|
-
type,
|
|
439
|
-
modifiers,
|
|
440
|
-
language
|
|
441
|
-
};
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
exports.parseClassifierString = parseClassifierString;
|
|
445
|
-
let tokenClassificationRegistry = createDefaultTokenClassificationRegistry();
|
|
446
|
-
platform.Registry.add(exports.Extensions.TokenClassificationContribution, tokenClassificationRegistry);
|
|
447
|
-
|
|
448
|
-
function createDefaultTokenClassificationRegistry() {
|
|
449
|
-
const registry = new TokenClassificationRegistry();
|
|
450
|
-
|
|
451
|
-
function registerTokenType(id, description, scopesToProbe = [], superType, deprecationMessage) {
|
|
452
|
-
registry.registerTokenType(id, description, superType, deprecationMessage);
|
|
453
|
-
|
|
454
|
-
if (scopesToProbe) {
|
|
455
|
-
registerTokenStyleDefault(id, scopesToProbe);
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
return id;
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
function registerTokenStyleDefault(selectorString, scopesToProbe) {
|
|
462
|
-
try {
|
|
463
|
-
const selector = registry.parseTokenSelector(selectorString);
|
|
464
|
-
registry.registerTokenStyleDefault(selector, {
|
|
465
|
-
scopesToProbe
|
|
466
|
-
});
|
|
467
|
-
} catch (e) {
|
|
468
|
-
console.log(e);
|
|
469
|
-
}
|
|
470
|
-
} // default token types
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
registerTokenType('comment', nls.localize('comment', "Style for comments."), [['comment']]);
|
|
474
|
-
registerTokenType('string', nls.localize('string', "Style for strings."), [['string']]);
|
|
475
|
-
registerTokenType('keyword', nls.localize('keyword', "Style for keywords."), [['keyword.control']]);
|
|
476
|
-
registerTokenType('number', nls.localize('number', "Style for numbers."), [['constant.numeric']]);
|
|
477
|
-
registerTokenType('regexp', nls.localize('regexp', "Style for expressions."), [['constant.regexp']]);
|
|
478
|
-
registerTokenType('operator', nls.localize('operator', "Style for operators."), [['keyword.operator']]);
|
|
479
|
-
registerTokenType('namespace', nls.localize('namespace', "Style for namespaces."), [['entity.name.namespace']]);
|
|
480
|
-
registerTokenType('type', nls.localize('type', "Style for types."), [['entity.name.type'], ['support.type']]);
|
|
481
|
-
registerTokenType('struct', nls.localize('struct', "Style for structs."), [['entity.name.type.struct']]);
|
|
482
|
-
registerTokenType('class', nls.localize('class', "Style for classes."), [['entity.name.type.class'], ['support.class']]);
|
|
483
|
-
registerTokenType('interface', nls.localize('interface', "Style for interfaces."), [['entity.name.type.interface']]);
|
|
484
|
-
registerTokenType('enum', nls.localize('enum', "Style for enums."), [['entity.name.type.enum']]);
|
|
485
|
-
registerTokenType('typeParameter', nls.localize('typeParameter', "Style for type parameters."), [['entity.name.type.parameter']]);
|
|
486
|
-
registerTokenType('function', nls.localize('function', "Style for functions"), [['entity.name.function'], ['support.function']]);
|
|
487
|
-
registerTokenType('member', nls.localize('member', "Style for member"), [['entity.name.function.member'], ['support.function']]);
|
|
488
|
-
registerTokenType('macro', nls.localize('macro', "Style for macros."), [['entity.name.other.preprocessor.macro']]);
|
|
489
|
-
registerTokenType('variable', nls.localize('variable', "Style for variables."), [['variable.other.readwrite'], ['entity.name.variable']]);
|
|
490
|
-
registerTokenType('parameter', nls.localize('parameter', "Style for parameters."), [['variable.parameter']]);
|
|
491
|
-
registerTokenType('property', nls.localize('property', "Style for properties."), [['variable.other.property']]);
|
|
492
|
-
registerTokenType('enumMember', nls.localize('enumMember', "Style for enum members."), [['variable.other.enummember']]);
|
|
493
|
-
registerTokenType('event', nls.localize('event', "Style for events."), [['variable.other.event']]);
|
|
494
|
-
registerTokenType('label', nls.localize('labels', "Style for labels. "), undefined); // default token modifiers
|
|
495
|
-
|
|
496
|
-
registry.registerTokenModifier('declaration', nls.localize('declaration', "Style for all symbol declarations."), undefined);
|
|
497
|
-
registry.registerTokenModifier('documentation', nls.localize('documentation', "Style to use for references in documentation."), undefined);
|
|
498
|
-
registry.registerTokenModifier('static', nls.localize('static', "Style to use for symbols that are static."), undefined);
|
|
499
|
-
registry.registerTokenModifier('abstract', nls.localize('abstract', "Style to use for symbols that are abstract."), undefined);
|
|
500
|
-
registry.registerTokenModifier('deprecated', nls.localize('deprecated', "Style to use for symbols that are deprecated."), undefined);
|
|
501
|
-
registry.registerTokenModifier('modification', nls.localize('modification', "Style to use for write accesses."), undefined);
|
|
502
|
-
registry.registerTokenModifier('async', nls.localize('async', "Style to use for symbols that are async."), undefined);
|
|
503
|
-
registry.registerTokenModifier('readonly', nls.localize('readonly', "Style to use for symbols that are readonly."), undefined);
|
|
504
|
-
registerTokenStyleDefault('variable.readonly', [['variable.other.constant']]);
|
|
505
|
-
registerTokenStyleDefault('property.readonly', [['variable.other.constant.property']]);
|
|
506
|
-
registerTokenStyleDefault('type.defaultLibrary', [['support.type']]);
|
|
507
|
-
registerTokenStyleDefault('class.defaultLibrary', [['support.class']]);
|
|
508
|
-
registerTokenStyleDefault('interface.defaultLibrary', [['support.class']]);
|
|
509
|
-
registerTokenStyleDefault('variable.defaultLibrary', [['support.variable'], ['support.other.variable']]);
|
|
510
|
-
registerTokenStyleDefault('variable.defaultLibrary.readonly', [['support.constant']]);
|
|
511
|
-
registerTokenStyleDefault('property.defaultLibrary', [['support.variable.property']]);
|
|
512
|
-
registerTokenStyleDefault('property.defaultLibrary.readonly', [['support.constant.property']]);
|
|
513
|
-
registerTokenStyleDefault('function.defaultLibrary', [['support.function']]);
|
|
514
|
-
registerTokenStyleDefault('member.defaultLibrary', [['support.function']]);
|
|
515
|
-
return registry;
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
function getTokenClassificationRegistry() {
|
|
519
|
-
return tokenClassificationRegistry;
|
|
520
|
-
}
|
|
521
|
-
|
|
522
|
-
exports.getTokenClassificationRegistry = getTokenClassificationRegistry;
|
|
523
|
-
|
|
524
|
-
function getStylingSchemeEntry(description, deprecationMessage) {
|
|
525
|
-
return {
|
|
526
|
-
description,
|
|
527
|
-
deprecationMessage,
|
|
528
|
-
defaultSnippets: [{
|
|
529
|
-
body: '${1:#ff0000}'
|
|
530
|
-
}],
|
|
531
|
-
anyOf: [{
|
|
532
|
-
type: 'string',
|
|
533
|
-
format: 'color-hex'
|
|
534
|
-
}, {
|
|
535
|
-
$ref: '#definitions/style'
|
|
536
|
-
}]
|
|
537
|
-
};
|
|
538
|
-
}
|
|
539
|
-
|
|
540
|
-
exports.tokenStylingSchemaId = 'vscode://schemas/token-styling';
|
|
@@ -1,98 +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.TestThemeService = exports.TestFileIconTheme = exports.TestColorTheme = void 0;
|
|
11
|
-
|
|
12
|
-
const event_1 = require("../../../../base/common/event");
|
|
13
|
-
|
|
14
|
-
const color_1 = require("../../../../base/common/color");
|
|
15
|
-
|
|
16
|
-
const theme_1 = require("../../common/theme");
|
|
17
|
-
|
|
18
|
-
class TestColorTheme {
|
|
19
|
-
constructor(colors = {}, type = theme_1.ColorScheme.DARK) {
|
|
20
|
-
this.colors = colors;
|
|
21
|
-
this.type = type;
|
|
22
|
-
this.label = 'test';
|
|
23
|
-
this.semanticHighlighting = false;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
getColor(color, useDefault) {
|
|
27
|
-
let value = this.colors[color];
|
|
28
|
-
|
|
29
|
-
if (value) {
|
|
30
|
-
return color_1.Color.fromHex(value);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return undefined;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
defines(color) {
|
|
37
|
-
throw new Error('Method not implemented.');
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
getTokenStyleMetadata(type, modifiers, modelLanguage) {
|
|
41
|
-
return undefined;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
get tokenColorMap() {
|
|
45
|
-
return [];
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
exports.TestColorTheme = TestColorTheme;
|
|
51
|
-
|
|
52
|
-
class TestFileIconTheme {
|
|
53
|
-
constructor() {
|
|
54
|
-
this.hasFileIcons = false;
|
|
55
|
-
this.hasFolderIcons = false;
|
|
56
|
-
this.hidesExplorerArrows = false;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
exports.TestFileIconTheme = TestFileIconTheme;
|
|
62
|
-
|
|
63
|
-
class TestThemeService {
|
|
64
|
-
constructor(theme = new TestColorTheme(), iconTheme = new TestFileIconTheme()) {
|
|
65
|
-
this._onThemeChange = new event_1.Emitter();
|
|
66
|
-
this._onFileIconThemeChange = new event_1.Emitter();
|
|
67
|
-
this._colorTheme = theme;
|
|
68
|
-
this._fileIconTheme = iconTheme;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
getColorTheme() {
|
|
72
|
-
return this._colorTheme;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
setTheme(theme) {
|
|
76
|
-
this._colorTheme = theme;
|
|
77
|
-
this.fireThemeChange();
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
fireThemeChange() {
|
|
81
|
-
this._onThemeChange.fire(this._colorTheme);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
get onDidColorThemeChange() {
|
|
85
|
-
return this._onThemeChange.event;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
getFileIconTheme() {
|
|
89
|
-
return this._fileIconTheme;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
get onDidFileIconThemeChange() {
|
|
93
|
-
return this._onFileIconThemeChange.event;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
exports.TestThemeService = TestThemeService;
|