@codingame/monaco-vscode-theme-service-override 2.2.2 → 3.0.0

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-theme-service-override",
3
- "version": "2.2.2",
3
+ "version": "3.0.0",
4
4
  "keywords": [],
5
5
  "author": {
6
6
  "name": "CodinGame",
@@ -18,7 +18,7 @@
18
18
  "module": "index.js",
19
19
  "types": "index.d.ts",
20
20
  "dependencies": {
21
- "vscode": "npm:@codingame/monaco-vscode-api@2.2.2",
22
- "@codingame/monaco-vscode-files-service-override": "2.2.2"
21
+ "vscode": "npm:@codingame/monaco-vscode-api@3.0.0",
22
+ "@codingame/monaco-vscode-files-service-override": "3.0.0"
23
23
  }
24
24
  }
@@ -4,9 +4,14 @@ import { joinPath, isEqualOrParent } from 'vscode/vscode/vs/base/common/resource
4
4
  import { ExtensionsRegistry } from 'vscode/vscode/vs/workbench/services/extensions/common/extensionsRegistry';
5
5
  import { VS_DARK_THEME, VS_LIGHT_THEME, VS_HC_THEME, VS_HC_LIGHT_THEME, ExtensionData } from 'vscode/vscode/vs/workbench/services/themes/common/workbenchThemeService';
6
6
  import { Emitter } from 'vscode/vscode/vs/base/common/event';
7
+ import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
8
+ import { Extensions } from 'vscode/vscode/vs/workbench/services/extensionManagement/common/extensionFeatures';
9
+ import { MarkdownString } from 'vscode/vscode/vs/base/common/htmlContent';
10
+ import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
11
+ import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
7
12
 
8
13
  function registerColorThemeExtensionPoint() {
9
- return ( ExtensionsRegistry.registerExtensionPoint({
14
+ return ExtensionsRegistry.registerExtensionPoint({
10
15
  extensionPoint: 'themes',
11
16
  jsonSchema: {
12
17
  description: ( localizeWithPath(
@@ -55,10 +60,10 @@ function registerColorThemeExtensionPoint() {
55
60
  required: ['path', 'uiTheme']
56
61
  }
57
62
  }
58
- }));
63
+ });
59
64
  }
60
65
  function registerFileIconThemeExtensionPoint() {
61
- return ( ExtensionsRegistry.registerExtensionPoint({
66
+ return ExtensionsRegistry.registerExtensionPoint({
62
67
  extensionPoint: 'iconThemes',
63
68
  jsonSchema: {
64
69
  description: ( localizeWithPath(
@@ -99,10 +104,10 @@ function registerFileIconThemeExtensionPoint() {
99
104
  required: ['path', 'id']
100
105
  }
101
106
  }
102
- }));
107
+ });
103
108
  }
104
109
  function registerProductIconThemeExtensionPoint() {
105
- return ( ExtensionsRegistry.registerExtensionPoint({
110
+ return ExtensionsRegistry.registerExtensionPoint({
106
111
  extensionPoint: 'productIconThemes',
107
112
  jsonSchema: {
108
113
  description: ( localizeWithPath(
@@ -143,8 +148,66 @@ function registerProductIconThemeExtensionPoint() {
143
148
  required: ['path', 'id']
144
149
  }
145
150
  }
146
- }));
151
+ });
147
152
  }
153
+ class ThemeDataRenderer extends Disposable {
154
+ constructor() {
155
+ super(...arguments);
156
+ this.type = 'markdown';
157
+ }
158
+ shouldRender(manifest) {
159
+ return !!manifest.contributes?.themes || !!manifest.contributes?.iconThemes || !!manifest.contributes?.productIconThemes;
160
+ }
161
+ render(manifest) {
162
+ const markdown = ( new MarkdownString());
163
+ if (manifest.contributes?.themes) {
164
+ markdown.appendMarkdown(`### ${( localizeWithPath(
165
+ 'vs/workbench/services/themes/common/themeExtensionPoints',
166
+ 'color themes',
167
+ "Color Themes"
168
+ ))}\n\n`);
169
+ for (const theme of manifest.contributes.themes) {
170
+ markdown.appendMarkdown(`- ${theme.label}\n`);
171
+ }
172
+ }
173
+ if (manifest.contributes?.iconThemes) {
174
+ markdown.appendMarkdown(`### ${( localizeWithPath(
175
+ 'vs/workbench/services/themes/common/themeExtensionPoints',
176
+ 'file icon themes',
177
+ "File Icon Themes"
178
+ ))}\n\n`);
179
+ for (const theme of manifest.contributes.iconThemes) {
180
+ markdown.appendMarkdown(`- ${theme.label}\n`);
181
+ }
182
+ }
183
+ if (manifest.contributes?.productIconThemes) {
184
+ markdown.appendMarkdown(`### ${( localizeWithPath(
185
+ 'vs/workbench/services/themes/common/themeExtensionPoints',
186
+ 'product icon themes',
187
+ "Product Icon Themes"
188
+ ))}\n\n`);
189
+ for (const theme of manifest.contributes.productIconThemes) {
190
+ markdown.appendMarkdown(`- ${theme.label}\n`);
191
+ }
192
+ }
193
+ return {
194
+ data: markdown,
195
+ dispose: () => { }
196
+ };
197
+ }
198
+ }
199
+ ( Registry.as(Extensions.ExtensionFeaturesRegistry)).registerExtensionFeature({
200
+ id: 'themes',
201
+ label: ( localizeWithPath(
202
+ 'vs/workbench/services/themes/common/themeExtensionPoints',
203
+ 'themes',
204
+ "Themes"
205
+ )),
206
+ access: {
207
+ canToggle: false
208
+ },
209
+ renderer: ( new SyncDescriptor(ThemeDataRenderer)),
210
+ });
148
211
  class ThemeRegistry {
149
212
  constructor(themesExtPoint, create, idRequired = false, builtInTheme = undefined) {
150
213
  this.themesExtPoint = themesExtPoint;