@codingame/monaco-vscode-api 1.69.5 → 1.69.8
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/dist/api.js +8 -7
- package/dist/configuration.js +384 -73
- package/dist/contextkey.js +140 -1
- package/dist/dialogs.js +13 -12
- package/dist/extHost.js +2063 -1396
- package/dist/files.js +100 -105
- package/dist/keybindings.js +358 -307
- package/dist/languageConfiguration.js +5 -4
- package/dist/languageService.js +3 -3
- package/dist/languages.js +4 -3
- package/dist/layout.js +294 -311
- package/dist/messages.js +2 -0
- package/dist/missing-services.js +5227 -5877
- package/dist/modelEditor.js +69 -68
- package/dist/monaco.js +14 -13
- package/dist/notifications.js +268 -337
- package/dist/polyfill.js +5348 -0
- package/dist/services.js +2 -2
- package/dist/services2.js +646 -140
- package/dist/snippets.js +102 -109
- package/dist/textmate.js +82 -89
- package/dist/theme.js +396 -407
- package/dist/tokenClassification.js +4 -3
- package/dist/tokenClassificationRegistry.js +78 -84
- package/dist/tools.js +2 -1
- package/dist/workbenchThemeService.js +1 -1
- package/dist/workspaceContext.js +2 -1
- package/package.json +7 -1
package/dist/theme.js
CHANGED
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { p as parse$1, w as getNodeType, E as Emitter } from './polyfill.js';
|
|
2
|
+
import { E as ExtensionsRegistry, S as Sequencer, I as IExtensionService, o as IBrowserWorkbenchEnvironmentService, p as IHostColorSchemeService, q as IUserDataInitializationService, m as ExtensionMessageCollector } from './missing-services.js';
|
|
3
|
+
import { b as __decorate, d as __param } from './contextkey.js';
|
|
4
|
+
import { T as THEME_SCOPE_OPEN_PAREN, a as THEME_SCOPE_CLOSE_PAREN, b as THEME_SCOPE_WILDCARD, t as themeScopeRegex, E as ExtensionData, V as VS_HC_LIGHT_THEME, c as VS_HC_THEME, d as VS_LIGHT_THEME, e as VS_DARK_THEME, f as ThemeSettings } from './workbenchThemeService.js';
|
|
5
|
+
import { Extensions, editorBackground, editorForeground, editorSelectionBackground, editorInactiveSelection, editorSelectionHighlight, editorFindMatchHighlight, editorFindMatch, editorHoverHighlight, editorFindRangeHighlight, workbenchColorsSchemaId, asCssVariableName } from 'monaco-editor/esm/vs/platform/theme/common/colorRegistry.js';
|
|
5
6
|
import { Color } from 'monaco-editor/esm/vs/base/common/color.js';
|
|
6
7
|
import { editorLineHighlight, editorRangeHighlight, editorCursorForeground, editorWhitespaces, editorIndentGuides, editorActiveIndentGuides } from 'monaco-editor/esm/vs/editor/common/core/editorColorRegistry.js';
|
|
7
8
|
import { g as getParseErrorMessage } from './jsonErrorMessages.js';
|
|
8
|
-
import { g as getTokenClassificationRegistry,
|
|
9
|
-
import { isUndefined,
|
|
9
|
+
import { g as getTokenClassificationRegistry, T as TokenStyle, p as parseClassifierString, S as SemanticTokenRule, t as tokenStylingSchemaId } from './tokenClassificationRegistry.js';
|
|
10
|
+
import { isUndefined, isObject, isArray, isString, isBoolean } from 'monaco-editor/esm/vs/base/common/types.js';
|
|
10
11
|
import { ColorScheme } from 'monaco-editor/esm/vs/platform/theme/common/theme.js';
|
|
11
|
-
import {
|
|
12
|
+
import { getThemeTypeSelector, ThemeIcon, Extensions as Extensions$3, IThemeService } from 'monaco-editor/esm/vs/platform/theme/common/themeService.js';
|
|
12
13
|
import { basename } from 'monaco-editor/esm/vs/base/common/path.js';
|
|
13
|
-
import {
|
|
14
|
+
import { extname, joinPath, dirname, isEqualOrParent, isEqual } from 'monaco-editor/esm/vs/base/common/resources.js';
|
|
14
15
|
import { localize } from 'monaco-editor/esm/vs/nls.js';
|
|
15
16
|
import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
|
|
16
|
-
import {
|
|
17
|
+
import { iconsSchemaId, IconFontDefinition, getIconRegistry } from 'monaco-editor/esm/vs/platform/theme/common/iconRegistry.js';
|
|
17
18
|
import { Extensions as Extensions$1 } from 'monaco-editor/esm/vs/platform/jsonschemas/common/jsonContributionRegistry.js';
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
19
|
+
import { asCSSUrl, createStyleSheet } from 'monaco-editor/esm/vs/base/browser/dom.js';
|
|
20
|
+
import { a as getRemoteAuthority, I as IExtensionResourceLoaderService, g as getServiceOverride$1, r as registerExtensionFile } from './files.js';
|
|
20
21
|
import { I as IWorkbenchLayoutService } from './layoutService.js';
|
|
21
|
-
import { Extensions } from 'monaco-editor/esm/vs/platform/configuration/common/configurationRegistry.js';
|
|
22
|
+
import { Extensions as Extensions$2 } from 'monaco-editor/esm/vs/platform/configuration/common/configurationRegistry.js';
|
|
22
23
|
import { isWeb } from 'monaco-editor/esm/vs/base/common/platform.js';
|
|
23
|
-
import {
|
|
24
|
+
import { d as IFileService, S as Services } from './services2.js';
|
|
24
25
|
import { onUnexpectedError } from 'monaco-editor/esm/vs/base/common/errors.js';
|
|
25
26
|
import { getIconsStyleSheet } from 'monaco-editor/esm/vs/platform/theme/browser/iconsStyleSheet.js';
|
|
26
27
|
import { IStorageService } from 'monaco-editor/esm/vs/platform/storage/common/storage.js';
|
|
@@ -31,12 +32,12 @@ import { ILanguageService } from 'monaco-editor/esm/vs/editor/common/languages/l
|
|
|
31
32
|
import { dispose } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
32
33
|
import { RunOnceScheduler } from 'monaco-editor/esm/vs/base/common/async.js';
|
|
33
34
|
import { c as consoleExtensionMessageHandler } from './tools.js';
|
|
34
|
-
import {
|
|
35
|
+
import { D as DEFAULT_EXTENSION } from './extHost.js';
|
|
35
36
|
import { ExtensionIdentifier } from 'monaco-editor/esm/vs/platform/extensions/common/extensions.js';
|
|
36
37
|
import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
|
|
37
38
|
import { SyncDescriptor } from 'monaco-editor/esm/vs/platform/instantiation/common/descriptors.js';
|
|
38
39
|
function getColorRegistry () {
|
|
39
|
-
return
|
|
40
|
+
return Registry.as(Extensions.ColorContribution)
|
|
40
41
|
}
|
|
41
42
|
const settingToColorIdMapping = {};
|
|
42
43
|
function addSettingMapping(settingId, colorId) {
|
|
@@ -61,7 +62,7 @@ function convertSettings(oldSettings, result) {
|
|
|
61
62
|
if (mappings) {
|
|
62
63
|
const colorHex = settings[key];
|
|
63
64
|
if (typeof colorHex === 'string') {
|
|
64
|
-
const color = (
|
|
65
|
+
const color = ( Color.fromHex(colorHex));
|
|
65
66
|
for (const colorId of mappings) {
|
|
66
67
|
result.colors[colorId] = color;
|
|
67
68
|
}
|
|
@@ -517,7 +518,7 @@ function _parse(content, filename, locationKeyName) {
|
|
|
517
518
|
acceptInteger(parseInt(parseTagValue(tag), 10));
|
|
518
519
|
continue;
|
|
519
520
|
case 'date':
|
|
520
|
-
acceptDate((
|
|
521
|
+
acceptDate(( new Date(parseTagValue(tag))));
|
|
521
522
|
continue;
|
|
522
523
|
case 'data':
|
|
523
524
|
acceptData(parseTagValue(tag));
|
|
@@ -657,7 +658,7 @@ function newTokenizer(input) {
|
|
|
657
658
|
}
|
|
658
659
|
};
|
|
659
660
|
}
|
|
660
|
-
const colorRegistry = (
|
|
661
|
+
const colorRegistry = ( Registry.as(Extensions.ColorContribution));
|
|
661
662
|
const tokenClassificationRegistry = getTokenClassificationRegistry();
|
|
662
663
|
const tokenGroupToScopesMap = {
|
|
663
664
|
comments: ['comment', 'punctuation.definition.comment'],
|
|
@@ -821,7 +822,7 @@ class ColorThemeData {
|
|
|
821
822
|
}
|
|
822
823
|
getTokenColorIndex() {
|
|
823
824
|
if (!this.tokenColorIndex) {
|
|
824
|
-
const index = (
|
|
825
|
+
const index = ( new TokenColorIndex());
|
|
825
826
|
this.tokenColors.forEach(rule => {
|
|
826
827
|
index.add(rule.settings.foreground);
|
|
827
828
|
index.add(rule.settings.background);
|
|
@@ -936,7 +937,7 @@ class ColorThemeData {
|
|
|
936
937
|
for (const id in colors) {
|
|
937
938
|
const colorVal = colors[id];
|
|
938
939
|
if (typeof colorVal === 'string') {
|
|
939
|
-
this.customColorMap[id] = (
|
|
940
|
+
this.customColorMap[id] = ( Color.fromHex(colorVal));
|
|
940
941
|
}
|
|
941
942
|
}
|
|
942
943
|
}
|
|
@@ -1121,19 +1122,19 @@ class ColorThemeData {
|
|
|
1121
1122
|
return ColorThemeData.createUnloadedTheme(getThemeTypeSelector(themeType), colorMap);
|
|
1122
1123
|
}
|
|
1123
1124
|
static createUnloadedTheme(id, colorMap) {
|
|
1124
|
-
const themeData = (
|
|
1125
|
+
const themeData = ( new ColorThemeData(id, '', '__' + id));
|
|
1125
1126
|
themeData.isLoaded = false;
|
|
1126
1127
|
themeData.themeTokenColors = [];
|
|
1127
1128
|
themeData.watch = false;
|
|
1128
1129
|
if (colorMap) {
|
|
1129
1130
|
for (const id in colorMap) {
|
|
1130
|
-
themeData.colorMap[id] = (
|
|
1131
|
+
themeData.colorMap[id] = ( Color.fromHex(colorMap[id]));
|
|
1131
1132
|
}
|
|
1132
1133
|
}
|
|
1133
1134
|
return themeData;
|
|
1134
1135
|
}
|
|
1135
1136
|
static createLoadedEmptyTheme(id, settingsId) {
|
|
1136
|
-
const themeData = (
|
|
1137
|
+
const themeData = ( new ColorThemeData(id, '', settingsId));
|
|
1137
1138
|
themeData.isLoaded = true;
|
|
1138
1139
|
themeData.themeTokenColors = [];
|
|
1139
1140
|
themeData.watch = false;
|
|
@@ -1146,13 +1147,13 @@ class ColorThemeData {
|
|
|
1146
1147
|
}
|
|
1147
1148
|
try {
|
|
1148
1149
|
const data = JSON.parse(input);
|
|
1149
|
-
const theme = (
|
|
1150
|
+
const theme = ( new ColorThemeData('', '', ''));
|
|
1150
1151
|
for (const key in data) {
|
|
1151
1152
|
switch (key) {
|
|
1152
1153
|
case 'colorMap': {
|
|
1153
1154
|
const colorMapData = data[key];
|
|
1154
1155
|
for (const id in colorMapData) {
|
|
1155
|
-
theme.colorMap[id] = (
|
|
1156
|
+
theme.colorMap[id] = ( Color.fromHex(colorMapData[id]));
|
|
1156
1157
|
}
|
|
1157
1158
|
break;
|
|
1158
1159
|
}
|
|
@@ -1198,7 +1199,7 @@ class ColorThemeData {
|
|
|
1198
1199
|
const id = `${baseTheme} ${themeSelector}`;
|
|
1199
1200
|
const label = theme.label || basename(theme.path);
|
|
1200
1201
|
const settingsId = theme.id || label;
|
|
1201
|
-
const themeData = (
|
|
1202
|
+
const themeData = ( new ColorThemeData(id, label, settingsId));
|
|
1202
1203
|
themeData.description = theme.description;
|
|
1203
1204
|
themeData.watch = theme._watch === true;
|
|
1204
1205
|
themeData.location = colorThemeLocation;
|
|
@@ -1225,17 +1226,17 @@ async function _loadColorTheme(extensionResourceLoaderService, themeLocation, re
|
|
|
1225
1226
|
const errors = [];
|
|
1226
1227
|
const contentValue = parse$1(content, errors);
|
|
1227
1228
|
if (errors.length > 0) {
|
|
1228
|
-
return Promise.reject((
|
|
1229
|
+
return Promise.reject(( new Error(( localize(
|
|
1229
1230
|
'error.cannotparsejson',
|
|
1230
1231
|
"Problems parsing JSON theme file: {0}",
|
|
1231
1232
|
errors.map(e => getParseErrorMessage(e.error)).join(', ')
|
|
1232
|
-
)))))
|
|
1233
|
+
)))));
|
|
1233
1234
|
}
|
|
1234
1235
|
else if (getNodeType(contentValue) !== 'object') {
|
|
1235
|
-
return Promise.reject((
|
|
1236
|
+
return Promise.reject(( new Error(( localize(
|
|
1236
1237
|
'error.invalidformat',
|
|
1237
1238
|
"Invalid format for JSON theme file: Object expected."
|
|
1238
|
-
)))))
|
|
1239
|
+
)))));
|
|
1239
1240
|
}
|
|
1240
1241
|
if (contentValue.include) {
|
|
1241
1242
|
await _loadColorTheme(extensionResourceLoaderService, joinPath(dirname(themeLocation), contentValue.include), result);
|
|
@@ -1248,16 +1249,16 @@ async function _loadColorTheme(extensionResourceLoaderService, themeLocation, re
|
|
|
1248
1249
|
const colors = contentValue.colors;
|
|
1249
1250
|
if (colors) {
|
|
1250
1251
|
if (typeof colors !== 'object') {
|
|
1251
|
-
return Promise.reject((
|
|
1252
|
+
return Promise.reject(( new Error(( localize(
|
|
1252
1253
|
{ key: 'error.invalidformat.colors', comment: ['{0} will be replaced by a path. Values in quotes should not be translated.'] },
|
|
1253
1254
|
"Problem parsing color theme file: {0}. Property 'colors' is not of type 'object'.",
|
|
1254
|
-
|
|
1255
|
-
)))))
|
|
1255
|
+
( themeLocation.toString())
|
|
1256
|
+
)))));
|
|
1256
1257
|
}
|
|
1257
1258
|
for (const colorId in colors) {
|
|
1258
1259
|
const colorHex = colors[colorId];
|
|
1259
1260
|
if (typeof colorHex === 'string') {
|
|
1260
|
-
result.colors[colorId] = (
|
|
1261
|
+
result.colors[colorId] = ( Color.fromHex(colors[colorId]));
|
|
1261
1262
|
}
|
|
1262
1263
|
}
|
|
1263
1264
|
}
|
|
@@ -1270,11 +1271,11 @@ async function _loadColorTheme(extensionResourceLoaderService, themeLocation, re
|
|
|
1270
1271
|
await _loadSyntaxTokens(extensionResourceLoaderService, joinPath(dirname(themeLocation), tokenColors), result);
|
|
1271
1272
|
}
|
|
1272
1273
|
else {
|
|
1273
|
-
return Promise.reject((
|
|
1274
|
+
return Promise.reject(( new Error(( localize(
|
|
1274
1275
|
{ key: 'error.invalidformat.tokenColors', comment: ['{0} will be replaced by a path. Values in quotes should not be translated.'] },
|
|
1275
1276
|
"Problem parsing color theme file: {0}. Property 'tokenColors' should be either an array specifying colors or a path to a TextMate theme file",
|
|
1276
|
-
|
|
1277
|
-
)))))
|
|
1277
|
+
( themeLocation.toString())
|
|
1278
|
+
)))));
|
|
1278
1279
|
}
|
|
1279
1280
|
}
|
|
1280
1281
|
const semanticTokenColors = contentValue.semanticTokenColors;
|
|
@@ -1287,11 +1288,11 @@ async function _loadColorTheme(extensionResourceLoaderService, themeLocation, re
|
|
|
1287
1288
|
}
|
|
1288
1289
|
}
|
|
1289
1290
|
catch (e) {
|
|
1290
|
-
return Promise.reject((
|
|
1291
|
+
return Promise.reject(( new Error(( localize(
|
|
1291
1292
|
{ key: 'error.invalidformat.semanticTokenColors', comment: ['{0} will be replaced by a path. Values in quotes should not be translated.'] },
|
|
1292
1293
|
"Problem parsing color theme file: {0}. Property 'semanticTokenColors' contains a invalid selector",
|
|
1293
|
-
|
|
1294
|
-
)))))
|
|
1294
|
+
( themeLocation.toString())
|
|
1295
|
+
)))));
|
|
1295
1296
|
}
|
|
1296
1297
|
}
|
|
1297
1298
|
}
|
|
@@ -1306,26 +1307,24 @@ function _loadSyntaxTokens(extensionResourceLoaderService, themeLocation, result
|
|
|
1306
1307
|
const contentValue = parse(content);
|
|
1307
1308
|
const settings = contentValue.settings;
|
|
1308
1309
|
if (!Array.isArray(settings)) {
|
|
1309
|
-
return Promise.reject((
|
|
1310
|
+
return Promise.reject(( new Error(( localize(
|
|
1310
1311
|
'error.plist.invalidformat',
|
|
1311
1312
|
"Problem parsing tmTheme file: {0}. 'settings' is not array."
|
|
1312
|
-
)))))
|
|
1313
|
+
)))));
|
|
1313
1314
|
}
|
|
1314
1315
|
convertSettings(settings, result);
|
|
1315
1316
|
return Promise.resolve(null);
|
|
1316
1317
|
}
|
|
1317
1318
|
catch (e) {
|
|
1318
|
-
return Promise.reject((
|
|
1319
|
-
(localize('error.cannotparse', "Problems parsing tmTheme file: {0}", e.message))
|
|
1320
|
-
))));
|
|
1319
|
+
return Promise.reject(( new Error(( localize('error.cannotparse', "Problems parsing tmTheme file: {0}", e.message)))));
|
|
1321
1320
|
}
|
|
1322
1321
|
}, error => {
|
|
1323
|
-
return Promise.reject((
|
|
1322
|
+
return Promise.reject(( new Error(( localize(
|
|
1324
1323
|
'error.cannotload',
|
|
1325
1324
|
"Problems loading tmTheme file {0}: {1}",
|
|
1326
|
-
|
|
1325
|
+
( themeLocation.toString()),
|
|
1327
1326
|
error.message
|
|
1328
|
-
)))))
|
|
1327
|
+
)))));
|
|
1329
1328
|
});
|
|
1330
1329
|
}
|
|
1331
1330
|
const defaultThemeColors = {
|
|
@@ -1524,29 +1523,29 @@ const schema$1 = {
|
|
|
1524
1523
|
properties: {
|
|
1525
1524
|
id: {
|
|
1526
1525
|
type: 'string',
|
|
1527
|
-
description: (
|
|
1526
|
+
description: ( localize('schema.id', 'The ID of the font.')),
|
|
1528
1527
|
pattern: fontIdRegex,
|
|
1529
|
-
patternErrorMessage: (
|
|
1528
|
+
patternErrorMessage: ( localize(
|
|
1530
1529
|
'schema.id.formatError',
|
|
1531
1530
|
'The ID must only contain letters, numbers, underscore and minus.'
|
|
1532
|
-
))
|
|
1531
|
+
))
|
|
1533
1532
|
},
|
|
1534
1533
|
src: {
|
|
1535
1534
|
type: 'array',
|
|
1536
|
-
description: (
|
|
1535
|
+
description: ( localize('schema.src', 'The location of the font.')),
|
|
1537
1536
|
items: {
|
|
1538
1537
|
type: 'object',
|
|
1539
1538
|
properties: {
|
|
1540
1539
|
path: {
|
|
1541
1540
|
type: 'string',
|
|
1542
|
-
description: (
|
|
1541
|
+
description: ( localize(
|
|
1543
1542
|
'schema.font-path',
|
|
1544
1543
|
'The font path, relative to the current product icon theme file.'
|
|
1545
|
-
))
|
|
1544
|
+
)),
|
|
1546
1545
|
},
|
|
1547
1546
|
format: {
|
|
1548
1547
|
type: 'string',
|
|
1549
|
-
description: (
|
|
1548
|
+
description: ( localize('schema.font-format', 'The format of the font.')),
|
|
1550
1549
|
enum: ['woff', 'woff2', 'truetype', 'opentype', 'embedded-opentype', 'svg']
|
|
1551
1550
|
}
|
|
1552
1551
|
},
|
|
@@ -1558,10 +1557,10 @@ const schema$1 = {
|
|
|
1558
1557
|
},
|
|
1559
1558
|
weight: {
|
|
1560
1559
|
type: 'string',
|
|
1561
|
-
description: (
|
|
1560
|
+
description: ( localize(
|
|
1562
1561
|
'schema.font-weight',
|
|
1563
1562
|
'The weight of the font. See https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight for valid values.'
|
|
1564
|
-
))
|
|
1563
|
+
)),
|
|
1565
1564
|
anyOf: [
|
|
1566
1565
|
{ enum: ['normal', 'bold', 'lighter', 'bolder'] },
|
|
1567
1566
|
{ type: 'string', pattern: fontWeightRegex }
|
|
@@ -1569,10 +1568,10 @@ const schema$1 = {
|
|
|
1569
1568
|
},
|
|
1570
1569
|
style: {
|
|
1571
1570
|
type: 'string',
|
|
1572
|
-
description: (
|
|
1571
|
+
description: ( localize(
|
|
1573
1572
|
'schema.font-style',
|
|
1574
1573
|
'The style of the font. See https://developer.mozilla.org/en-US/docs/Web/CSS/font-style for valid values.'
|
|
1575
|
-
))
|
|
1574
|
+
)),
|
|
1576
1575
|
anyOf: [
|
|
1577
1576
|
{ enum: ['normal', 'italic', 'oblique'] },
|
|
1578
1577
|
{ type: 'string', pattern: fontStyleRegex }
|
|
@@ -1586,13 +1585,13 @@ const schema$1 = {
|
|
|
1586
1585
|
}
|
|
1587
1586
|
},
|
|
1588
1587
|
iconDefinitions: {
|
|
1589
|
-
description: (
|
|
1588
|
+
description: ( localize('schema.iconDefinitions', 'Association of icon name to a font character.')),
|
|
1590
1589
|
$ref: iconsSchemaId
|
|
1591
1590
|
}
|
|
1592
1591
|
}
|
|
1593
1592
|
};
|
|
1594
1593
|
function registerProductIconThemeSchemas() {
|
|
1595
|
-
const schemaRegistry = (
|
|
1594
|
+
const schemaRegistry = ( Registry.as(Extensions$1.JSONContribution));
|
|
1596
1595
|
schemaRegistry.registerSchema(schemaId$1, schema$1);
|
|
1597
1596
|
}
|
|
1598
1597
|
const schemaId = 'vscode://schemas/icon-theme';
|
|
@@ -1603,84 +1602,84 @@ const schema = {
|
|
|
1603
1602
|
definitions: {
|
|
1604
1603
|
folderExpanded: {
|
|
1605
1604
|
type: 'string',
|
|
1606
|
-
description: (
|
|
1605
|
+
description: ( localize(
|
|
1607
1606
|
'schema.folderExpanded',
|
|
1608
1607
|
'The folder icon for expanded folders. The expanded folder icon is optional. If not set, the icon defined for folder will be shown.'
|
|
1609
|
-
))
|
|
1608
|
+
))
|
|
1610
1609
|
},
|
|
1611
1610
|
folder: {
|
|
1612
1611
|
type: 'string',
|
|
1613
|
-
description: (
|
|
1612
|
+
description: ( localize(
|
|
1614
1613
|
'schema.folder',
|
|
1615
1614
|
'The folder icon for collapsed folders, and if folderExpanded is not set, also for expanded folders.'
|
|
1616
|
-
))
|
|
1615
|
+
))
|
|
1617
1616
|
},
|
|
1618
1617
|
file: {
|
|
1619
1618
|
type: 'string',
|
|
1620
|
-
description: (
|
|
1619
|
+
description: ( localize(
|
|
1621
1620
|
'schema.file',
|
|
1622
1621
|
'The default file icon, shown for all files that don\'t match any extension, filename or language id.'
|
|
1623
|
-
))
|
|
1622
|
+
))
|
|
1624
1623
|
},
|
|
1625
1624
|
folderNames: {
|
|
1626
1625
|
type: 'object',
|
|
1627
|
-
description: (
|
|
1626
|
+
description: ( localize(
|
|
1628
1627
|
'schema.folderNames',
|
|
1629
1628
|
'Associates folder names to icons. The object key is the folder name, not including any path segments. No patterns or wildcards are allowed. Folder name matching is case insensitive.'
|
|
1630
|
-
))
|
|
1629
|
+
)),
|
|
1631
1630
|
additionalProperties: {
|
|
1632
1631
|
type: 'string',
|
|
1633
|
-
description: (
|
|
1632
|
+
description: ( localize('schema.folderName', 'The ID of the icon definition for the association.'))
|
|
1634
1633
|
}
|
|
1635
1634
|
},
|
|
1636
1635
|
folderNamesExpanded: {
|
|
1637
1636
|
type: 'object',
|
|
1638
|
-
description: (
|
|
1637
|
+
description: ( localize(
|
|
1639
1638
|
'schema.folderNamesExpanded',
|
|
1640
1639
|
'Associates folder names to icons for expanded folders. The object key is the folder name, not including any path segments. No patterns or wildcards are allowed. Folder name matching is case insensitive.'
|
|
1641
|
-
))
|
|
1640
|
+
)),
|
|
1642
1641
|
additionalProperties: {
|
|
1643
1642
|
type: 'string',
|
|
1644
|
-
description: (
|
|
1643
|
+
description: ( localize(
|
|
1645
1644
|
'schema.folderNameExpanded',
|
|
1646
1645
|
'The ID of the icon definition for the association.'
|
|
1647
|
-
))
|
|
1646
|
+
))
|
|
1648
1647
|
}
|
|
1649
1648
|
},
|
|
1650
1649
|
fileExtensions: {
|
|
1651
1650
|
type: 'object',
|
|
1652
|
-
description: (
|
|
1651
|
+
description: ( localize(
|
|
1653
1652
|
'schema.fileExtensions',
|
|
1654
1653
|
'Associates file extensions to icons. The object key is the file extension name. The extension name is the last segment of a file name after the last dot (not including the dot). Extensions are compared case insensitive.'
|
|
1655
|
-
))
|
|
1654
|
+
)),
|
|
1656
1655
|
additionalProperties: {
|
|
1657
1656
|
type: 'string',
|
|
1658
|
-
description: (
|
|
1657
|
+
description: ( localize(
|
|
1659
1658
|
'schema.fileExtension',
|
|
1660
1659
|
'The ID of the icon definition for the association.'
|
|
1661
|
-
))
|
|
1660
|
+
))
|
|
1662
1661
|
}
|
|
1663
1662
|
},
|
|
1664
1663
|
fileNames: {
|
|
1665
1664
|
type: 'object',
|
|
1666
|
-
description: (
|
|
1665
|
+
description: ( localize(
|
|
1667
1666
|
'schema.fileNames',
|
|
1668
1667
|
'Associates file names to icons. The object key is the full file name, but not including any path segments. File name can include dots and a possible file extension. No patterns or wildcards are allowed. File name matching is case insensitive.'
|
|
1669
|
-
))
|
|
1668
|
+
)),
|
|
1670
1669
|
additionalProperties: {
|
|
1671
1670
|
type: 'string',
|
|
1672
|
-
description: (
|
|
1671
|
+
description: ( localize('schema.fileName', 'The ID of the icon definition for the association.'))
|
|
1673
1672
|
}
|
|
1674
1673
|
},
|
|
1675
1674
|
languageIds: {
|
|
1676
1675
|
type: 'object',
|
|
1677
|
-
description: (
|
|
1676
|
+
description: ( localize(
|
|
1678
1677
|
'schema.languageIds',
|
|
1679
1678
|
'Associates languages to icons. The object key is the language id as defined in the language contribution point.'
|
|
1680
|
-
))
|
|
1679
|
+
)),
|
|
1681
1680
|
additionalProperties: {
|
|
1682
1681
|
type: 'string',
|
|
1683
|
-
description: (
|
|
1682
|
+
description: ( localize('schema.languageId', 'The ID of the icon definition for the association.'))
|
|
1684
1683
|
}
|
|
1685
1684
|
},
|
|
1686
1685
|
associations: {
|
|
@@ -1716,35 +1715,35 @@ const schema = {
|
|
|
1716
1715
|
properties: {
|
|
1717
1716
|
fonts: {
|
|
1718
1717
|
type: 'array',
|
|
1719
|
-
description: (
|
|
1718
|
+
description: ( localize('schema.fonts', 'Fonts that are used in the icon definitions.')),
|
|
1720
1719
|
items: {
|
|
1721
1720
|
type: 'object',
|
|
1722
1721
|
properties: {
|
|
1723
1722
|
id: {
|
|
1724
1723
|
type: 'string',
|
|
1725
|
-
description: (
|
|
1724
|
+
description: ( localize('schema.id', 'The ID of the font.')),
|
|
1726
1725
|
pattern: fontIdRegex,
|
|
1727
|
-
patternErrorMessage: (
|
|
1726
|
+
patternErrorMessage: ( localize(
|
|
1728
1727
|
'schema.id.formatError',
|
|
1729
1728
|
'The ID must only contain letter, numbers, underscore and minus.'
|
|
1730
|
-
))
|
|
1729
|
+
))
|
|
1731
1730
|
},
|
|
1732
1731
|
src: {
|
|
1733
1732
|
type: 'array',
|
|
1734
|
-
description: (
|
|
1733
|
+
description: ( localize('schema.src', 'The location of the font.')),
|
|
1735
1734
|
items: {
|
|
1736
1735
|
type: 'object',
|
|
1737
1736
|
properties: {
|
|
1738
1737
|
path: {
|
|
1739
1738
|
type: 'string',
|
|
1740
|
-
description: (
|
|
1739
|
+
description: ( localize(
|
|
1741
1740
|
'schema.font-path',
|
|
1742
1741
|
'The font path, relative to the current file icon theme file.'
|
|
1743
|
-
))
|
|
1742
|
+
)),
|
|
1744
1743
|
},
|
|
1745
1744
|
format: {
|
|
1746
1745
|
type: 'string',
|
|
1747
|
-
description: (
|
|
1746
|
+
description: ( localize('schema.font-format', 'The format of the font.')),
|
|
1748
1747
|
enum: ['woff', 'woff2', 'truetype', 'opentype', 'embedded-opentype', 'svg']
|
|
1749
1748
|
}
|
|
1750
1749
|
},
|
|
@@ -1756,26 +1755,26 @@ const schema = {
|
|
|
1756
1755
|
},
|
|
1757
1756
|
weight: {
|
|
1758
1757
|
type: 'string',
|
|
1759
|
-
description: (
|
|
1758
|
+
description: ( localize(
|
|
1760
1759
|
'schema.font-weight',
|
|
1761
1760
|
'The weight of the font. See https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight for valid values.'
|
|
1762
|
-
))
|
|
1761
|
+
)),
|
|
1763
1762
|
pattern: fontWeightRegex
|
|
1764
1763
|
},
|
|
1765
1764
|
style: {
|
|
1766
1765
|
type: 'string',
|
|
1767
|
-
description: (
|
|
1766
|
+
description: ( localize(
|
|
1768
1767
|
'schema.font-style',
|
|
1769
1768
|
'The style of the font. See https://developer.mozilla.org/en-US/docs/Web/CSS/font-style for valid values.'
|
|
1770
|
-
))
|
|
1769
|
+
)),
|
|
1771
1770
|
pattern: fontStyleRegex
|
|
1772
1771
|
},
|
|
1773
1772
|
size: {
|
|
1774
1773
|
type: 'string',
|
|
1775
|
-
description: (
|
|
1774
|
+
description: ( localize(
|
|
1776
1775
|
'schema.font-size',
|
|
1777
1776
|
'The default size of the font. See https://developer.mozilla.org/en-US/docs/Web/CSS/font-size for valid values.'
|
|
1778
|
-
))
|
|
1777
|
+
)),
|
|
1779
1778
|
pattern: fontSizeRegex
|
|
1780
1779
|
}
|
|
1781
1780
|
},
|
|
@@ -1787,50 +1786,50 @@ const schema = {
|
|
|
1787
1786
|
},
|
|
1788
1787
|
iconDefinitions: {
|
|
1789
1788
|
type: 'object',
|
|
1790
|
-
description: (
|
|
1789
|
+
description: ( localize(
|
|
1791
1790
|
'schema.iconDefinitions',
|
|
1792
1791
|
'Description of all icons that can be used when associating files to icons.'
|
|
1793
|
-
))
|
|
1792
|
+
)),
|
|
1794
1793
|
additionalProperties: {
|
|
1795
1794
|
type: 'object',
|
|
1796
|
-
description: (
|
|
1795
|
+
description: ( localize(
|
|
1797
1796
|
'schema.iconDefinition',
|
|
1798
1797
|
'An icon definition. The object key is the ID of the definition.'
|
|
1799
|
-
))
|
|
1798
|
+
)),
|
|
1800
1799
|
properties: {
|
|
1801
1800
|
iconPath: {
|
|
1802
1801
|
type: 'string',
|
|
1803
|
-
description: (
|
|
1802
|
+
description: ( localize(
|
|
1804
1803
|
'schema.iconPath',
|
|
1805
1804
|
'When using a SVG or PNG: The path to the image. The path is relative to the icon set file.'
|
|
1806
|
-
))
|
|
1805
|
+
))
|
|
1807
1806
|
},
|
|
1808
1807
|
fontCharacter: {
|
|
1809
1808
|
type: 'string',
|
|
1810
|
-
description: (
|
|
1809
|
+
description: ( localize(
|
|
1811
1810
|
'schema.fontCharacter',
|
|
1812
1811
|
'When using a glyph font: The character in the font to use.'
|
|
1813
|
-
))
|
|
1812
|
+
))
|
|
1814
1813
|
},
|
|
1815
1814
|
fontColor: {
|
|
1816
1815
|
type: 'string',
|
|
1817
1816
|
format: 'color-hex',
|
|
1818
|
-
description: (
|
|
1817
|
+
description: ( localize('schema.fontColor', 'When using a glyph font: The color to use.'))
|
|
1819
1818
|
},
|
|
1820
1819
|
fontSize: {
|
|
1821
1820
|
type: 'string',
|
|
1822
|
-
description: (
|
|
1821
|
+
description: ( localize(
|
|
1823
1822
|
'schema.fontSize',
|
|
1824
1823
|
'When using a font: The font size in percentage to the text font. If not set, defaults to the size in the font definition.'
|
|
1825
|
-
))
|
|
1824
|
+
)),
|
|
1826
1825
|
pattern: fontSizeRegex
|
|
1827
1826
|
},
|
|
1828
1827
|
fontId: {
|
|
1829
1828
|
type: 'string',
|
|
1830
|
-
description: (
|
|
1829
|
+
description: ( localize(
|
|
1831
1830
|
'schema.fontId',
|
|
1832
1831
|
'When using a font: The id of the font. If not set, defaults to the first font definition.'
|
|
1833
|
-
))
|
|
1832
|
+
))
|
|
1834
1833
|
}
|
|
1835
1834
|
}
|
|
1836
1835
|
}
|
|
@@ -1861,36 +1860,36 @@ const schema = {
|
|
|
1861
1860
|
},
|
|
1862
1861
|
light: {
|
|
1863
1862
|
$ref: '#/definitions/associations',
|
|
1864
|
-
description: (
|
|
1863
|
+
description: ( localize(
|
|
1865
1864
|
'schema.light',
|
|
1866
1865
|
'Optional associations for file icons in light color themes.'
|
|
1867
|
-
))
|
|
1866
|
+
))
|
|
1868
1867
|
},
|
|
1869
1868
|
highContrast: {
|
|
1870
1869
|
$ref: '#/definitions/associations',
|
|
1871
|
-
description: (
|
|
1870
|
+
description: ( localize(
|
|
1872
1871
|
'schema.highContrast',
|
|
1873
1872
|
'Optional associations for file icons in high contrast color themes.'
|
|
1874
|
-
))
|
|
1873
|
+
))
|
|
1875
1874
|
},
|
|
1876
1875
|
hidesExplorerArrows: {
|
|
1877
1876
|
type: 'boolean',
|
|
1878
|
-
description: (
|
|
1877
|
+
description: ( localize(
|
|
1879
1878
|
'schema.hidesExplorerArrows',
|
|
1880
1879
|
'Configures whether the file explorer\'s arrows should be hidden when this theme is active.'
|
|
1881
|
-
))
|
|
1880
|
+
))
|
|
1882
1881
|
},
|
|
1883
1882
|
showLanguageModeIcons: {
|
|
1884
1883
|
type: 'boolean',
|
|
1885
|
-
description: (
|
|
1884
|
+
description: ( localize(
|
|
1886
1885
|
'schema.showLanguageModeIcons',
|
|
1887
1886
|
'Configures whether the default language icons should be used if the theme does not define an icon for a language.'
|
|
1888
|
-
))
|
|
1887
|
+
))
|
|
1889
1888
|
}
|
|
1890
1889
|
}
|
|
1891
1890
|
};
|
|
1892
1891
|
function registerFileIconThemeSchemas() {
|
|
1893
|
-
const schemaRegistry = (
|
|
1892
|
+
const schemaRegistry = ( Registry.as(Extensions$1.JSONContribution));
|
|
1894
1893
|
schemaRegistry.registerSchema(schemaId, schema);
|
|
1895
1894
|
}
|
|
1896
1895
|
class FileIconThemeData {
|
|
@@ -1916,7 +1915,7 @@ class FileIconThemeData {
|
|
|
1916
1915
|
const id = extensionData.extensionId + '-' + iconTheme.id;
|
|
1917
1916
|
const label = iconTheme.label || basename(iconTheme.path);
|
|
1918
1917
|
const settingsId = iconTheme.id;
|
|
1919
|
-
const themeData = (
|
|
1918
|
+
const themeData = ( new FileIconThemeData(id, label, settingsId));
|
|
1920
1919
|
themeData.description = iconTheme.description;
|
|
1921
1920
|
themeData.location = iconThemeLocation;
|
|
1922
1921
|
themeData.extensionData = extensionData;
|
|
@@ -1927,7 +1926,7 @@ class FileIconThemeData {
|
|
|
1927
1926
|
static get noIconTheme() {
|
|
1928
1927
|
let themeData = FileIconThemeData._noIconTheme;
|
|
1929
1928
|
if (!themeData) {
|
|
1930
|
-
themeData = FileIconThemeData._noIconTheme = (
|
|
1929
|
+
themeData = FileIconThemeData._noIconTheme = ( new FileIconThemeData('', '', null));
|
|
1931
1930
|
themeData.hasFileIcons = false;
|
|
1932
1931
|
themeData.hasFolderIcons = false;
|
|
1933
1932
|
themeData.hidesExplorerArrows = false;
|
|
@@ -1938,7 +1937,7 @@ class FileIconThemeData {
|
|
|
1938
1937
|
return themeData;
|
|
1939
1938
|
}
|
|
1940
1939
|
static createUnloadedTheme(id) {
|
|
1941
|
-
const themeData = (
|
|
1940
|
+
const themeData = ( new FileIconThemeData(id, '', '__' + id));
|
|
1942
1941
|
themeData.isLoaded = false;
|
|
1943
1942
|
themeData.hasFileIcons = false;
|
|
1944
1943
|
themeData.hasFolderIcons = false;
|
|
@@ -1954,7 +1953,7 @@ class FileIconThemeData {
|
|
|
1954
1953
|
}
|
|
1955
1954
|
try {
|
|
1956
1955
|
const data = JSON.parse(input);
|
|
1957
|
-
const theme = (
|
|
1956
|
+
const theme = ( new FileIconThemeData('', '', null));
|
|
1958
1957
|
for (const key in data) {
|
|
1959
1958
|
switch (key) {
|
|
1960
1959
|
case 'id':
|
|
@@ -2023,17 +2022,17 @@ class FileIconThemeLoader {
|
|
|
2023
2022
|
const errors = [];
|
|
2024
2023
|
const contentValue = parse$1(content, errors);
|
|
2025
2024
|
if (errors.length > 0) {
|
|
2026
|
-
return Promise.reject((
|
|
2025
|
+
return Promise.reject(( new Error(( localize(
|
|
2027
2026
|
'error.cannotparseicontheme',
|
|
2028
2027
|
"Problems parsing file icons file: {0}",
|
|
2029
2028
|
errors.map(e => getParseErrorMessage(e.error)).join(', ')
|
|
2030
|
-
)))))
|
|
2029
|
+
)))));
|
|
2031
2030
|
}
|
|
2032
2031
|
else if (getNodeType(contentValue) !== 'object') {
|
|
2033
|
-
return Promise.reject((
|
|
2032
|
+
return Promise.reject(( new Error(( localize(
|
|
2034
2033
|
'error.invalidformat',
|
|
2035
2034
|
"Invalid format for file icons theme file: Object expected."
|
|
2036
|
-
)))))
|
|
2035
|
+
)))));
|
|
2037
2036
|
}
|
|
2038
2037
|
return Promise.resolve(contentValue);
|
|
2039
2038
|
});
|
|
@@ -2168,7 +2167,7 @@ class FileIconThemeLoader {
|
|
|
2168
2167
|
const showLanguageModeIcons = iconThemeDocument.showLanguageModeIcons === true || (hasSpecificFileIcons && iconThemeDocument.showLanguageModeIcons !== false);
|
|
2169
2168
|
const cssRules = [];
|
|
2170
2169
|
const fonts = iconThemeDocument.fonts;
|
|
2171
|
-
const fontSizes = (
|
|
2170
|
+
const fontSizes = ( new Map());
|
|
2172
2171
|
if (Array.isArray(fonts)) {
|
|
2173
2172
|
const defaultFontSize = fonts[0].size || '150%';
|
|
2174
2173
|
fonts.forEach(font => {
|
|
@@ -2359,34 +2358,34 @@ const textmateColorSchema = {
|
|
|
2359
2358
|
},
|
|
2360
2359
|
settings: {
|
|
2361
2360
|
type: 'object',
|
|
2362
|
-
description: (
|
|
2361
|
+
description: ( localize('schema.token.settings', 'Colors and styles for the token.')),
|
|
2363
2362
|
properties: {
|
|
2364
2363
|
foreground: {
|
|
2365
2364
|
type: 'string',
|
|
2366
|
-
description: (
|
|
2365
|
+
description: ( localize('schema.token.foreground', 'Foreground color for the token.')),
|
|
2367
2366
|
format: 'color-hex',
|
|
2368
2367
|
default: '#ff0000'
|
|
2369
2368
|
},
|
|
2370
2369
|
background: {
|
|
2371
2370
|
type: 'string',
|
|
2372
|
-
deprecationMessage: (
|
|
2371
|
+
deprecationMessage: ( localize(
|
|
2373
2372
|
'schema.token.background.warning',
|
|
2374
2373
|
'Token background colors are currently not supported.'
|
|
2375
|
-
))
|
|
2374
|
+
))
|
|
2376
2375
|
},
|
|
2377
2376
|
fontStyle: {
|
|
2378
2377
|
type: 'string',
|
|
2379
|
-
description: (
|
|
2378
|
+
description: ( localize(
|
|
2380
2379
|
'schema.token.fontStyle',
|
|
2381
2380
|
'Font style of the rule: \'italic\', \'bold\', \'underline\', \'strikethrough\' or a combination. The empty string unsets inherited settings.'
|
|
2382
|
-
))
|
|
2381
|
+
)),
|
|
2383
2382
|
pattern: '^(\\s*\\b(italic|bold|underline|strikethrough))*\\s*$',
|
|
2384
|
-
patternErrorMessage: (
|
|
2383
|
+
patternErrorMessage: ( localize(
|
|
2385
2384
|
'schema.fontStyle.error',
|
|
2386
2385
|
'Font style must be \'italic\', \'bold\', \'underline\', \'strikethrough\' or a combination or the empty string.'
|
|
2387
|
-
))
|
|
2386
|
+
)),
|
|
2388
2387
|
defaultSnippets: [
|
|
2389
|
-
{ label: (
|
|
2388
|
+
{ label: ( localize('schema.token.fontStyle.none', 'None (clear inherited style)')), bodyText: '""' },
|
|
2390
2389
|
{ body: 'italic' },
|
|
2391
2390
|
{ body: 'bold' },
|
|
2392
2391
|
{ body: 'underline' },
|
|
@@ -2415,13 +2414,13 @@ const textmateColorSchema = {
|
|
|
2415
2414
|
properties: {
|
|
2416
2415
|
name: {
|
|
2417
2416
|
type: 'string',
|
|
2418
|
-
description: (
|
|
2417
|
+
description: ( localize('schema.properties.name', 'Description of the rule.'))
|
|
2419
2418
|
},
|
|
2420
2419
|
scope: {
|
|
2421
|
-
description: (
|
|
2420
|
+
description: ( localize(
|
|
2422
2421
|
'schema.properties.scope',
|
|
2423
2422
|
'Scope selector against which this rule matches.'
|
|
2424
|
-
))
|
|
2423
|
+
)),
|
|
2425
2424
|
anyOf: [
|
|
2426
2425
|
{
|
|
2427
2426
|
enum: textMateScopes
|
|
@@ -2460,172 +2459,166 @@ const colorThemeSchema = {
|
|
|
2460
2459
|
allowTrailingCommas: true,
|
|
2461
2460
|
properties: {
|
|
2462
2461
|
colors: {
|
|
2463
|
-
description: (
|
|
2462
|
+
description: ( localize('schema.workbenchColors', 'Colors in the workbench')),
|
|
2464
2463
|
$ref: workbenchColorsSchemaId,
|
|
2465
2464
|
additionalProperties: false
|
|
2466
2465
|
},
|
|
2467
2466
|
tokenColors: {
|
|
2468
2467
|
anyOf: [{
|
|
2469
2468
|
type: 'string',
|
|
2470
|
-
description: (
|
|
2469
|
+
description: ( localize(
|
|
2471
2470
|
'schema.tokenColors.path',
|
|
2472
2471
|
'Path to a tmTheme file (relative to the current file).'
|
|
2473
|
-
))
|
|
2472
|
+
))
|
|
2474
2473
|
},
|
|
2475
2474
|
{
|
|
2476
|
-
description: (
|
|
2475
|
+
description: ( localize('schema.colors', 'Colors for syntax highlighting')),
|
|
2477
2476
|
$ref: textmateColorsSchemaId
|
|
2478
2477
|
}
|
|
2479
2478
|
]
|
|
2480
2479
|
},
|
|
2481
2480
|
semanticHighlighting: {
|
|
2482
2481
|
type: 'boolean',
|
|
2483
|
-
description: (
|
|
2482
|
+
description: ( localize(
|
|
2484
2483
|
'schema.supportsSemanticHighlighting',
|
|
2485
2484
|
'Whether semantic highlighting should be enabled for this theme.'
|
|
2486
|
-
))
|
|
2485
|
+
))
|
|
2487
2486
|
},
|
|
2488
2487
|
semanticTokenColors: {
|
|
2489
2488
|
type: 'object',
|
|
2490
|
-
description: (
|
|
2489
|
+
description: ( localize('schema.semanticTokenColors', 'Colors for semantic tokens')),
|
|
2491
2490
|
$ref: tokenStylingSchemaId
|
|
2492
2491
|
}
|
|
2493
2492
|
}
|
|
2494
2493
|
};
|
|
2495
2494
|
function registerColorThemeSchemas() {
|
|
2496
|
-
const schemaRegistry = (
|
|
2495
|
+
const schemaRegistry = ( Registry.as(Extensions$1.JSONContribution));
|
|
2497
2496
|
schemaRegistry.registerSchema(colorThemeSchemaId, colorThemeSchema);
|
|
2498
2497
|
schemaRegistry.registerSchema(textmateColorsSchemaId, textmateColorSchema);
|
|
2499
2498
|
}
|
|
2500
2499
|
function registerColorThemeExtensionPoint() {
|
|
2501
|
-
return (
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
type: 'string'
|
|
2520
|
-
},
|
|
2521
|
-
label: {
|
|
2522
|
-
description: ( (localize(
|
|
2523
|
-
'vscode.extension.contributes.themes.label',
|
|
2524
|
-
'Label of the color theme as shown in the UI.'
|
|
2525
|
-
))),
|
|
2526
|
-
type: 'string'
|
|
2527
|
-
},
|
|
2528
|
-
uiTheme: {
|
|
2529
|
-
description: ( (localize(
|
|
2530
|
-
'vscode.extension.contributes.themes.uiTheme',
|
|
2531
|
-
'Base theme defining the colors around the editor: \'vs\' is the light color theme, \'vs-dark\' is the dark color theme. \'hc-black\' is the dark high contrast theme, \'hc-light\' is the light high contrast theme.'
|
|
2532
|
-
))),
|
|
2533
|
-
enum: [VS_LIGHT_THEME, VS_DARK_THEME, VS_HC_THEME, VS_HC_LIGHT_THEME]
|
|
2534
|
-
},
|
|
2535
|
-
path: {
|
|
2536
|
-
description: ( (localize(
|
|
2537
|
-
'vscode.extension.contributes.themes.path',
|
|
2538
|
-
'Path of the tmTheme file. The path is relative to the extension folder and is typically \'./colorthemes/awesome-color-theme.json\'.'
|
|
2539
|
-
))),
|
|
2540
|
-
type: 'string'
|
|
2541
|
-
}
|
|
2500
|
+
return ( ExtensionsRegistry.registerExtensionPoint({
|
|
2501
|
+
extensionPoint: 'themes',
|
|
2502
|
+
jsonSchema: {
|
|
2503
|
+
description: ( localize(
|
|
2504
|
+
'vscode.extension.contributes.themes',
|
|
2505
|
+
'Contributes textmate color themes.'
|
|
2506
|
+
)),
|
|
2507
|
+
type: 'array',
|
|
2508
|
+
items: {
|
|
2509
|
+
type: 'object',
|
|
2510
|
+
defaultSnippets: [{ body: { label: '${1:label}', id: '${2:id}', uiTheme: VS_DARK_THEME, path: './themes/${3:id}.tmTheme.' } }],
|
|
2511
|
+
properties: {
|
|
2512
|
+
id: {
|
|
2513
|
+
description: ( localize(
|
|
2514
|
+
'vscode.extension.contributes.themes.id',
|
|
2515
|
+
'Id of the color theme as used in the user settings.'
|
|
2516
|
+
)),
|
|
2517
|
+
type: 'string'
|
|
2542
2518
|
},
|
|
2543
|
-
|
|
2544
|
-
|
|
2519
|
+
label: {
|
|
2520
|
+
description: ( localize(
|
|
2521
|
+
'vscode.extension.contributes.themes.label',
|
|
2522
|
+
'Label of the color theme as shown in the UI.'
|
|
2523
|
+
)),
|
|
2524
|
+
type: 'string'
|
|
2525
|
+
},
|
|
2526
|
+
uiTheme: {
|
|
2527
|
+
description: ( localize(
|
|
2528
|
+
'vscode.extension.contributes.themes.uiTheme',
|
|
2529
|
+
'Base theme defining the colors around the editor: \'vs\' is the light color theme, \'vs-dark\' is the dark color theme. \'hc-black\' is the dark high contrast theme, \'hc-light\' is the light high contrast theme.'
|
|
2530
|
+
)),
|
|
2531
|
+
enum: [VS_LIGHT_THEME, VS_DARK_THEME, VS_HC_THEME, VS_HC_LIGHT_THEME]
|
|
2532
|
+
},
|
|
2533
|
+
path: {
|
|
2534
|
+
description: ( localize(
|
|
2535
|
+
'vscode.extension.contributes.themes.path',
|
|
2536
|
+
'Path of the tmTheme file. The path is relative to the extension folder and is typically \'./colorthemes/awesome-color-theme.json\'.'
|
|
2537
|
+
)),
|
|
2538
|
+
type: 'string'
|
|
2539
|
+
}
|
|
2540
|
+
},
|
|
2541
|
+
required: ['path', 'uiTheme']
|
|
2545
2542
|
}
|
|
2546
|
-
}
|
|
2547
|
-
);
|
|
2543
|
+
}
|
|
2544
|
+
}));
|
|
2548
2545
|
}
|
|
2549
2546
|
function registerFileIconThemeExtensionPoint() {
|
|
2550
|
-
return (
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
type: 'string'
|
|
2566
|
-
},
|
|
2567
|
-
label: {
|
|
2568
|
-
description: ( (localize(
|
|
2569
|
-
'vscode.extension.contributes.iconThemes.label',
|
|
2570
|
-
'Label of the file icon theme as shown in the UI.'
|
|
2571
|
-
))),
|
|
2572
|
-
type: 'string'
|
|
2573
|
-
},
|
|
2574
|
-
path: {
|
|
2575
|
-
description: ( (localize(
|
|
2576
|
-
'vscode.extension.contributes.iconThemes.path',
|
|
2577
|
-
'Path of the file icon theme definition file. The path is relative to the extension folder and is typically \'./fileicons/awesome-icon-theme.json\'.'
|
|
2578
|
-
))),
|
|
2579
|
-
type: 'string'
|
|
2580
|
-
}
|
|
2547
|
+
return ( ExtensionsRegistry.registerExtensionPoint({
|
|
2548
|
+
extensionPoint: 'iconThemes',
|
|
2549
|
+
jsonSchema: {
|
|
2550
|
+
description: ( localize('vscode.extension.contributes.iconThemes', 'Contributes file icon themes.')),
|
|
2551
|
+
type: 'array',
|
|
2552
|
+
items: {
|
|
2553
|
+
type: 'object',
|
|
2554
|
+
defaultSnippets: [{ body: { id: '${1:id}', label: '${2:label}', path: './fileicons/${3:id}-icon-theme.json' } }],
|
|
2555
|
+
properties: {
|
|
2556
|
+
id: {
|
|
2557
|
+
description: ( localize(
|
|
2558
|
+
'vscode.extension.contributes.iconThemes.id',
|
|
2559
|
+
'Id of the file icon theme as used in the user settings.'
|
|
2560
|
+
)),
|
|
2561
|
+
type: 'string'
|
|
2581
2562
|
},
|
|
2582
|
-
|
|
2583
|
-
|
|
2563
|
+
label: {
|
|
2564
|
+
description: ( localize(
|
|
2565
|
+
'vscode.extension.contributes.iconThemes.label',
|
|
2566
|
+
'Label of the file icon theme as shown in the UI.'
|
|
2567
|
+
)),
|
|
2568
|
+
type: 'string'
|
|
2569
|
+
},
|
|
2570
|
+
path: {
|
|
2571
|
+
description: ( localize(
|
|
2572
|
+
'vscode.extension.contributes.iconThemes.path',
|
|
2573
|
+
'Path of the file icon theme definition file. The path is relative to the extension folder and is typically \'./fileicons/awesome-icon-theme.json\'.'
|
|
2574
|
+
)),
|
|
2575
|
+
type: 'string'
|
|
2576
|
+
}
|
|
2577
|
+
},
|
|
2578
|
+
required: ['path', 'id']
|
|
2584
2579
|
}
|
|
2585
|
-
}
|
|
2586
|
-
);
|
|
2580
|
+
}
|
|
2581
|
+
}));
|
|
2587
2582
|
}
|
|
2588
2583
|
function registerProductIconThemeExtensionPoint() {
|
|
2589
|
-
return (
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
type: 'string'
|
|
2608
|
-
},
|
|
2609
|
-
label: {
|
|
2610
|
-
description: ( (localize(
|
|
2611
|
-
'vscode.extension.contributes.productIconThemes.label',
|
|
2612
|
-
'Label of the product icon theme as shown in the UI.'
|
|
2613
|
-
))),
|
|
2614
|
-
type: 'string'
|
|
2615
|
-
},
|
|
2616
|
-
path: {
|
|
2617
|
-
description: ( (localize(
|
|
2618
|
-
'vscode.extension.contributes.productIconThemes.path',
|
|
2619
|
-
'Path of the product icon theme definition file. The path is relative to the extension folder and is typically \'./producticons/awesome-product-icon-theme.json\'.'
|
|
2620
|
-
))),
|
|
2621
|
-
type: 'string'
|
|
2622
|
-
}
|
|
2584
|
+
return ( ExtensionsRegistry.registerExtensionPoint({
|
|
2585
|
+
extensionPoint: 'productIconThemes',
|
|
2586
|
+
jsonSchema: {
|
|
2587
|
+
description: ( localize(
|
|
2588
|
+
'vscode.extension.contributes.productIconThemes',
|
|
2589
|
+
'Contributes product icon themes.'
|
|
2590
|
+
)),
|
|
2591
|
+
type: 'array',
|
|
2592
|
+
items: {
|
|
2593
|
+
type: 'object',
|
|
2594
|
+
defaultSnippets: [{ body: { id: '${1:id}', label: '${2:label}', path: './producticons/${3:id}-product-icon-theme.json' } }],
|
|
2595
|
+
properties: {
|
|
2596
|
+
id: {
|
|
2597
|
+
description: ( localize(
|
|
2598
|
+
'vscode.extension.contributes.productIconThemes.id',
|
|
2599
|
+
'Id of the product icon theme as used in the user settings.'
|
|
2600
|
+
)),
|
|
2601
|
+
type: 'string'
|
|
2623
2602
|
},
|
|
2624
|
-
|
|
2625
|
-
|
|
2603
|
+
label: {
|
|
2604
|
+
description: ( localize(
|
|
2605
|
+
'vscode.extension.contributes.productIconThemes.label',
|
|
2606
|
+
'Label of the product icon theme as shown in the UI.'
|
|
2607
|
+
)),
|
|
2608
|
+
type: 'string'
|
|
2609
|
+
},
|
|
2610
|
+
path: {
|
|
2611
|
+
description: ( localize(
|
|
2612
|
+
'vscode.extension.contributes.productIconThemes.path',
|
|
2613
|
+
'Path of the product icon theme definition file. The path is relative to the extension folder and is typically \'./producticons/awesome-product-icon-theme.json\'.'
|
|
2614
|
+
)),
|
|
2615
|
+
type: 'string'
|
|
2616
|
+
}
|
|
2617
|
+
},
|
|
2618
|
+
required: ['path', 'id']
|
|
2626
2619
|
}
|
|
2627
|
-
}
|
|
2628
|
-
);
|
|
2620
|
+
}
|
|
2621
|
+
}));
|
|
2629
2622
|
}
|
|
2630
2623
|
class ThemeRegistry {
|
|
2631
2624
|
constructor(themesExtPoint, create, idRequired = false, builtInTheme = undefined) {
|
|
@@ -2633,7 +2626,7 @@ class ThemeRegistry {
|
|
|
2633
2626
|
this.create = create;
|
|
2634
2627
|
this.idRequired = idRequired;
|
|
2635
2628
|
this.builtInTheme = builtInTheme;
|
|
2636
|
-
this.onDidChangeEmitter = (
|
|
2629
|
+
this.onDidChangeEmitter = ( new Emitter());
|
|
2637
2630
|
this.onDidChange = this.onDidChangeEmitter.event;
|
|
2638
2631
|
this.extensionThemes = [];
|
|
2639
2632
|
this.initialize();
|
|
@@ -2658,47 +2651,47 @@ class ThemeRegistry {
|
|
|
2658
2651
|
delete previousIds[theme.id];
|
|
2659
2652
|
}
|
|
2660
2653
|
}
|
|
2661
|
-
const removed = (
|
|
2654
|
+
const removed = ( Object.values(previousIds));
|
|
2662
2655
|
this.onDidChangeEmitter.fire({ themes: this.extensionThemes, added, removed });
|
|
2663
2656
|
});
|
|
2664
2657
|
}
|
|
2665
2658
|
onThemes(extensionData, extensionLocation, themeContributions, resultingThemes = [], log) {
|
|
2666
2659
|
if (!Array.isArray(themeContributions)) {
|
|
2667
|
-
log?.error((
|
|
2660
|
+
log?.error(( localize(
|
|
2668
2661
|
'reqarray',
|
|
2669
2662
|
"Extension point `{0}` must be an array.",
|
|
2670
2663
|
this.themesExtPoint.name
|
|
2671
|
-
)))
|
|
2664
|
+
)));
|
|
2672
2665
|
return resultingThemes;
|
|
2673
2666
|
}
|
|
2674
2667
|
themeContributions.forEach(theme => {
|
|
2675
2668
|
if (!theme.path || !isString(theme.path)) {
|
|
2676
|
-
log?.error((
|
|
2669
|
+
log?.error(( localize(
|
|
2677
2670
|
'reqpath',
|
|
2678
2671
|
"Expected string in `contributes.{0}.path`. Provided value: {1}",
|
|
2679
2672
|
this.themesExtPoint.name,
|
|
2680
2673
|
String(theme.path)
|
|
2681
|
-
)))
|
|
2674
|
+
)));
|
|
2682
2675
|
return;
|
|
2683
2676
|
}
|
|
2684
2677
|
if (this.idRequired && (!theme.id || !isString(theme.id))) {
|
|
2685
|
-
log?.error((
|
|
2678
|
+
log?.error(( localize(
|
|
2686
2679
|
'reqid',
|
|
2687
2680
|
"Expected string in `contributes.{0}.id`. Provided value: {1}",
|
|
2688
2681
|
this.themesExtPoint.name,
|
|
2689
2682
|
String(theme.id)
|
|
2690
|
-
)))
|
|
2683
|
+
)));
|
|
2691
2684
|
return;
|
|
2692
2685
|
}
|
|
2693
2686
|
const themeLocation = joinPath(extensionLocation, theme.path);
|
|
2694
2687
|
if (!isEqualOrParent(themeLocation, extensionLocation)) {
|
|
2695
|
-
log?.warn((
|
|
2688
|
+
log?.warn(( localize(
|
|
2696
2689
|
'invalid.path.1',
|
|
2697
2690
|
"Expected `contributes.{0}.path` ({1}) to be included inside extension's folder ({2}). This might make the extension non-portable.",
|
|
2698
2691
|
this.themesExtPoint.name,
|
|
2699
2692
|
themeLocation.path,
|
|
2700
2693
|
extensionLocation.path
|
|
2701
|
-
)))
|
|
2694
|
+
)));
|
|
2702
2695
|
}
|
|
2703
2696
|
const themeData = this.create(theme, themeLocation, extensionData);
|
|
2704
2697
|
resultingThemes.push(themeData);
|
|
@@ -2760,87 +2753,87 @@ const DEFAULT_THEME_HC_DARK_SETTING_VALUE = 'Default High Contrast';
|
|
|
2760
2753
|
const DEFAULT_THEME_HC_LIGHT_SETTING_VALUE = 'Default High Contrast Light';
|
|
2761
2754
|
const DEFAULT_FILE_ICON_THEME_SETTING_VALUE = 'vs-seti';
|
|
2762
2755
|
const DEFAULT_PRODUCT_ICON_THEME_SETTING_VALUE = 'Default';
|
|
2763
|
-
const configurationRegistry = (
|
|
2756
|
+
const configurationRegistry = ( Registry.as(Extensions$2.Configuration));
|
|
2764
2757
|
const colorThemeSettingEnum = [];
|
|
2765
2758
|
const colorThemeSettingEnumItemLabels = [];
|
|
2766
2759
|
const colorThemeSettingEnumDescriptions = [];
|
|
2767
2760
|
const colorThemeSettingSchema = {
|
|
2768
2761
|
type: 'string',
|
|
2769
|
-
description: (
|
|
2762
|
+
description: ( localize('colorTheme', "Specifies the color theme used in the workbench.")),
|
|
2770
2763
|
default: isWeb ? DEFAULT_THEME_LIGHT_SETTING_VALUE : DEFAULT_THEME_DARK_SETTING_VALUE,
|
|
2771
2764
|
enum: colorThemeSettingEnum,
|
|
2772
2765
|
enumDescriptions: colorThemeSettingEnumDescriptions,
|
|
2773
2766
|
enumItemLabels: colorThemeSettingEnumItemLabels,
|
|
2774
|
-
errorMessage: (
|
|
2767
|
+
errorMessage: ( localize('colorThemeError', "Theme is unknown or not installed.")),
|
|
2775
2768
|
};
|
|
2776
2769
|
const preferredDarkThemeSettingSchema = {
|
|
2777
2770
|
type: 'string',
|
|
2778
|
-
markdownDescription: (
|
|
2771
|
+
markdownDescription: ( localize(
|
|
2779
2772
|
{ key: 'preferredDarkColorTheme', comment: ['`#{0}#` will become a link to an other setting. Do not remove backtick or #'] },
|
|
2780
2773
|
'Specifies the preferred color theme for dark OS appearance when `#{0}#` is enabled.',
|
|
2781
2774
|
ThemeSettings.DETECT_COLOR_SCHEME
|
|
2782
|
-
))
|
|
2775
|
+
)),
|
|
2783
2776
|
default: DEFAULT_THEME_DARK_SETTING_VALUE,
|
|
2784
2777
|
enum: colorThemeSettingEnum,
|
|
2785
2778
|
enumDescriptions: colorThemeSettingEnumDescriptions,
|
|
2786
2779
|
enumItemLabels: colorThemeSettingEnumItemLabels,
|
|
2787
|
-
errorMessage: (
|
|
2780
|
+
errorMessage: ( localize('colorThemeError', "Theme is unknown or not installed.")),
|
|
2788
2781
|
};
|
|
2789
2782
|
const preferredLightThemeSettingSchema = {
|
|
2790
2783
|
type: 'string',
|
|
2791
|
-
markdownDescription: (
|
|
2784
|
+
markdownDescription: ( localize(
|
|
2792
2785
|
{ key: 'preferredLightColorTheme', comment: ['`#{0}#` will become a link to an other setting. Do not remove backtick or #'] },
|
|
2793
2786
|
'Specifies the preferred color theme for light OS appearance when `#{0}#` is enabled.',
|
|
2794
2787
|
ThemeSettings.DETECT_COLOR_SCHEME
|
|
2795
|
-
))
|
|
2788
|
+
)),
|
|
2796
2789
|
default: DEFAULT_THEME_LIGHT_SETTING_VALUE,
|
|
2797
2790
|
enum: colorThemeSettingEnum,
|
|
2798
2791
|
enumDescriptions: colorThemeSettingEnumDescriptions,
|
|
2799
2792
|
enumItemLabels: colorThemeSettingEnumItemLabels,
|
|
2800
|
-
errorMessage: (
|
|
2793
|
+
errorMessage: ( localize('colorThemeError', "Theme is unknown or not installed.")),
|
|
2801
2794
|
};
|
|
2802
2795
|
const preferredHCDarkThemeSettingSchema = {
|
|
2803
2796
|
type: 'string',
|
|
2804
|
-
markdownDescription: (
|
|
2797
|
+
markdownDescription: ( localize(
|
|
2805
2798
|
{ key: 'preferredHCDarkColorTheme', comment: ['`#{0}#` will become a link to an other setting. Do not remove backtick or #'] },
|
|
2806
2799
|
'Specifies the preferred color theme used in high contrast dark mode when `#{0}#` is enabled.',
|
|
2807
2800
|
ThemeSettings.DETECT_HC
|
|
2808
|
-
))
|
|
2801
|
+
)),
|
|
2809
2802
|
default: DEFAULT_THEME_HC_DARK_SETTING_VALUE,
|
|
2810
2803
|
enum: colorThemeSettingEnum,
|
|
2811
2804
|
enumDescriptions: colorThemeSettingEnumDescriptions,
|
|
2812
2805
|
enumItemLabels: colorThemeSettingEnumItemLabels,
|
|
2813
|
-
errorMessage: (
|
|
2806
|
+
errorMessage: ( localize('colorThemeError', "Theme is unknown or not installed.")),
|
|
2814
2807
|
};
|
|
2815
2808
|
const preferredHCLightThemeSettingSchema = {
|
|
2816
2809
|
type: 'string',
|
|
2817
|
-
markdownDescription: (
|
|
2810
|
+
markdownDescription: ( localize(
|
|
2818
2811
|
{ key: 'preferredHCLightColorTheme', comment: ['`#{0}#` will become a link to an other setting. Do not remove backtick or #'] },
|
|
2819
2812
|
'Specifies the preferred color theme used in high contrast light mode when `#{0}#` is enabled.',
|
|
2820
2813
|
ThemeSettings.DETECT_HC
|
|
2821
|
-
))
|
|
2814
|
+
)),
|
|
2822
2815
|
default: DEFAULT_THEME_HC_LIGHT_SETTING_VALUE,
|
|
2823
2816
|
enum: colorThemeSettingEnum,
|
|
2824
2817
|
enumDescriptions: colorThemeSettingEnumDescriptions,
|
|
2825
2818
|
enumItemLabels: colorThemeSettingEnumItemLabels,
|
|
2826
|
-
errorMessage: (
|
|
2819
|
+
errorMessage: ( localize('colorThemeError', "Theme is unknown or not installed.")),
|
|
2827
2820
|
};
|
|
2828
2821
|
const detectColorSchemeSettingSchema = {
|
|
2829
2822
|
type: 'boolean',
|
|
2830
|
-
markdownDescription: (
|
|
2823
|
+
markdownDescription: ( localize(
|
|
2831
2824
|
'detectColorScheme',
|
|
2832
2825
|
'If set, automatically switch to the preferred color theme based on the OS appearance. If the OS appearance is dark, the theme specified at `#{0}#` is used, for light `#{1}#`.',
|
|
2833
2826
|
ThemeSettings.PREFERRED_DARK_THEME,
|
|
2834
2827
|
ThemeSettings.PREFERRED_LIGHT_THEME
|
|
2835
|
-
))
|
|
2828
|
+
)),
|
|
2836
2829
|
default: false
|
|
2837
2830
|
};
|
|
2838
2831
|
const colorCustomizationsSchema = {
|
|
2839
2832
|
type: 'object',
|
|
2840
|
-
description: (
|
|
2833
|
+
description: ( localize(
|
|
2841
2834
|
'workbenchColors',
|
|
2842
2835
|
"Overrides colors from the currently selected color theme."
|
|
2843
|
-
))
|
|
2836
|
+
)),
|
|
2844
2837
|
allOf: [{ $ref: workbenchColorsSchemaId }],
|
|
2845
2838
|
default: {},
|
|
2846
2839
|
defaultSnippets: [{
|
|
@@ -2850,33 +2843,33 @@ const colorCustomizationsSchema = {
|
|
|
2850
2843
|
const fileIconThemeSettingSchema = {
|
|
2851
2844
|
type: ['string', 'null'],
|
|
2852
2845
|
default: DEFAULT_FILE_ICON_THEME_SETTING_VALUE,
|
|
2853
|
-
description: (
|
|
2846
|
+
description: ( localize(
|
|
2854
2847
|
'iconTheme',
|
|
2855
2848
|
"Specifies the file icon theme used in the workbench or 'null' to not show any file icons."
|
|
2856
|
-
))
|
|
2849
|
+
)),
|
|
2857
2850
|
enum: [null],
|
|
2858
|
-
enumItemLabels: [(
|
|
2859
|
-
enumDescriptions: [(
|
|
2860
|
-
errorMessage: (
|
|
2851
|
+
enumItemLabels: [( localize('noIconThemeLabel', 'None'))],
|
|
2852
|
+
enumDescriptions: [( localize('noIconThemeDesc', 'No file icons'))],
|
|
2853
|
+
errorMessage: ( localize('iconThemeError', "File icon theme is unknown or not installed."))
|
|
2861
2854
|
};
|
|
2862
2855
|
const productIconThemeSettingSchema = {
|
|
2863
2856
|
type: ['string', 'null'],
|
|
2864
2857
|
default: DEFAULT_PRODUCT_ICON_THEME_SETTING_VALUE,
|
|
2865
|
-
description: (
|
|
2858
|
+
description: ( localize('productIconTheme', "Specifies the product icon theme used.")),
|
|
2866
2859
|
enum: [DEFAULT_PRODUCT_ICON_THEME_SETTING_VALUE],
|
|
2867
|
-
enumItemLabels: [(
|
|
2868
|
-
enumDescriptions: [(
|
|
2869
|
-
errorMessage: (
|
|
2860
|
+
enumItemLabels: [( localize('defaultProductIconThemeLabel', 'Default'))],
|
|
2861
|
+
enumDescriptions: [( localize('defaultProductIconThemeDesc', 'Default'))],
|
|
2862
|
+
errorMessage: ( localize('productIconThemeError', "Product icon theme is unknown or not installed."))
|
|
2870
2863
|
};
|
|
2871
2864
|
const detectHCSchemeSettingSchema = {
|
|
2872
2865
|
type: 'boolean',
|
|
2873
2866
|
default: true,
|
|
2874
|
-
markdownDescription: (
|
|
2867
|
+
markdownDescription: ( localize(
|
|
2875
2868
|
'autoDetectHighContrast',
|
|
2876
2869
|
"If enabled, will automatically change to high contrast theme if the OS is using a high contrast theme. The high contrast theme to use is specified by `#{0}#` and `#{1}#`",
|
|
2877
2870
|
ThemeSettings.PREFERRED_HC_DARK_THEME,
|
|
2878
2871
|
ThemeSettings.PREFERRED_HC_LIGHT_THEME
|
|
2879
|
-
))
|
|
2872
|
+
)),
|
|
2880
2873
|
scope: 1
|
|
2881
2874
|
};
|
|
2882
2875
|
const themeSettingsConfiguration = {
|
|
@@ -2915,52 +2908,52 @@ const themeSpecificSettingKey = '^\\[[^\\]]*(\\]\\s*\\[[^\\]]*)*\\]$';
|
|
|
2915
2908
|
const tokenColorSchema = {
|
|
2916
2909
|
type: 'object',
|
|
2917
2910
|
properties: {
|
|
2918
|
-
comments: tokenGroupSettings((
|
|
2919
|
-
strings: tokenGroupSettings((
|
|
2920
|
-
keywords: tokenGroupSettings((
|
|
2921
|
-
numbers: tokenGroupSettings((
|
|
2922
|
-
types: tokenGroupSettings((
|
|
2911
|
+
comments: tokenGroupSettings(( localize('editorColors.comments', "Sets the colors and styles for comments"))),
|
|
2912
|
+
strings: tokenGroupSettings(( localize('editorColors.strings', "Sets the colors and styles for strings literals."))),
|
|
2913
|
+
keywords: tokenGroupSettings(( localize('editorColors.keywords', "Sets the colors and styles for keywords."))),
|
|
2914
|
+
numbers: tokenGroupSettings(( localize('editorColors.numbers', "Sets the colors and styles for number literals."))),
|
|
2915
|
+
types: tokenGroupSettings(( localize(
|
|
2923
2916
|
'editorColors.types',
|
|
2924
2917
|
"Sets the colors and styles for type declarations and references."
|
|
2925
|
-
)))
|
|
2926
|
-
functions: tokenGroupSettings((
|
|
2918
|
+
))),
|
|
2919
|
+
functions: tokenGroupSettings(( localize(
|
|
2927
2920
|
'editorColors.functions',
|
|
2928
2921
|
"Sets the colors and styles for functions declarations and references."
|
|
2929
|
-
)))
|
|
2930
|
-
variables: tokenGroupSettings((
|
|
2922
|
+
))),
|
|
2923
|
+
variables: tokenGroupSettings(( localize(
|
|
2931
2924
|
'editorColors.variables',
|
|
2932
2925
|
"Sets the colors and styles for variables declarations and references."
|
|
2933
|
-
)))
|
|
2926
|
+
))),
|
|
2934
2927
|
textMateRules: {
|
|
2935
|
-
description: (
|
|
2928
|
+
description: ( localize(
|
|
2936
2929
|
'editorColors.textMateRules',
|
|
2937
2930
|
'Sets colors and styles using textmate theming rules (advanced).'
|
|
2938
|
-
))
|
|
2931
|
+
)),
|
|
2939
2932
|
$ref: textmateColorsSchemaId
|
|
2940
2933
|
},
|
|
2941
2934
|
semanticHighlighting: {
|
|
2942
|
-
description: (
|
|
2935
|
+
description: ( localize(
|
|
2943
2936
|
'editorColors.semanticHighlighting',
|
|
2944
2937
|
'Whether semantic highlighting should be enabled for this theme.'
|
|
2945
|
-
))
|
|
2946
|
-
deprecationMessage: (
|
|
2938
|
+
)),
|
|
2939
|
+
deprecationMessage: ( localize(
|
|
2947
2940
|
'editorColors.semanticHighlighting.deprecationMessage',
|
|
2948
2941
|
'Use `enabled` in `editor.semanticTokenColorCustomizations` setting instead.'
|
|
2949
|
-
))
|
|
2950
|
-
markdownDeprecationMessage: (
|
|
2942
|
+
)),
|
|
2943
|
+
markdownDeprecationMessage: ( localize(
|
|
2951
2944
|
'editorColors.semanticHighlighting.deprecationMessageMarkdown',
|
|
2952
2945
|
'Use `enabled` in `#editor.semanticTokenColorCustomizations#` setting instead.'
|
|
2953
|
-
))
|
|
2946
|
+
)),
|
|
2954
2947
|
type: 'boolean'
|
|
2955
2948
|
}
|
|
2956
2949
|
},
|
|
2957
2950
|
additionalProperties: false
|
|
2958
2951
|
};
|
|
2959
2952
|
const tokenColorCustomizationSchema = {
|
|
2960
|
-
description: (
|
|
2953
|
+
description: ( localize(
|
|
2961
2954
|
'editorColors',
|
|
2962
2955
|
"Overrides editor syntax colors and font style from the currently selected color theme."
|
|
2963
|
-
))
|
|
2956
|
+
)),
|
|
2964
2957
|
default: {},
|
|
2965
2958
|
allOf: [{ ...tokenColorSchema, patternProperties: { '^\\[': {} } }]
|
|
2966
2959
|
};
|
|
@@ -2969,28 +2962,28 @@ const semanticTokenColorSchema = {
|
|
|
2969
2962
|
properties: {
|
|
2970
2963
|
enabled: {
|
|
2971
2964
|
type: 'boolean',
|
|
2972
|
-
description: (
|
|
2965
|
+
description: ( localize(
|
|
2973
2966
|
'editorColors.semanticHighlighting.enabled',
|
|
2974
2967
|
'Whether semantic highlighting is enabled or disabled for this theme'
|
|
2975
|
-
))
|
|
2968
|
+
)),
|
|
2976
2969
|
suggestSortText: '0_enabled'
|
|
2977
2970
|
},
|
|
2978
2971
|
rules: {
|
|
2979
2972
|
$ref: tokenStylingSchemaId,
|
|
2980
|
-
description: (
|
|
2973
|
+
description: ( localize(
|
|
2981
2974
|
'editorColors.semanticHighlighting.rules',
|
|
2982
2975
|
'Semantic token styling rules for this theme.'
|
|
2983
|
-
))
|
|
2976
|
+
)),
|
|
2984
2977
|
suggestSortText: '0_rules'
|
|
2985
2978
|
}
|
|
2986
2979
|
},
|
|
2987
2980
|
additionalProperties: false
|
|
2988
2981
|
};
|
|
2989
2982
|
const semanticTokenColorCustomizationSchema = {
|
|
2990
|
-
description: (
|
|
2983
|
+
description: ( localize(
|
|
2991
2984
|
'semanticTokenColors',
|
|
2992
2985
|
"Overrides editor semantic token color and styles from the currently selected color theme."
|
|
2993
|
-
))
|
|
2986
|
+
)),
|
|
2994
2987
|
default: {},
|
|
2995
2988
|
allOf: [{ ...semanticTokenColorSchema, patternProperties: { '^\\[': {} } }]
|
|
2996
2989
|
};
|
|
@@ -3120,7 +3113,7 @@ class ThemeConfiguration {
|
|
|
3120
3113
|
const DEFAULT_PRODUCT_ICON_THEME_ID = '';
|
|
3121
3114
|
class ProductIconThemeData {
|
|
3122
3115
|
constructor(id, label, settingsId) {
|
|
3123
|
-
this.iconThemeDocument = { iconDefinitions: (
|
|
3116
|
+
this.iconThemeDocument = { iconDefinitions: ( new Map()) };
|
|
3124
3117
|
this.id = id;
|
|
3125
3118
|
this.label = label;
|
|
3126
3119
|
this.settingsId = settingsId;
|
|
@@ -3144,12 +3137,12 @@ class ProductIconThemeData {
|
|
|
3144
3137
|
this.iconThemeDocument = await _loadProductIconThemeDocument(fileService, location, warnings);
|
|
3145
3138
|
this.isLoaded = true;
|
|
3146
3139
|
if (warnings.length) {
|
|
3147
|
-
logService.error((
|
|
3140
|
+
logService.error(( localize(
|
|
3148
3141
|
'error.parseicondefs',
|
|
3149
3142
|
"Problems processing product icons definitions in {0}:\n{1}",
|
|
3150
|
-
|
|
3143
|
+
( location.toString()),
|
|
3151
3144
|
warnings.join('\n')
|
|
3152
|
-
)))
|
|
3145
|
+
)));
|
|
3153
3146
|
}
|
|
3154
3147
|
return this.styleSheetContent;
|
|
3155
3148
|
}
|
|
@@ -3157,7 +3150,7 @@ class ProductIconThemeData {
|
|
|
3157
3150
|
const id = extensionData.extensionId + '-' + iconTheme.id;
|
|
3158
3151
|
const label = iconTheme.label || basename(iconTheme.path);
|
|
3159
3152
|
const settingsId = iconTheme.id;
|
|
3160
|
-
const themeData = (
|
|
3153
|
+
const themeData = ( new ProductIconThemeData(id, label, settingsId));
|
|
3161
3154
|
themeData.description = iconTheme.description;
|
|
3162
3155
|
themeData.location = iconThemeLocation;
|
|
3163
3156
|
themeData.extensionData = extensionData;
|
|
@@ -3166,7 +3159,7 @@ class ProductIconThemeData {
|
|
|
3166
3159
|
return themeData;
|
|
3167
3160
|
}
|
|
3168
3161
|
static createUnloadedTheme(id) {
|
|
3169
|
-
const themeData = (
|
|
3162
|
+
const themeData = ( new ProductIconThemeData(id, '', '__' + id));
|
|
3170
3163
|
themeData.isLoaded = false;
|
|
3171
3164
|
themeData.extensionData = undefined;
|
|
3172
3165
|
themeData.watch = false;
|
|
@@ -3175,11 +3168,7 @@ class ProductIconThemeData {
|
|
|
3175
3168
|
static get defaultTheme() {
|
|
3176
3169
|
let themeData = ProductIconThemeData._defaultProductIconTheme;
|
|
3177
3170
|
if (!themeData) {
|
|
3178
|
-
themeData = ProductIconThemeData._defaultProductIconTheme = (
|
|
3179
|
-
DEFAULT_PRODUCT_ICON_THEME_ID,
|
|
3180
|
-
(localize('defaultTheme', 'Default')),
|
|
3181
|
-
DEFAULT_PRODUCT_ICON_THEME_SETTING_VALUE
|
|
3182
|
-
)));
|
|
3171
|
+
themeData = ProductIconThemeData._defaultProductIconTheme = ( new ProductIconThemeData(DEFAULT_PRODUCT_ICON_THEME_ID, ( localize('defaultTheme', 'Default')), DEFAULT_PRODUCT_ICON_THEME_SETTING_VALUE));
|
|
3183
3172
|
themeData.isLoaded = true;
|
|
3184
3173
|
themeData.extensionData = undefined;
|
|
3185
3174
|
themeData.watch = false;
|
|
@@ -3193,7 +3182,7 @@ class ProductIconThemeData {
|
|
|
3193
3182
|
}
|
|
3194
3183
|
try {
|
|
3195
3184
|
const data = JSON.parse(input);
|
|
3196
|
-
const theme = (
|
|
3185
|
+
const theme = ( new ProductIconThemeData('', '', ''));
|
|
3197
3186
|
for (const key in data) {
|
|
3198
3187
|
switch (key) {
|
|
3199
3188
|
case 'id':
|
|
@@ -3213,7 +3202,7 @@ class ProductIconThemeData {
|
|
|
3213
3202
|
}
|
|
3214
3203
|
const { iconDefinitions, iconFontDefinitions } = data;
|
|
3215
3204
|
if (Array.isArray(iconDefinitions) && isObject(iconFontDefinitions)) {
|
|
3216
|
-
const restoredIconDefinitions = (
|
|
3205
|
+
const restoredIconDefinitions = ( new Map());
|
|
3217
3206
|
for (const entry of iconDefinitions) {
|
|
3218
3207
|
const { id, fontCharacter, fontId } = entry;
|
|
3219
3208
|
if (isString(id) && isString(fontCharacter)) {
|
|
@@ -3267,26 +3256,26 @@ function _loadProductIconThemeDocument(fileService, location, warnings) {
|
|
|
3267
3256
|
const parseErrors = [];
|
|
3268
3257
|
const contentValue = parse$1(content, parseErrors);
|
|
3269
3258
|
if (parseErrors.length > 0) {
|
|
3270
|
-
return Promise.reject((
|
|
3259
|
+
return Promise.reject(( new Error(( localize(
|
|
3271
3260
|
'error.cannotparseicontheme',
|
|
3272
3261
|
"Problems parsing product icons file: {0}",
|
|
3273
3262
|
parseErrors.map(e => getParseErrorMessage(e.error)).join(', ')
|
|
3274
|
-
)))))
|
|
3263
|
+
)))));
|
|
3275
3264
|
}
|
|
3276
3265
|
else if (getNodeType(contentValue) !== 'object') {
|
|
3277
|
-
return Promise.reject((
|
|
3266
|
+
return Promise.reject(( new Error(( localize(
|
|
3278
3267
|
'error.invalidformat',
|
|
3279
3268
|
"Invalid format for product icons theme file: Object expected."
|
|
3280
|
-
)))))
|
|
3269
|
+
)))));
|
|
3281
3270
|
}
|
|
3282
3271
|
else if (!contentValue.iconDefinitions || !Array.isArray(contentValue.fonts) || !contentValue.fonts.length) {
|
|
3283
|
-
return Promise.reject((
|
|
3272
|
+
return Promise.reject(( new Error(( localize(
|
|
3284
3273
|
'error.missingProperties',
|
|
3285
3274
|
"Invalid format for product icons theme file: Must contain iconDefinitions and fonts."
|
|
3286
|
-
)))))
|
|
3275
|
+
)))));
|
|
3287
3276
|
}
|
|
3288
3277
|
const iconThemeDocumentLocationDirname = dirname(location);
|
|
3289
|
-
const sanitizedFonts = (
|
|
3278
|
+
const sanitizedFonts = ( new Map());
|
|
3290
3279
|
for (const font of contentValue.fonts) {
|
|
3291
3280
|
if (isString(font.id) && font.id.match(fontIdRegex)) {
|
|
3292
3281
|
const fontId = font.id;
|
|
@@ -3295,22 +3284,22 @@ function _loadProductIconThemeDocument(fileService, location, warnings) {
|
|
|
3295
3284
|
fontWeight = font.weight;
|
|
3296
3285
|
}
|
|
3297
3286
|
else {
|
|
3298
|
-
warnings.push((
|
|
3287
|
+
warnings.push(( localize(
|
|
3299
3288
|
'error.fontWeight',
|
|
3300
3289
|
'Invalid font weight in font \'{0}\'. Ignoring setting.',
|
|
3301
3290
|
font.id
|
|
3302
|
-
)))
|
|
3291
|
+
)));
|
|
3303
3292
|
}
|
|
3304
3293
|
let fontStyle = undefined;
|
|
3305
3294
|
if (isString(font.style) && font.style.match(fontStyleRegex)) {
|
|
3306
3295
|
fontStyle = font.style;
|
|
3307
3296
|
}
|
|
3308
3297
|
else {
|
|
3309
|
-
warnings.push((
|
|
3298
|
+
warnings.push(( localize(
|
|
3310
3299
|
'error.fontStyle',
|
|
3311
3300
|
'Invalid font style in font \'{0}\'. Ignoring setting.',
|
|
3312
3301
|
font.id
|
|
3313
|
-
)))
|
|
3302
|
+
)));
|
|
3314
3303
|
}
|
|
3315
3304
|
const sanitizedSrc = [];
|
|
3316
3305
|
if (Array.isArray(font.src)) {
|
|
@@ -3320,11 +3309,11 @@ function _loadProductIconThemeDocument(fileService, location, warnings) {
|
|
|
3320
3309
|
sanitizedSrc.push({ location: iconFontLocation, format: s.format });
|
|
3321
3310
|
}
|
|
3322
3311
|
else {
|
|
3323
|
-
warnings.push((
|
|
3312
|
+
warnings.push(( localize(
|
|
3324
3313
|
'error.fontSrc',
|
|
3325
3314
|
'Invalid font source in font \'{0}\'. Ignoring source.',
|
|
3326
3315
|
font.id
|
|
3327
|
-
)))
|
|
3316
|
+
)));
|
|
3328
3317
|
}
|
|
3329
3318
|
}
|
|
3330
3319
|
}
|
|
@@ -3332,22 +3321,22 @@ function _loadProductIconThemeDocument(fileService, location, warnings) {
|
|
|
3332
3321
|
sanitizedFonts.set(fontId, { weight: fontWeight, style: fontStyle, src: sanitizedSrc });
|
|
3333
3322
|
}
|
|
3334
3323
|
else {
|
|
3335
|
-
warnings.push((
|
|
3324
|
+
warnings.push(( localize(
|
|
3336
3325
|
'error.noFontSrc',
|
|
3337
3326
|
'No valid font source in font \'{0}\'. Ignoring font definition.',
|
|
3338
3327
|
font.id
|
|
3339
|
-
)))
|
|
3328
|
+
)));
|
|
3340
3329
|
}
|
|
3341
3330
|
}
|
|
3342
3331
|
else {
|
|
3343
|
-
warnings.push((
|
|
3332
|
+
warnings.push(( localize(
|
|
3344
3333
|
'error.fontId',
|
|
3345
3334
|
'Missing or invalid font id \'{0}\'. Skipping font definition.',
|
|
3346
3335
|
font.id
|
|
3347
|
-
)))
|
|
3336
|
+
)));
|
|
3348
3337
|
}
|
|
3349
3338
|
}
|
|
3350
|
-
const iconDefinitions = (
|
|
3339
|
+
const iconDefinitions = ( new Map());
|
|
3351
3340
|
const primaryFontId = contentValue.fonts[0].id;
|
|
3352
3341
|
for (const iconId in contentValue.iconDefinitions) {
|
|
3353
3342
|
const definition = contentValue.iconDefinitions[iconId];
|
|
@@ -3359,19 +3348,19 @@ function _loadProductIconThemeDocument(fileService, location, warnings) {
|
|
|
3359
3348
|
iconDefinitions.set(iconId, { fontCharacter: definition.fontCharacter, font });
|
|
3360
3349
|
}
|
|
3361
3350
|
else {
|
|
3362
|
-
warnings.push((
|
|
3351
|
+
warnings.push(( localize(
|
|
3363
3352
|
'error.icon.font',
|
|
3364
3353
|
'Skipping icon definition \'{0}\'. Unknown font.',
|
|
3365
3354
|
iconId
|
|
3366
|
-
)))
|
|
3355
|
+
)));
|
|
3367
3356
|
}
|
|
3368
3357
|
}
|
|
3369
3358
|
else {
|
|
3370
|
-
warnings.push((
|
|
3359
|
+
warnings.push(( localize(
|
|
3371
3360
|
'error.icon.fontCharacter',
|
|
3372
3361
|
'Skipping icon definition \'{0}\'. Unknown fontCharacter.',
|
|
3373
3362
|
iconId
|
|
3374
|
-
)))
|
|
3363
|
+
)));
|
|
3375
3364
|
}
|
|
3376
3365
|
}
|
|
3377
3366
|
return { iconDefinitions };
|
|
@@ -3410,7 +3399,7 @@ const fileIconsEnabledClass = 'file-icons-enabled';
|
|
|
3410
3399
|
const colorThemeRulesClassName = 'contributedColorTheme';
|
|
3411
3400
|
const fileIconThemeRulesClassName = 'contributedFileIconTheme';
|
|
3412
3401
|
const productIconThemeRulesClassName = 'contributedProductIconTheme';
|
|
3413
|
-
const themingRegistry = (
|
|
3402
|
+
const themingRegistry = ( Registry.as(Extensions$3.ThemingContribution));
|
|
3414
3403
|
function validateThemeId(theme) {
|
|
3415
3404
|
switch (theme) {
|
|
3416
3405
|
case VS_LIGHT_THEME: return `vs ${defaultThemeExtensionId}-themes-light_vs-json`;
|
|
@@ -3435,43 +3424,43 @@ let WorkbenchThemeService = class WorkbenchThemeService {
|
|
|
3435
3424
|
this.hostColorService = hostColorService;
|
|
3436
3425
|
this.userDataInitializationService = userDataInitializationService;
|
|
3437
3426
|
this.languageService = languageService;
|
|
3438
|
-
this.themeExtensionsActivated = (
|
|
3427
|
+
this.themeExtensionsActivated = ( new Map());
|
|
3439
3428
|
this.container = layoutService.container;
|
|
3440
|
-
this.settings = (
|
|
3441
|
-
this.colorThemeRegistry = (
|
|
3442
|
-
this.colorThemeWatcher = (
|
|
3443
|
-
this.onColorThemeChange = (
|
|
3429
|
+
this.settings = ( new ThemeConfiguration(configurationService));
|
|
3430
|
+
this.colorThemeRegistry = ( new ThemeRegistry(colorThemesExtPoint, ColorThemeData.fromExtensionTheme));
|
|
3431
|
+
this.colorThemeWatcher = ( new ThemeFileWatcher(fileService, environmentService, this.reloadCurrentColorTheme.bind(this)));
|
|
3432
|
+
this.onColorThemeChange = ( new Emitter({ leakWarningThreshold: 400 }));
|
|
3444
3433
|
this.currentColorTheme = ColorThemeData.createUnloadedTheme('');
|
|
3445
|
-
this.colorThemeSequencer = (
|
|
3446
|
-
this.fileIconThemeWatcher = (
|
|
3434
|
+
this.colorThemeSequencer = ( new Sequencer());
|
|
3435
|
+
this.fileIconThemeWatcher = ( new ThemeFileWatcher(
|
|
3447
3436
|
fileService,
|
|
3448
3437
|
environmentService,
|
|
3449
3438
|
this.reloadCurrentFileIconTheme.bind(this)
|
|
3450
|
-
))
|
|
3451
|
-
this.fileIconThemeRegistry = (
|
|
3439
|
+
));
|
|
3440
|
+
this.fileIconThemeRegistry = ( new ThemeRegistry(
|
|
3452
3441
|
fileIconThemesExtPoint,
|
|
3453
3442
|
FileIconThemeData.fromExtensionTheme,
|
|
3454
3443
|
true,
|
|
3455
3444
|
FileIconThemeData.noIconTheme
|
|
3456
|
-
))
|
|
3457
|
-
this.fileIconThemeLoader = (
|
|
3458
|
-
this.onFileIconThemeChange = (
|
|
3445
|
+
));
|
|
3446
|
+
this.fileIconThemeLoader = ( new FileIconThemeLoader(extensionResourceLoaderService, languageService));
|
|
3447
|
+
this.onFileIconThemeChange = ( new Emitter({ leakWarningThreshold: 400 }));
|
|
3459
3448
|
this.currentFileIconTheme = FileIconThemeData.createUnloadedTheme('');
|
|
3460
|
-
this.fileIconThemeSequencer = (
|
|
3461
|
-
this.productIconThemeWatcher = (
|
|
3449
|
+
this.fileIconThemeSequencer = ( new Sequencer());
|
|
3450
|
+
this.productIconThemeWatcher = ( new ThemeFileWatcher(
|
|
3462
3451
|
fileService,
|
|
3463
3452
|
environmentService,
|
|
3464
3453
|
this.reloadCurrentProductIconTheme.bind(this)
|
|
3465
|
-
))
|
|
3466
|
-
this.productIconThemeRegistry = (
|
|
3454
|
+
));
|
|
3455
|
+
this.productIconThemeRegistry = ( new ThemeRegistry(
|
|
3467
3456
|
productIconThemesExtPoint,
|
|
3468
3457
|
ProductIconThemeData.fromExtensionTheme,
|
|
3469
3458
|
true,
|
|
3470
3459
|
ProductIconThemeData.defaultTheme
|
|
3471
|
-
))
|
|
3472
|
-
this.onProductIconThemeChange = (
|
|
3460
|
+
));
|
|
3461
|
+
this.onProductIconThemeChange = ( new Emitter());
|
|
3473
3462
|
this.currentProductIconTheme = ProductIconThemeData.createUnloadedTheme('');
|
|
3474
|
-
this.productIconThemeSequencer = (
|
|
3463
|
+
this.productIconThemeSequencer = ( new Sequencer());
|
|
3475
3464
|
let themeData = ColorThemeData.fromStorageData(this.storageService);
|
|
3476
3465
|
if (themeData && this.settings.colorTheme !== themeData.settingsId && this.settings.isDefaultColorTheme()) {
|
|
3477
3466
|
themeData = undefined;
|
|
@@ -3511,7 +3500,7 @@ let WorkbenchThemeService = class WorkbenchThemeService {
|
|
|
3511
3500
|
function updateAll() {
|
|
3512
3501
|
codiconStyleSheet.textContent = iconsStyleSheet.getCSS();
|
|
3513
3502
|
}
|
|
3514
|
-
const delayer = (
|
|
3503
|
+
const delayer = ( new RunOnceScheduler(updateAll, 0));
|
|
3515
3504
|
iconsStyleSheet.onDidChange(() => delayer.schedule());
|
|
3516
3505
|
delayer.schedule();
|
|
3517
3506
|
}
|
|
@@ -3810,7 +3799,7 @@ let WorkbenchThemeService = class WorkbenchThemeService {
|
|
|
3810
3799
|
});
|
|
3811
3800
|
}
|
|
3812
3801
|
updateDynamicCSSRules(themeData) {
|
|
3813
|
-
const cssRules = (
|
|
3802
|
+
const cssRules = ( new Set());
|
|
3814
3803
|
const ruleCollector = {
|
|
3815
3804
|
addRule: (rule) => {
|
|
3816
3805
|
if (!cssRules.has(rule)) {
|
|
@@ -3824,7 +3813,7 @@ let WorkbenchThemeService = class WorkbenchThemeService {
|
|
|
3824
3813
|
for (const item of getColorRegistry().getColors()) {
|
|
3825
3814
|
const color = themeData.getColor(item.id, true);
|
|
3826
3815
|
if (color) {
|
|
3827
|
-
colorVariables.push(`${asCssVariableName(item.id)}: ${(
|
|
3816
|
+
colorVariables.push(`${asCssVariableName(item.id)}: ${( color.toString())};`);
|
|
3828
3817
|
}
|
|
3829
3818
|
}
|
|
3830
3819
|
ruleCollector.addRule(`.monaco-workbench { ${colorVariables.join('\n')} }`);
|
|
@@ -4045,20 +4034,20 @@ let WorkbenchThemeService = class WorkbenchThemeService {
|
|
|
4045
4034
|
}
|
|
4046
4035
|
}
|
|
4047
4036
|
};
|
|
4048
|
-
WorkbenchThemeService = (
|
|
4049
|
-
(
|
|
4050
|
-
(
|
|
4051
|
-
(
|
|
4052
|
-
(
|
|
4053
|
-
(
|
|
4054
|
-
(
|
|
4055
|
-
(
|
|
4056
|
-
(
|
|
4057
|
-
(
|
|
4058
|
-
(
|
|
4059
|
-
(
|
|
4060
|
-
(
|
|
4061
|
-
], WorkbenchThemeService))
|
|
4037
|
+
WorkbenchThemeService = ( __decorate([
|
|
4038
|
+
( __param(0, IExtensionService)),
|
|
4039
|
+
( __param(1, IStorageService)),
|
|
4040
|
+
( __param(2, IConfigurationService)),
|
|
4041
|
+
( __param(3, ITelemetryService)),
|
|
4042
|
+
( __param(4, IBrowserWorkbenchEnvironmentService)),
|
|
4043
|
+
( __param(5, IFileService)),
|
|
4044
|
+
( __param(6, IExtensionResourceLoaderService)),
|
|
4045
|
+
( __param(7, IWorkbenchLayoutService)),
|
|
4046
|
+
( __param(8, ILogService)),
|
|
4047
|
+
( __param(9, IHostColorSchemeService)),
|
|
4048
|
+
( __param(10, IUserDataInitializationService)),
|
|
4049
|
+
( __param(11, ILanguageService))
|
|
4050
|
+
], WorkbenchThemeService));
|
|
4062
4051
|
class ThemeFileWatcher {
|
|
4063
4052
|
constructor(fileService, environmentService, onUpdate) {
|
|
4064
4053
|
this.fileService = fileService;
|
|
@@ -4120,7 +4109,7 @@ const DEFAULT_THEME_EXTENSION = {
|
|
|
4120
4109
|
isBuiltin: true,
|
|
4121
4110
|
isUserBuiltin: true,
|
|
4122
4111
|
isUnderDevelopment: false,
|
|
4123
|
-
extensionLocation:
|
|
4112
|
+
extensionLocation: URI.from({ scheme: 'extension', path: '/' }),
|
|
4124
4113
|
name: 'theme-defaults',
|
|
4125
4114
|
publisher: 'vscode',
|
|
4126
4115
|
version: '1.0.0',
|
|
@@ -4161,7 +4150,7 @@ function setDefaultThemes(_themes, getContent) {
|
|
|
4161
4150
|
function getServiceOverride() {
|
|
4162
4151
|
return {
|
|
4163
4152
|
...getServiceOverride$1(),
|
|
4164
|
-
[
|
|
4153
|
+
[IThemeService.toString()]: new SyncDescriptor(StandaloneWorkbenchThemeService)
|
|
4165
4154
|
};
|
|
4166
4155
|
}
|
|
4167
4156
|
export { getServiceOverride as default, setDefaultThemes, setThemes };
|