@theia/plugin-ext 1.25.0-next.3 → 1.25.0-next.32

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.
Files changed (86) hide show
  1. package/lib/common/plugin-api-rpc.d.ts +10 -18
  2. package/lib/common/plugin-api-rpc.d.ts.map +1 -1
  3. package/lib/common/plugin-api-rpc.js +2 -0
  4. package/lib/common/plugin-api-rpc.js.map +1 -1
  5. package/lib/hosted/node/hosted-plugin-localization-service.js +17 -2
  6. package/lib/hosted/node/hosted-plugin-localization-service.js.map +1 -1
  7. package/lib/main/browser/debug/plugin-debug-adapter-contribution.d.ts +0 -12
  8. package/lib/main/browser/debug/plugin-debug-adapter-contribution.d.ts.map +1 -1
  9. package/lib/main/browser/debug/plugin-debug-adapter-contribution.js +0 -18
  10. package/lib/main/browser/debug/plugin-debug-adapter-contribution.js.map +1 -1
  11. package/lib/main/browser/debug/plugin-debug-configuration-provider.d.ts +2 -2
  12. package/lib/main/browser/debug/plugin-debug-configuration-provider.d.ts.map +1 -1
  13. package/lib/main/browser/debug/plugin-debug-configuration-provider.js.map +1 -1
  14. package/lib/main/browser/debug/plugin-debug-service.d.ts +3 -2
  15. package/lib/main/browser/debug/plugin-debug-service.d.ts.map +1 -1
  16. package/lib/main/browser/debug/plugin-debug-service.js +28 -29
  17. package/lib/main/browser/debug/plugin-debug-service.js.map +1 -1
  18. package/lib/main/browser/main-context.d.ts.map +1 -1
  19. package/lib/main/browser/main-context.js +3 -0
  20. package/lib/main/browser/main-context.js.map +1 -1
  21. package/lib/main/browser/notification-main.d.ts +2 -1
  22. package/lib/main/browser/notification-main.d.ts.map +1 -1
  23. package/lib/main/browser/notification-main.js +12 -4
  24. package/lib/main/browser/notification-main.js.map +1 -1
  25. package/lib/main/browser/plugin-ext-frontend-module.d.ts.map +1 -1
  26. package/lib/main/browser/plugin-ext-frontend-module.js +3 -0
  27. package/lib/main/browser/plugin-ext-frontend-module.js.map +1 -1
  28. package/lib/main/browser/status-bar-message-registry-main.d.ts +2 -1
  29. package/lib/main/browser/status-bar-message-registry-main.d.ts.map +1 -1
  30. package/lib/main/browser/status-bar-message-registry-main.js +9 -1
  31. package/lib/main/browser/status-bar-message-registry-main.js.map +1 -1
  32. package/lib/main/browser/view/tree-view-decorator-service.d.ts +33 -0
  33. package/lib/main/browser/view/tree-view-decorator-service.d.ts.map +1 -0
  34. package/lib/main/browser/view/tree-view-decorator-service.js +70 -0
  35. package/lib/main/browser/view/tree-view-decorator-service.js.map +1 -0
  36. package/lib/main/browser/view/tree-view-widget.d.ts +2 -0
  37. package/lib/main/browser/view/tree-view-widget.d.ts.map +1 -1
  38. package/lib/main/browser/view/tree-view-widget.js +9 -1
  39. package/lib/main/browser/view/tree-view-widget.js.map +1 -1
  40. package/lib/plugin/comments.js.map +1 -1
  41. package/lib/plugin/languages/lens.js.map +1 -1
  42. package/lib/plugin/node/debug/debug.d.ts +2 -5
  43. package/lib/plugin/node/debug/debug.d.ts.map +1 -1
  44. package/lib/plugin/node/debug/debug.js +1 -60
  45. package/lib/plugin/node/debug/debug.js.map +1 -1
  46. package/lib/plugin/notification.d.ts +2 -0
  47. package/lib/plugin/notification.d.ts.map +1 -1
  48. package/lib/plugin/notification.js +14 -2
  49. package/lib/plugin/notification.js.map +1 -1
  50. package/lib/plugin/quick-open.d.ts +3 -0
  51. package/lib/plugin/quick-open.d.ts.map +1 -1
  52. package/lib/plugin/quick-open.js +8 -0
  53. package/lib/plugin/quick-open.js.map +1 -1
  54. package/lib/plugin/status-bar/status-bar-item.d.ts +13 -2
  55. package/lib/plugin/status-bar/status-bar-item.d.ts.map +1 -1
  56. package/lib/plugin/status-bar/status-bar-item.js +38 -1
  57. package/lib/plugin/status-bar/status-bar-item.js.map +1 -1
  58. package/lib/plugin/tree/tree-views.d.ts.map +1 -1
  59. package/lib/plugin/tree/tree-views.js +4 -2
  60. package/lib/plugin/tree/tree-views.js.map +1 -1
  61. package/lib/plugin/types-impl.d.ts +4 -0
  62. package/lib/plugin/types-impl.d.ts.map +1 -1
  63. package/lib/plugin/types-impl.js.map +1 -1
  64. package/lib/plugin/workspace.d.ts +1 -1
  65. package/lib/plugin/workspace.d.ts.map +1 -1
  66. package/package.json +23 -23
  67. package/src/common/plugin-api-rpc.ts +27 -21
  68. package/src/hosted/node/hosted-plugin-localization-service.ts +23 -2
  69. package/src/main/browser/debug/plugin-debug-adapter-contribution.ts +0 -21
  70. package/src/main/browser/debug/plugin-debug-configuration-provider.ts +8 -2
  71. package/src/main/browser/debug/plugin-debug-service.ts +53 -31
  72. package/src/main/browser/main-context.ts +4 -0
  73. package/src/main/browser/notification-main.ts +13 -4
  74. package/src/main/browser/plugin-ext-frontend-module.ts +3 -0
  75. package/src/main/browser/status-bar-message-registry-main.ts +12 -0
  76. package/src/main/browser/view/tree-view-decorator-service.ts +52 -0
  77. package/src/main/browser/view/tree-view-widget.tsx +15 -1
  78. package/src/plugin/comments.ts +1 -1
  79. package/src/plugin/languages/lens.ts +1 -1
  80. package/src/plugin/node/debug/debug.ts +22 -78
  81. package/src/plugin/notification.ts +18 -2
  82. package/src/plugin/quick-open.ts +10 -0
  83. package/src/plugin/status-bar/status-bar-item.ts +57 -5
  84. package/src/plugin/tree/tree-views.ts +4 -2
  85. package/src/plugin/types-impl.ts +5 -0
  86. package/src/plugin/workspace.ts +1 -1
@@ -20,15 +20,24 @@ import { UUID } from '@theia/core/shared/@phosphor/coreutils';
20
20
 
21
21
  export class StatusBarItemImpl implements theia.StatusBarItem {
22
22
 
23
+ /** Map from allowed background colors to corresponding foreground colors. */
24
+ private static BACKGROUND_COLORS = new Map<string, string>([
25
+ ['statusBarItem.errorBackground', 'statusBarItem.errorForeground'],
26
+ ['statusBarItem.warningBackground', 'statusBarItem.warningForeground']
27
+ ]);
28
+
23
29
  private _id: string;
24
30
 
25
31
  private _alignment: StatusBarAlignment;
26
32
  private _priority: number;
27
33
 
34
+ private _name: string | undefined;
28
35
  private _text: string;
29
36
  private _tooltip: string;
30
- private _color: string | ThemeColor;
37
+ private _color: string | ThemeColor | undefined;
38
+ private _backgroundColor: ThemeColor | undefined;
31
39
  private _command: string | theia.Command;
40
+ private _accessibilityInformation: theia.AccessibilityInformation;
32
41
 
33
42
  private _isVisible: boolean;
34
43
  private _timeoutHandle: NodeJS.Timer | undefined;
@@ -57,6 +66,10 @@ export class StatusBarItemImpl implements theia.StatusBarItem {
57
66
  return this._priority;
58
67
  }
59
68
 
69
+ public get name(): string | undefined {
70
+ return this._name;
71
+ }
72
+
60
73
  public get text(): string {
61
74
  return this._text;
62
75
  }
@@ -65,14 +78,27 @@ export class StatusBarItemImpl implements theia.StatusBarItem {
65
78
  return this._tooltip;
66
79
  }
67
80
 
68
- public get color(): string | ThemeColor {
81
+ public get color(): string | ThemeColor | undefined {
69
82
  return this._color;
70
83
  }
71
84
 
85
+ public get backgroundColor(): ThemeColor | undefined {
86
+ return this._backgroundColor;
87
+ }
88
+
72
89
  public get command(): string | theia.Command {
73
90
  return this._command;
74
91
  }
75
92
 
93
+ public get accessibilityInformation(): theia.AccessibilityInformation {
94
+ return this._accessibilityInformation;
95
+ }
96
+
97
+ public set name(name: string | undefined) {
98
+ this._name = name;
99
+ this.update();
100
+ }
101
+
76
102
  public set text(text: string) {
77
103
  this._text = text;
78
104
  this.update();
@@ -83,16 +109,30 @@ export class StatusBarItemImpl implements theia.StatusBarItem {
83
109
  this.update();
84
110
  }
85
111
 
86
- public set color(color: string | ThemeColor) {
112
+ public set color(color: string | ThemeColor | undefined) {
87
113
  this._color = color;
88
114
  this.update();
89
115
  }
90
116
 
117
+ public set backgroundColor(backgroundColor: ThemeColor | undefined) {
118
+ if (backgroundColor && StatusBarItemImpl.BACKGROUND_COLORS.has(backgroundColor.id)) {
119
+ this._backgroundColor = backgroundColor;
120
+ } else {
121
+ this._backgroundColor = undefined;
122
+ }
123
+ this.update();
124
+ }
125
+
91
126
  public set command(command: string | theia.Command) {
92
127
  this._command = command;
93
128
  this.update();
94
129
  }
95
130
 
131
+ public set accessibilityInformation(information: theia.AccessibilityInformation) {
132
+ this._accessibilityInformation = information;
133
+ this.update();
134
+ }
135
+
96
136
  public show(): void {
97
137
  this._isVisible = true;
98
138
  this.update();
@@ -119,13 +159,25 @@ export class StatusBarItemImpl implements theia.StatusBarItem {
119
159
 
120
160
  const commandId = typeof this.command === 'object' ? this.command.command : this.command;
121
161
  const args = typeof this.command === 'object' ? this.command.arguments : undefined;
162
+
163
+ let color = this.color;
164
+ if (this.backgroundColor) {
165
+ // If an error or warning background color is set, set the corresponding foreground color
166
+ color = StatusBarItemImpl.BACKGROUND_COLORS.get(this.backgroundColor.id);
167
+ }
168
+
122
169
  // Set to status bar
123
- this._proxy.$setMessage(this.id, this.text,
170
+ this._proxy.$setMessage(
171
+ this.id,
172
+ this.name,
173
+ this.text,
124
174
  this.priority,
125
175
  this.alignment,
126
- typeof this.color === 'string' ? this.color : this.color && this.color.id,
176
+ typeof color === 'string' ? color : color?.id,
177
+ this.backgroundColor?.id,
127
178
  this.tooltip,
128
179
  commandId,
180
+ this.accessibilityInformation,
129
181
  args);
130
182
  }, 0);
131
183
  }
@@ -262,7 +262,8 @@ class TreeViewExtImpl<T> implements Disposable {
262
262
  // root
263
263
  return [];
264
264
  }
265
- const parent = this.treeDataProvider.getParent && await this.treeDataProvider.getParent(element);
265
+ const result = this.treeDataProvider.getParent && await this.treeDataProvider.getParent(element);
266
+ const parent = result ? result : undefined;
266
267
  const chain = await this.calculateRevealParentChain(parent);
267
268
  if (!chain) {
268
269
  // parents are inconsistent
@@ -386,7 +387,8 @@ class TreeViewExtImpl<T> implements Disposable {
386
387
  tooltip: treeItem.tooltip,
387
388
  collapsibleState: treeItem.collapsibleState,
388
389
  contextValue: treeItem.contextValue,
389
- command: this.commandsConverter.toSafeCommand(treeItem.command, toDisposeElement)
390
+ command: this.commandsConverter.toSafeCommand(treeItem.command, toDisposeElement),
391
+ accessibilityInformation: treeItem.accessibilityInformation
390
392
  } as TreeViewItem;
391
393
 
392
394
  return treeViewItem;
@@ -151,6 +151,11 @@ export class Disposable {
151
151
  }
152
152
  }
153
153
 
154
+ export interface AccessibilityInformation {
155
+ label: string;
156
+ role?: string;
157
+ }
158
+
154
159
  export enum StatusBarAlignment {
155
160
  Left = 1,
156
161
  Right = 2
@@ -276,7 +276,7 @@ export class WorkspaceExtImpl implements WorkspaceExt {
276
276
  };
277
277
  }
278
278
 
279
- async $provideTextDocumentContent(documentURI: string): Promise<string | undefined> {
279
+ async $provideTextDocumentContent(documentURI: string): Promise<string | undefined | null> {
280
280
  const uri = URI.parse(documentURI);
281
281
  const provider = this.documentContentProviders.get(uri.scheme);
282
282
  if (provider) {