@codingame/monaco-vscode-theme-service-override 1.85.6 → 2.0.0-v2.1
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/package.json +4 -5
- package/theme.js +2 -2
- package/vscode/src/vs/workbench/contrib/themes/browser/themes.contribution.js +27 -27
- package/vscode/src/vs/workbench/services/themes/browser/fileIconThemeData.js +13 -13
- package/vscode/src/vs/workbench/services/themes/browser/productIconThemeData.js +24 -24
- package/vscode/src/vs/workbench/services/themes/browser/workbenchThemeService.js +34 -34
- package/vscode/src/vs/workbench/services/themes/common/colorThemeData.js +32 -32
- package/vscode/src/vs/workbench/services/themes/common/colorThemeSchema.js +17 -17
- package/vscode/src/vs/workbench/services/themes/common/fileIconThemeSchema.js +42 -42
- package/vscode/src/vs/workbench/services/themes/common/productIconThemeSchema.js +12 -12
- package/vscode/src/vs/workbench/services/themes/common/themeCompatibility.js +18 -18
- package/vscode/src/vs/workbench/services/themes/common/themeConfiguration.js +46 -46
- package/vscode/src/vs/workbench/services/themes/common/themeExtensionPoints.js +26 -26
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-theme-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-v2.1",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
12
|
-
"url": "git
|
|
12
|
+
"url": "git@github.com:CodinGame/monaco-vscode-api.git"
|
|
13
13
|
},
|
|
14
14
|
"type": "module",
|
|
15
15
|
"private": false,
|
|
@@ -18,8 +18,7 @@
|
|
|
18
18
|
"module": "index.js",
|
|
19
19
|
"types": "index.d.ts",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"vscode": "npm:@codingame/monaco-vscode-api@
|
|
22
|
-
"monaco-
|
|
23
|
-
"@codingame/monaco-vscode-files-service-override": "1.85.6"
|
|
21
|
+
"vscode": "npm:@codingame/monaco-vscode-api@2.0.0-v2.1",
|
|
22
|
+
"@codingame/monaco-vscode-files-service-override": "2.0.0-v2.1"
|
|
24
23
|
}
|
|
25
24
|
}
|
package/theme.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { WorkbenchThemeService } from './vscode/src/vs/workbench/services/themes/browser/workbenchThemeService.js';
|
|
2
|
-
import { IThemeService } from '
|
|
3
|
-
import { SyncDescriptor } from '
|
|
2
|
+
import { IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeService';
|
|
3
|
+
import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
|
|
4
4
|
import getServiceOverride$1 from '@codingame/monaco-vscode-files-service-override';
|
|
5
5
|
import './vscode/src/vs/workbench/contrib/themes/browser/themes.contribution.js';
|
|
6
6
|
|
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { localizeWithPath } from '
|
|
3
|
-
import { KeyChord } from '
|
|
4
|
-
import { registerAction2, Action2, MenuId, MenuRegistry } from '
|
|
5
|
-
import { equalsIgnoreCase } from '
|
|
6
|
-
import { Registry } from '
|
|
7
|
-
import { Categories } from '
|
|
2
|
+
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
3
|
+
import { KeyChord } from 'vscode/vscode/vs/base/common/keyCodes';
|
|
4
|
+
import { registerAction2, Action2, MenuId, MenuRegistry } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
5
|
+
import { equalsIgnoreCase } from 'vscode/vscode/vs/base/common/strings';
|
|
6
|
+
import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
|
|
7
|
+
import { Categories } from 'vscode/vscode/vs/platform/action/common/actionCommonCategories';
|
|
8
8
|
import { IWorkbenchThemeService, ThemeSettings, ThemeSettingDefaults } from 'vscode/vscode/vs/workbench/services/themes/common/workbenchThemeService';
|
|
9
9
|
import { VIEWLET_ID } from 'vscode/vscode/vs/workbench/contrib/extensions/common/extensions';
|
|
10
10
|
import { IExtensionGalleryService, IExtensionManagementService } from 'vscode/vscode/vs/platform/extensionManagement/common/extensionManagement';
|
|
11
|
-
import { Extensions } from '
|
|
11
|
+
import { Extensions } from 'vscode/vscode/vs/platform/theme/common/colorRegistry';
|
|
12
12
|
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
|
|
13
|
-
import { Color } from '
|
|
14
|
-
import { ColorScheme, isHighContrast } from '
|
|
13
|
+
import { Color } from 'vscode/vscode/vs/base/common/color';
|
|
14
|
+
import { ColorScheme, isHighContrast } from 'vscode/vscode/vs/platform/theme/common/theme';
|
|
15
15
|
import { colorThemeSchemaId } from '../../../services/themes/common/colorThemeSchema.js';
|
|
16
|
-
import { onUnexpectedError, isCancellationError } from '
|
|
17
|
-
import { IQuickInputService } from '
|
|
16
|
+
import { onUnexpectedError, isCancellationError } from 'vscode/vscode/vs/base/common/errors';
|
|
17
|
+
import { IQuickInputService } from 'vscode/vscode/vs/platform/quickinput/common/quickInput';
|
|
18
18
|
import { DEFAULT_PRODUCT_ICON_THEME_ID, ProductIconThemeData } from '../../../services/themes/browser/productIconThemeData.js';
|
|
19
19
|
import { IPaneCompositePartService } from 'vscode/vscode/vs/workbench/services/panecomposite/browser/panecomposite';
|
|
20
|
-
import { ThrottledDelayer } from '
|
|
21
|
-
import { CancellationTokenSource } from '
|
|
22
|
-
import { ILogService } from '
|
|
23
|
-
import { IProgressService } from '
|
|
24
|
-
import { Codicon } from '
|
|
25
|
-
import { registerIcon } from '
|
|
26
|
-
import { ThemeIcon } from '
|
|
27
|
-
import { Emitter } from '
|
|
20
|
+
import { ThrottledDelayer } from 'vscode/vscode/vs/base/common/async';
|
|
21
|
+
import { CancellationTokenSource } from 'vscode/vscode/vs/base/common/cancellation';
|
|
22
|
+
import { ILogService } from 'vscode/vscode/vs/platform/log/common/log';
|
|
23
|
+
import { IProgressService } from 'vscode/vscode/vs/platform/progress/common/progress';
|
|
24
|
+
import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
|
|
25
|
+
import { registerIcon } from 'vscode/vscode/vs/platform/theme/common/iconRegistry';
|
|
26
|
+
import { ThemeIcon } from 'vscode/vscode/vs/base/common/themables';
|
|
27
|
+
import { Emitter } from 'vscode/vscode/vs/base/common/event';
|
|
28
28
|
import { IExtensionResourceLoaderService } from 'vscode/vscode/vs/platform/extensionResourceLoader/common/extensionResourceLoader';
|
|
29
|
-
import { IInstantiationService } from '
|
|
30
|
-
import { CommandsRegistry, ICommandService } from '
|
|
29
|
+
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
30
|
+
import { CommandsRegistry, ICommandService } from 'vscode/vscode/vs/platform/commands/common/commands';
|
|
31
31
|
import { FileIconThemeData } from '../../../services/themes/browser/fileIconThemeData.js';
|
|
32
|
-
import { IConfigurationService } from '
|
|
32
|
+
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
|
|
33
33
|
import '../../../../../../../override/vs/platform/dialogs/common/dialogs.js';
|
|
34
34
|
import { Extensions as Extensions$1 } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
35
|
-
import { Severity, INotificationService } from '
|
|
36
|
-
import { IStorageService } from '
|
|
37
|
-
import { isWeb } from '
|
|
38
|
-
import { ITelemetryService } from '
|
|
35
|
+
import { Severity, INotificationService } from 'vscode/vscode/vs/platform/notification/common/notification';
|
|
36
|
+
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage';
|
|
37
|
+
import { isWeb } from 'vscode/vscode/vs/base/common/platform';
|
|
38
|
+
import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry';
|
|
39
39
|
import { IHostService } from 'vscode/vscode/vs/workbench/services/host/browser/host';
|
|
40
|
-
import { mainWindow } from '
|
|
40
|
+
import { mainWindow } from 'vscode/vscode/vs/base/browser/window';
|
|
41
41
|
import { IDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs';
|
|
42
42
|
|
|
43
43
|
var DefaultThemeUpdatedNotificationContribution_1;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
2
|
+
import { basename } from 'vscode/vscode/vs/base/common/path';
|
|
3
|
+
import { dirname, joinPath } from 'vscode/vscode/vs/base/common/resources';
|
|
4
|
+
import { parse, getNodeType } from 'vscode/vscode/vs/base/common/json';
|
|
5
5
|
import { ExtensionData } from 'vscode/vscode/vs/workbench/services/themes/common/workbenchThemeService';
|
|
6
6
|
import { getParseErrorMessage } from 'vscode/vscode/vs/base/common/jsonErrorMessages';
|
|
7
|
-
import { asCSSUrl } from '
|
|
8
|
-
import { mainWindow } from '
|
|
7
|
+
import { asCSSUrl } from 'vscode/vscode/vs/base/browser/dom';
|
|
8
|
+
import { mainWindow } from 'vscode/vscode/vs/base/browser/window';
|
|
9
9
|
|
|
10
10
|
class FileIconThemeData {
|
|
11
11
|
static { this.STORAGE_KEY = 'iconThemeData'; }
|
|
@@ -29,7 +29,7 @@ class FileIconThemeData {
|
|
|
29
29
|
}
|
|
30
30
|
static fromExtensionTheme(iconTheme, iconThemeLocation, extensionData) {
|
|
31
31
|
const id = extensionData.extensionId + '-' + iconTheme.id;
|
|
32
|
-
const label = iconTheme.label ||
|
|
32
|
+
const label = iconTheme.label || basename(iconTheme.path);
|
|
33
33
|
const settingsId = iconTheme.id;
|
|
34
34
|
const themeData = ( new FileIconThemeData(id, label, settingsId));
|
|
35
35
|
themeData.description = iconTheme.description;
|
|
@@ -135,17 +135,17 @@ class FileIconThemeLoader {
|
|
|
135
135
|
loadIconThemeDocument(location) {
|
|
136
136
|
return this.fileService.readExtensionResource(location).then((content) => {
|
|
137
137
|
const errors = [];
|
|
138
|
-
const contentValue =
|
|
138
|
+
const contentValue = parse(content, errors);
|
|
139
139
|
if (errors.length > 0) {
|
|
140
|
-
return Promise.reject(( new Error((
|
|
140
|
+
return Promise.reject(( new Error(( localizeWithPath(
|
|
141
141
|
'vs/workbench/services/themes/browser/fileIconThemeData',
|
|
142
142
|
'error.cannotparseicontheme',
|
|
143
143
|
"Problems parsing file icons file: {0}",
|
|
144
144
|
( errors.map(e => getParseErrorMessage(e.error))).join(', ')
|
|
145
145
|
)))));
|
|
146
146
|
}
|
|
147
|
-
else if (
|
|
148
|
-
return Promise.reject(( new Error((
|
|
147
|
+
else if (getNodeType(contentValue) !== 'object') {
|
|
148
|
+
return Promise.reject(( new Error(( localizeWithPath(
|
|
149
149
|
'vs/workbench/services/themes/browser/fileIconThemeData',
|
|
150
150
|
'error.invalidformat',
|
|
151
151
|
"Invalid format for file icons theme file: Object expected."
|
|
@@ -162,9 +162,9 @@ class FileIconThemeLoader {
|
|
|
162
162
|
}
|
|
163
163
|
const selectorByDefinitionId = {};
|
|
164
164
|
const coveredLanguages = {};
|
|
165
|
-
const iconThemeDocumentLocationDirname =
|
|
165
|
+
const iconThemeDocumentLocationDirname = dirname(iconThemeDocumentLocation);
|
|
166
166
|
function resolvePath(path) {
|
|
167
|
-
return
|
|
167
|
+
return joinPath(iconThemeDocumentLocationDirname, path);
|
|
168
168
|
}
|
|
169
169
|
function collectSelectors(associations, baseThemeClassName) {
|
|
170
170
|
function addSelector(selector, defId) {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
2
|
+
import { basename } from 'vscode/vscode/vs/base/common/path';
|
|
3
|
+
import { dirname, joinPath } from 'vscode/vscode/vs/base/common/resources';
|
|
4
|
+
import { parse, getNodeType } from 'vscode/vscode/vs/base/common/json';
|
|
5
5
|
import { ThemeSettingDefaults, ExtensionData } from 'vscode/vscode/vs/workbench/services/themes/common/workbenchThemeService';
|
|
6
6
|
import { getParseErrorMessage } from 'vscode/vscode/vs/base/common/jsonErrorMessages';
|
|
7
7
|
import { fontIdRegex, fontWeightRegex, fontStyleRegex, fontFormatRegex } from '../common/productIconThemeSchema.js';
|
|
8
|
-
import { isObject, isString } from '
|
|
9
|
-
import { IconFontDefinition, getIconRegistry } from '
|
|
10
|
-
import { ThemeIcon } from '
|
|
8
|
+
import { isObject, isString } from 'vscode/vscode/vs/base/common/types';
|
|
9
|
+
import { IconFontDefinition, getIconRegistry } from 'vscode/vscode/vs/platform/theme/common/iconRegistry';
|
|
10
|
+
import { ThemeIcon } from 'vscode/vscode/vs/base/common/themables';
|
|
11
11
|
|
|
12
12
|
const DEFAULT_PRODUCT_ICON_THEME_ID = '';
|
|
13
13
|
class ProductIconThemeData {
|
|
@@ -37,7 +37,7 @@ class ProductIconThemeData {
|
|
|
37
37
|
this.iconThemeDocument = await _loadProductIconThemeDocument(fileService, location, warnings);
|
|
38
38
|
this.isLoaded = true;
|
|
39
39
|
if (warnings.length) {
|
|
40
|
-
logService.error((
|
|
40
|
+
logService.error(( localizeWithPath(
|
|
41
41
|
'vs/workbench/services/themes/browser/productIconThemeData',
|
|
42
42
|
'error.parseicondefs',
|
|
43
43
|
"Problems processing product icons definitions in {0}:\n{1}",
|
|
@@ -49,7 +49,7 @@ class ProductIconThemeData {
|
|
|
49
49
|
}
|
|
50
50
|
static fromExtensionTheme(iconTheme, iconThemeLocation, extensionData) {
|
|
51
51
|
const id = extensionData.extensionId + '-' + iconTheme.id;
|
|
52
|
-
const label = iconTheme.label ||
|
|
52
|
+
const label = iconTheme.label || basename(iconTheme.path);
|
|
53
53
|
const settingsId = iconTheme.id;
|
|
54
54
|
const themeData = ( new ProductIconThemeData(id, label, settingsId));
|
|
55
55
|
themeData.description = iconTheme.description;
|
|
@@ -70,7 +70,7 @@ class ProductIconThemeData {
|
|
|
70
70
|
static get defaultTheme() {
|
|
71
71
|
let themeData = ProductIconThemeData._defaultProductIconTheme;
|
|
72
72
|
if (!themeData) {
|
|
73
|
-
themeData = ProductIconThemeData._defaultProductIconTheme = ( new ProductIconThemeData(DEFAULT_PRODUCT_ICON_THEME_ID, (
|
|
73
|
+
themeData = ProductIconThemeData._defaultProductIconTheme = ( new ProductIconThemeData(DEFAULT_PRODUCT_ICON_THEME_ID, ( localizeWithPath(
|
|
74
74
|
'vs/workbench/services/themes/browser/productIconThemeData',
|
|
75
75
|
'defaultTheme',
|
|
76
76
|
'Default'
|
|
@@ -158,30 +158,30 @@ class ProductIconThemeData {
|
|
|
158
158
|
function _loadProductIconThemeDocument(fileService, location, warnings) {
|
|
159
159
|
return fileService.readExtensionResource(location).then((content) => {
|
|
160
160
|
const parseErrors = [];
|
|
161
|
-
const contentValue =
|
|
161
|
+
const contentValue = parse(content, parseErrors);
|
|
162
162
|
if (parseErrors.length > 0) {
|
|
163
|
-
return Promise.reject(( new Error((
|
|
163
|
+
return Promise.reject(( new Error(( localizeWithPath(
|
|
164
164
|
'vs/workbench/services/themes/browser/productIconThemeData',
|
|
165
165
|
'error.cannotparseicontheme',
|
|
166
166
|
"Problems parsing product icons file: {0}",
|
|
167
167
|
( parseErrors.map(e => getParseErrorMessage(e.error))).join(', ')
|
|
168
168
|
)))));
|
|
169
169
|
}
|
|
170
|
-
else if (
|
|
171
|
-
return Promise.reject(( new Error((
|
|
170
|
+
else if (getNodeType(contentValue) !== 'object') {
|
|
171
|
+
return Promise.reject(( new Error(( localizeWithPath(
|
|
172
172
|
'vs/workbench/services/themes/browser/productIconThemeData',
|
|
173
173
|
'error.invalidformat',
|
|
174
174
|
"Invalid format for product icons theme file: Object expected."
|
|
175
175
|
)))));
|
|
176
176
|
}
|
|
177
177
|
else if (!contentValue.iconDefinitions || !Array.isArray(contentValue.fonts) || !contentValue.fonts.length) {
|
|
178
|
-
return Promise.reject(( new Error((
|
|
178
|
+
return Promise.reject(( new Error(( localizeWithPath(
|
|
179
179
|
'vs/workbench/services/themes/browser/productIconThemeData',
|
|
180
180
|
'error.missingProperties',
|
|
181
181
|
"Invalid format for product icons theme file: Must contain iconDefinitions and fonts."
|
|
182
182
|
)))));
|
|
183
183
|
}
|
|
184
|
-
const iconThemeDocumentLocationDirname =
|
|
184
|
+
const iconThemeDocumentLocationDirname = dirname(location);
|
|
185
185
|
const sanitizedFonts = ( new Map());
|
|
186
186
|
for (const font of contentValue.fonts) {
|
|
187
187
|
if (isString(font.id) && font.id.match(fontIdRegex)) {
|
|
@@ -191,7 +191,7 @@ function _loadProductIconThemeDocument(fileService, location, warnings) {
|
|
|
191
191
|
fontWeight = font.weight;
|
|
192
192
|
}
|
|
193
193
|
else {
|
|
194
|
-
warnings.push((
|
|
194
|
+
warnings.push(( localizeWithPath(
|
|
195
195
|
'vs/workbench/services/themes/browser/productIconThemeData',
|
|
196
196
|
'error.fontWeight',
|
|
197
197
|
'Invalid font weight in font \'{0}\'. Ignoring setting.',
|
|
@@ -203,7 +203,7 @@ function _loadProductIconThemeDocument(fileService, location, warnings) {
|
|
|
203
203
|
fontStyle = font.style;
|
|
204
204
|
}
|
|
205
205
|
else {
|
|
206
|
-
warnings.push((
|
|
206
|
+
warnings.push(( localizeWithPath(
|
|
207
207
|
'vs/workbench/services/themes/browser/productIconThemeData',
|
|
208
208
|
'error.fontStyle',
|
|
209
209
|
'Invalid font style in font \'{0}\'. Ignoring setting.',
|
|
@@ -214,11 +214,11 @@ function _loadProductIconThemeDocument(fileService, location, warnings) {
|
|
|
214
214
|
if (Array.isArray(font.src)) {
|
|
215
215
|
for (const s of font.src) {
|
|
216
216
|
if (isString(s.path) && isString(s.format) && s.format.match(fontFormatRegex)) {
|
|
217
|
-
const iconFontLocation =
|
|
217
|
+
const iconFontLocation = joinPath(iconThemeDocumentLocationDirname, s.path);
|
|
218
218
|
sanitizedSrc.push({ location: iconFontLocation, format: s.format });
|
|
219
219
|
}
|
|
220
220
|
else {
|
|
221
|
-
warnings.push((
|
|
221
|
+
warnings.push(( localizeWithPath(
|
|
222
222
|
'vs/workbench/services/themes/browser/productIconThemeData',
|
|
223
223
|
'error.fontSrc',
|
|
224
224
|
'Invalid font source in font \'{0}\'. Ignoring source.',
|
|
@@ -231,7 +231,7 @@ function _loadProductIconThemeDocument(fileService, location, warnings) {
|
|
|
231
231
|
sanitizedFonts.set(fontId, { weight: fontWeight, style: fontStyle, src: sanitizedSrc });
|
|
232
232
|
}
|
|
233
233
|
else {
|
|
234
|
-
warnings.push((
|
|
234
|
+
warnings.push(( localizeWithPath(
|
|
235
235
|
'vs/workbench/services/themes/browser/productIconThemeData',
|
|
236
236
|
'error.noFontSrc',
|
|
237
237
|
'No valid font source in font \'{0}\'. Ignoring font definition.',
|
|
@@ -240,7 +240,7 @@ function _loadProductIconThemeDocument(fileService, location, warnings) {
|
|
|
240
240
|
}
|
|
241
241
|
}
|
|
242
242
|
else {
|
|
243
|
-
warnings.push((
|
|
243
|
+
warnings.push(( localizeWithPath(
|
|
244
244
|
'vs/workbench/services/themes/browser/productIconThemeData',
|
|
245
245
|
'error.fontId',
|
|
246
246
|
'Missing or invalid font id \'{0}\'. Skipping font definition.',
|
|
@@ -260,7 +260,7 @@ function _loadProductIconThemeDocument(fileService, location, warnings) {
|
|
|
260
260
|
iconDefinitions.set(iconId, { fontCharacter: definition.fontCharacter, font });
|
|
261
261
|
}
|
|
262
262
|
else {
|
|
263
|
-
warnings.push((
|
|
263
|
+
warnings.push(( localizeWithPath(
|
|
264
264
|
'vs/workbench/services/themes/browser/productIconThemeData',
|
|
265
265
|
'error.icon.font',
|
|
266
266
|
'Skipping icon definition \'{0}\'. Unknown font.',
|
|
@@ -269,7 +269,7 @@ function _loadProductIconThemeDocument(fileService, location, warnings) {
|
|
|
269
269
|
}
|
|
270
270
|
}
|
|
271
271
|
else {
|
|
272
|
-
warnings.push((
|
|
272
|
+
warnings.push(( localizeWithPath(
|
|
273
273
|
'vs/workbench/services/themes/browser/productIconThemeData',
|
|
274
274
|
'error.icon.fontCharacter',
|
|
275
275
|
'Skipping icon definition \'{0}\'. Unknown fontCharacter.',
|
|
@@ -1,41 +1,41 @@
|
|
|
1
1
|
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
3
|
+
import { isUndefined, isString } from 'vscode/vscode/vs/base/common/types';
|
|
4
4
|
import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions';
|
|
5
5
|
import { ThemeSettingDefaults, COLOR_THEME_LIGHT_INITIAL_COLORS, COLOR_THEME_DARK_INITIAL_COLORS, ThemeSettings, ExtensionData, VS_DARK_THEME, VS_LIGHT_THEME, VS_HC_THEME, VS_HC_LIGHT_THEME } from 'vscode/vscode/vs/workbench/services/themes/common/workbenchThemeService';
|
|
6
|
-
import { IStorageService } from '
|
|
7
|
-
import { ITelemetryService } from '
|
|
8
|
-
import { Registry } from '
|
|
9
|
-
import
|
|
10
|
-
import { IConfigurationService } from '
|
|
6
|
+
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage';
|
|
7
|
+
import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry';
|
|
8
|
+
import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
|
|
9
|
+
import { onUnexpectedError } from 'vscode/vscode/vs/base/common/errors';
|
|
10
|
+
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
|
|
11
11
|
import { ColorThemeData } from '../common/colorThemeData.js';
|
|
12
|
-
import { Extensions } from '
|
|
13
|
-
import { Emitter } from '
|
|
12
|
+
import { Extensions } from 'vscode/vscode/vs/platform/theme/common/themeService';
|
|
13
|
+
import { Emitter } from 'vscode/vscode/vs/base/common/event';
|
|
14
14
|
import { registerFileIconThemeSchemas } from '../common/fileIconThemeSchema.js';
|
|
15
|
-
import { dispose } from '
|
|
15
|
+
import { dispose } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
16
16
|
import { FileIconThemeData, FileIconThemeLoader } from './fileIconThemeData.js';
|
|
17
|
-
import { createStyleSheet } from '
|
|
17
|
+
import { createStyleSheet } from 'vscode/vscode/vs/base/browser/dom';
|
|
18
18
|
import { IBrowserWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/browser/environmentService';
|
|
19
|
-
import { IFileService } from '
|
|
20
|
-
import
|
|
19
|
+
import { IFileService } from 'vscode/vscode/vs/platform/files/common/files';
|
|
20
|
+
import { joinPath, isEqual } from 'vscode/vscode/vs/base/common/resources';
|
|
21
21
|
import { registerColorThemeSchemas } from '../common/colorThemeSchema.js';
|
|
22
|
-
import { getRemoteAuthority } from '
|
|
22
|
+
import { getRemoteAuthority } from 'vscode/vscode/vs/platform/remote/common/remoteHosts';
|
|
23
23
|
import { IWorkbenchLayoutService } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService';
|
|
24
24
|
import { IExtensionResourceLoaderService } from 'vscode/vscode/vs/platform/extensionResourceLoader/common/extensionResourceLoader';
|
|
25
25
|
import { registerColorThemeExtensionPoint, registerFileIconThemeExtensionPoint, registerProductIconThemeExtensionPoint, ThemeRegistry } from '../common/themeExtensionPoints.js';
|
|
26
26
|
import { ThemeConfiguration, updateColorThemeConfigurationSchemas, updateFileIconThemeConfigurationSchemas, updateProductIconThemeConfigurationSchemas } from '../common/themeConfiguration.js';
|
|
27
27
|
import { ProductIconThemeData, DEFAULT_PRODUCT_ICON_THEME_ID } from './productIconThemeData.js';
|
|
28
28
|
import { registerProductIconThemeSchemas } from '../common/productIconThemeSchema.js';
|
|
29
|
-
import { ILogService } from '
|
|
30
|
-
import { isWeb } from '
|
|
31
|
-
import { ColorScheme } from '
|
|
29
|
+
import { ILogService } from 'vscode/vscode/vs/platform/log/common/log';
|
|
30
|
+
import { isWeb } from 'vscode/vscode/vs/base/common/platform';
|
|
31
|
+
import { ColorScheme } from 'vscode/vscode/vs/platform/theme/common/theme';
|
|
32
32
|
import { IHostColorSchemeService } from 'vscode/vscode/vs/workbench/services/themes/common/hostColorSchemeService';
|
|
33
|
-
import { Sequencer, RunOnceScheduler } from '
|
|
33
|
+
import { Sequencer, RunOnceScheduler } from 'vscode/vscode/vs/base/common/async';
|
|
34
34
|
import { IUserDataInitializationService } from 'vscode/vscode/vs/workbench/services/userData/browser/userDataInit';
|
|
35
|
-
import { getIconsStyleSheet } from '
|
|
36
|
-
import { getColorRegistry, asCssVariableName } from '
|
|
37
|
-
import { ILanguageService } from '
|
|
38
|
-
import { mainWindow } from '
|
|
35
|
+
import { getIconsStyleSheet } from 'vscode/vscode/vs/platform/theme/browser/iconsStyleSheet';
|
|
36
|
+
import { getColorRegistry, asCssVariableName } from 'vscode/vscode/vs/platform/theme/common/colorRegistry';
|
|
37
|
+
import { ILanguageService } from 'vscode/vscode/vs/editor/common/languages/language';
|
|
38
|
+
import { mainWindow } from 'vscode/vscode/vs/base/browser/window';
|
|
39
39
|
|
|
40
40
|
const PERSISTED_OS_COLOR_SCHEME = 'osColorScheme';
|
|
41
41
|
const PERSISTED_OS_COLOR_SCHEME_SCOPE = -1 ;
|
|
@@ -140,7 +140,7 @@ let WorkbenchThemeService = class WorkbenchThemeService {
|
|
|
140
140
|
this.installConfigurationListener();
|
|
141
141
|
this.installPreferredSchemeListener();
|
|
142
142
|
this.installRegistryListeners();
|
|
143
|
-
this.initialize().catch(
|
|
143
|
+
this.initialize().catch(onUnexpectedError);
|
|
144
144
|
});
|
|
145
145
|
const codiconStyleSheet = createStyleSheet();
|
|
146
146
|
codiconStyleSheet.id = 'codiconStyles';
|
|
@@ -261,7 +261,7 @@ let WorkbenchThemeService = class WorkbenchThemeService {
|
|
|
261
261
|
this.colorThemeRegistry.onDidChange(async (event) => {
|
|
262
262
|
updateColorThemeConfigurationSchemas(event.themes);
|
|
263
263
|
if (await this.restoreColorTheme()) {
|
|
264
|
-
if (this.currentColorTheme.settingsId === ThemeSettingDefaults.COLOR_THEME_DARK && !
|
|
264
|
+
if (this.currentColorTheme.settingsId === ThemeSettingDefaults.COLOR_THEME_DARK && !isUndefined(prevColorId) && (await this.colorThemeRegistry.findThemeById(prevColorId))) {
|
|
265
265
|
await this.setColorTheme(prevColorId, 'auto');
|
|
266
266
|
prevColorId = undefined;
|
|
267
267
|
}
|
|
@@ -279,7 +279,7 @@ let WorkbenchThemeService = class WorkbenchThemeService {
|
|
|
279
279
|
this.fileIconThemeRegistry.onDidChange(async (event) => {
|
|
280
280
|
updateFileIconThemeConfigurationSchemas(event.themes);
|
|
281
281
|
if (await this.restoreFileIconTheme()) {
|
|
282
|
-
if (this.currentFileIconTheme.id === DEFAULT_FILE_ICON_THEME_ID && !
|
|
282
|
+
if (this.currentFileIconTheme.id === DEFAULT_FILE_ICON_THEME_ID && !isUndefined(prevFileIconId) && this.fileIconThemeRegistry.findThemeById(prevFileIconId)) {
|
|
283
283
|
await this.setFileIconTheme(prevFileIconId, 'auto');
|
|
284
284
|
prevFileIconId = undefined;
|
|
285
285
|
}
|
|
@@ -296,7 +296,7 @@ let WorkbenchThemeService = class WorkbenchThemeService {
|
|
|
296
296
|
this.productIconThemeRegistry.onDidChange(async (event) => {
|
|
297
297
|
updateProductIconThemeConfigurationSchemas(event.themes);
|
|
298
298
|
if (await this.restoreProductIconTheme()) {
|
|
299
|
-
if (this.currentProductIconTheme.id === DEFAULT_PRODUCT_ICON_THEME_ID && !
|
|
299
|
+
if (this.currentProductIconTheme.id === DEFAULT_PRODUCT_ICON_THEME_ID && !isUndefined(prevProductIconId) && this.productIconThemeRegistry.findThemeById(prevProductIconId)) {
|
|
300
300
|
await this.setProductIconTheme(prevProductIconId, 'auto');
|
|
301
301
|
prevProductIconId = undefined;
|
|
302
302
|
}
|
|
@@ -385,7 +385,7 @@ let WorkbenchThemeService = class WorkbenchThemeService {
|
|
|
385
385
|
const extensionLocation = this.extensionResourceLoaderService.getExtensionGalleryResourceURL({ publisher, name, version }, 'extension');
|
|
386
386
|
if (extensionLocation) {
|
|
387
387
|
try {
|
|
388
|
-
const manifestContent = await this.extensionResourceLoaderService.readExtensionResource(
|
|
388
|
+
const manifestContent = await this.extensionResourceLoaderService.readExtensionResource(joinPath(extensionLocation, 'package.json'));
|
|
389
389
|
return this.colorThemeRegistry.getMarketplaceThemes(JSON.parse(manifestContent), extensionLocation, ExtensionData.fromName(publisher, name));
|
|
390
390
|
}
|
|
391
391
|
catch (e) {
|
|
@@ -406,7 +406,7 @@ let WorkbenchThemeService = class WorkbenchThemeService {
|
|
|
406
406
|
if (!themeIdOrTheme) {
|
|
407
407
|
return null;
|
|
408
408
|
}
|
|
409
|
-
const themeId =
|
|
409
|
+
const themeId = isString(themeIdOrTheme) ? validateThemeId(themeIdOrTheme) : themeIdOrTheme.id;
|
|
410
410
|
if (this.currentColorTheme.isLoaded && themeId === this.currentColorTheme.id) {
|
|
411
411
|
if (settingsTarget !== 'preview') {
|
|
412
412
|
this.currentColorTheme.toStorage(this.storageService);
|
|
@@ -428,7 +428,7 @@ let WorkbenchThemeService = class WorkbenchThemeService {
|
|
|
428
428
|
return this.applyTheme(themeData, settingsTarget);
|
|
429
429
|
}
|
|
430
430
|
catch (error) {
|
|
431
|
-
throw new Error(
|
|
431
|
+
throw new Error(localizeWithPath('vs/workbench/services/themes/browser/workbenchThemeService', 'error.cannotloadtheme', "Unable to load {0}: {1}", themeData.location?.toString(), error.message));
|
|
432
432
|
}
|
|
433
433
|
}
|
|
434
434
|
reloadCurrentColorTheme() {
|
|
@@ -541,7 +541,7 @@ let WorkbenchThemeService = class WorkbenchThemeService {
|
|
|
541
541
|
if (iconThemeOrId === undefined) {
|
|
542
542
|
iconThemeOrId = '';
|
|
543
543
|
}
|
|
544
|
-
const themeId =
|
|
544
|
+
const themeId = isString(iconThemeOrId) ? iconThemeOrId : iconThemeOrId.id;
|
|
545
545
|
if (themeId !== this.currentFileIconTheme.id || !this.currentFileIconTheme.isLoaded) {
|
|
546
546
|
let newThemeData = this.fileIconThemeRegistry.findThemeById(themeId);
|
|
547
547
|
if (!newThemeData && iconThemeOrId instanceof FileIconThemeData) {
|
|
@@ -564,7 +564,7 @@ let WorkbenchThemeService = class WorkbenchThemeService {
|
|
|
564
564
|
const extensionLocation = this.extensionResourceLoaderService.getExtensionGalleryResourceURL({ publisher, name, version }, 'extension');
|
|
565
565
|
if (extensionLocation) {
|
|
566
566
|
try {
|
|
567
|
-
const manifestContent = await this.extensionResourceLoaderService.readExtensionResource(
|
|
567
|
+
const manifestContent = await this.extensionResourceLoaderService.readExtensionResource(joinPath(extensionLocation, 'package.json'));
|
|
568
568
|
return this.fileIconThemeRegistry.getMarketplaceThemes(JSON.parse(manifestContent), extensionLocation, ExtensionData.fromName(publisher, name));
|
|
569
569
|
}
|
|
570
570
|
catch (e) {
|
|
@@ -631,7 +631,7 @@ let WorkbenchThemeService = class WorkbenchThemeService {
|
|
|
631
631
|
if (iconThemeOrId === undefined) {
|
|
632
632
|
iconThemeOrId = '';
|
|
633
633
|
}
|
|
634
|
-
const themeId =
|
|
634
|
+
const themeId = isString(iconThemeOrId) ? iconThemeOrId : iconThemeOrId.id;
|
|
635
635
|
if (themeId !== this.currentProductIconTheme.id || !this.currentProductIconTheme.isLoaded) {
|
|
636
636
|
let newThemeData = this.productIconThemeRegistry.findThemeById(themeId);
|
|
637
637
|
if (!newThemeData && iconThemeOrId instanceof ProductIconThemeData) {
|
|
@@ -654,7 +654,7 @@ let WorkbenchThemeService = class WorkbenchThemeService {
|
|
|
654
654
|
const extensionLocation = this.extensionResourceLoaderService.getExtensionGalleryResourceURL({ publisher, name, version }, 'extension');
|
|
655
655
|
if (extensionLocation) {
|
|
656
656
|
try {
|
|
657
|
-
const manifestContent = await this.extensionResourceLoaderService.readExtensionResource(
|
|
657
|
+
const manifestContent = await this.extensionResourceLoaderService.readExtensionResource(joinPath(extensionLocation, 'package.json'));
|
|
658
658
|
return this.productIconThemeRegistry.getMarketplaceThemes(JSON.parse(manifestContent), extensionLocation, ExtensionData.fromName(publisher, name));
|
|
659
659
|
}
|
|
660
660
|
catch (e) {
|
|
@@ -719,7 +719,7 @@ class ThemeFileWatcher {
|
|
|
719
719
|
this.onUpdate = onUpdate;
|
|
720
720
|
}
|
|
721
721
|
update(theme) {
|
|
722
|
-
if (!
|
|
722
|
+
if (!isEqual(theme.location, this.watchedLocation)) {
|
|
723
723
|
this.dispose();
|
|
724
724
|
if (theme.location && (theme.watch || this.environmentService.isExtensionDevelopment)) {
|
|
725
725
|
this.watchedLocation = theme.location;
|