@theia/plugin-ext 1.25.0-next.4 → 1.25.0-next.40

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 (122) hide show
  1. package/lib/common/plugin-api-rpc-model.d.ts +1 -15
  2. package/lib/common/plugin-api-rpc-model.d.ts.map +1 -1
  3. package/lib/common/plugin-api-rpc-model.js.map +1 -1
  4. package/lib/common/plugin-api-rpc.d.ts +15 -22
  5. package/lib/common/plugin-api-rpc.d.ts.map +1 -1
  6. package/lib/common/plugin-api-rpc.js +2 -0
  7. package/lib/common/plugin-api-rpc.js.map +1 -1
  8. package/lib/common/uri-components.d.ts +2 -9
  9. package/lib/common/uri-components.d.ts.map +1 -1
  10. package/lib/common/uri-components.js +1 -7
  11. package/lib/common/uri-components.js.map +1 -1
  12. package/lib/hosted/node/hosted-plugin-localization-service.js +17 -2
  13. package/lib/hosted/node/hosted-plugin-localization-service.js.map +1 -1
  14. package/lib/main/browser/callhierarchy/callhierarchy-type-converters.d.ts +9 -9
  15. package/lib/main/browser/callhierarchy/callhierarchy-type-converters.d.ts.map +1 -1
  16. package/lib/main/browser/callhierarchy/callhierarchy-type-converters.js +70 -89
  17. package/lib/main/browser/callhierarchy/callhierarchy-type-converters.js.map +1 -1
  18. package/lib/main/browser/debug/plugin-debug-adapter-contribution.d.ts +0 -12
  19. package/lib/main/browser/debug/plugin-debug-adapter-contribution.d.ts.map +1 -1
  20. package/lib/main/browser/debug/plugin-debug-adapter-contribution.js +0 -18
  21. package/lib/main/browser/debug/plugin-debug-adapter-contribution.js.map +1 -1
  22. package/lib/main/browser/debug/plugin-debug-configuration-provider.d.ts +2 -2
  23. package/lib/main/browser/debug/plugin-debug-configuration-provider.d.ts.map +1 -1
  24. package/lib/main/browser/debug/plugin-debug-configuration-provider.js.map +1 -1
  25. package/lib/main/browser/debug/plugin-debug-service.d.ts +3 -2
  26. package/lib/main/browser/debug/plugin-debug-service.d.ts.map +1 -1
  27. package/lib/main/browser/debug/plugin-debug-service.js +28 -29
  28. package/lib/main/browser/debug/plugin-debug-service.js.map +1 -1
  29. package/lib/main/browser/languages-main.d.ts.map +1 -1
  30. package/lib/main/browser/languages-main.js +7 -1
  31. package/lib/main/browser/languages-main.js.map +1 -1
  32. package/lib/main/browser/main-context.d.ts.map +1 -1
  33. package/lib/main/browser/main-context.js +3 -0
  34. package/lib/main/browser/main-context.js.map +1 -1
  35. package/lib/main/browser/notification-main.d.ts +2 -1
  36. package/lib/main/browser/notification-main.d.ts.map +1 -1
  37. package/lib/main/browser/notification-main.js +12 -4
  38. package/lib/main/browser/notification-main.js.map +1 -1
  39. package/lib/main/browser/plugin-ext-frontend-module.d.ts.map +1 -1
  40. package/lib/main/browser/plugin-ext-frontend-module.js +3 -0
  41. package/lib/main/browser/plugin-ext-frontend-module.js.map +1 -1
  42. package/lib/main/browser/status-bar-message-registry-main.d.ts +2 -1
  43. package/lib/main/browser/status-bar-message-registry-main.d.ts.map +1 -1
  44. package/lib/main/browser/status-bar-message-registry-main.js +9 -1
  45. package/lib/main/browser/status-bar-message-registry-main.js.map +1 -1
  46. package/lib/main/browser/view/tree-view-decorator-service.d.ts +33 -0
  47. package/lib/main/browser/view/tree-view-decorator-service.d.ts.map +1 -0
  48. package/lib/main/browser/view/tree-view-decorator-service.js +70 -0
  49. package/lib/main/browser/view/tree-view-decorator-service.js.map +1 -0
  50. package/lib/main/browser/view/tree-view-widget.d.ts +2 -0
  51. package/lib/main/browser/view/tree-view-widget.d.ts.map +1 -1
  52. package/lib/main/browser/view/tree-view-widget.js +9 -1
  53. package/lib/main/browser/view/tree-view-widget.js.map +1 -1
  54. package/lib/plugin/comments.js.map +1 -1
  55. package/lib/plugin/languages/call-hierarchy.d.ts +8 -7
  56. package/lib/plugin/languages/call-hierarchy.d.ts.map +1 -1
  57. package/lib/plugin/languages/call-hierarchy.js +39 -31
  58. package/lib/plugin/languages/call-hierarchy.js.map +1 -1
  59. package/lib/plugin/languages/lens.js.map +1 -1
  60. package/lib/plugin/languages.d.ts +5 -4
  61. package/lib/plugin/languages.d.ts.map +1 -1
  62. package/lib/plugin/languages.js +3 -0
  63. package/lib/plugin/languages.js.map +1 -1
  64. package/lib/plugin/node/debug/debug.d.ts +2 -5
  65. package/lib/plugin/node/debug/debug.d.ts.map +1 -1
  66. package/lib/plugin/node/debug/debug.js +1 -60
  67. package/lib/plugin/node/debug/debug.js.map +1 -1
  68. package/lib/plugin/notification.d.ts +2 -0
  69. package/lib/plugin/notification.d.ts.map +1 -1
  70. package/lib/plugin/notification.js +14 -2
  71. package/lib/plugin/notification.js.map +1 -1
  72. package/lib/plugin/quick-open.d.ts +3 -1
  73. package/lib/plugin/quick-open.d.ts.map +1 -1
  74. package/lib/plugin/quick-open.js +9 -30
  75. package/lib/plugin/quick-open.js.map +1 -1
  76. package/lib/plugin/status-bar/status-bar-item.d.ts +13 -2
  77. package/lib/plugin/status-bar/status-bar-item.d.ts.map +1 -1
  78. package/lib/plugin/status-bar/status-bar-item.js +38 -1
  79. package/lib/plugin/status-bar/status-bar-item.js.map +1 -1
  80. package/lib/plugin/tree/tree-views.d.ts.map +1 -1
  81. package/lib/plugin/tree/tree-views.js +4 -2
  82. package/lib/plugin/tree/tree-views.js.map +1 -1
  83. package/lib/plugin/type-converters.d.ts +1 -1
  84. package/lib/plugin/type-converters.d.ts.map +1 -1
  85. package/lib/plugin/type-converters.js +10 -6
  86. package/lib/plugin/type-converters.js.map +1 -1
  87. package/lib/plugin/type-converters.spec.js +16 -1
  88. package/lib/plugin/type-converters.spec.js.map +1 -1
  89. package/lib/plugin/types-impl.d.ts +5 -2
  90. package/lib/plugin/types-impl.d.ts.map +1 -1
  91. package/lib/plugin/types-impl.js.map +1 -1
  92. package/lib/plugin/workspace.d.ts +1 -1
  93. package/lib/plugin/workspace.d.ts.map +1 -1
  94. package/package.json +23 -23
  95. package/src/common/plugin-api-rpc-model.ts +1 -17
  96. package/src/common/plugin-api-rpc.ts +34 -26
  97. package/src/common/uri-components.ts +4 -17
  98. package/src/hosted/node/hosted-plugin-localization-service.ts +23 -2
  99. package/src/main/browser/callhierarchy/callhierarchy-type-converters.ts +85 -97
  100. package/src/main/browser/debug/plugin-debug-adapter-contribution.ts +0 -21
  101. package/src/main/browser/debug/plugin-debug-configuration-provider.ts +8 -2
  102. package/src/main/browser/debug/plugin-debug-service.ts +53 -31
  103. package/src/main/browser/languages-main.ts +8 -4
  104. package/src/main/browser/main-context.ts +4 -0
  105. package/src/main/browser/notification-main.ts +13 -4
  106. package/src/main/browser/plugin-ext-frontend-module.ts +3 -0
  107. package/src/main/browser/status-bar-message-registry-main.ts +12 -0
  108. package/src/main/browser/view/tree-view-decorator-service.ts +52 -0
  109. package/src/main/browser/view/tree-view-widget.tsx +15 -1
  110. package/src/plugin/comments.ts +1 -1
  111. package/src/plugin/languages/call-hierarchy.ts +44 -50
  112. package/src/plugin/languages/lens.ts +1 -1
  113. package/src/plugin/languages.ts +11 -6
  114. package/src/plugin/node/debug/debug.ts +22 -78
  115. package/src/plugin/notification.ts +18 -2
  116. package/src/plugin/quick-open.ts +11 -33
  117. package/src/plugin/status-bar/status-bar-item.ts +57 -5
  118. package/src/plugin/tree/tree-views.ts +4 -2
  119. package/src/plugin/type-converters.spec.ts +20 -1
  120. package/src/plugin/type-converters.ts +13 -7
  121. package/src/plugin/types-impl.ts +6 -2
  122. package/src/plugin/workspace.ts +1 -1
@@ -451,6 +451,7 @@ export class QuickInputExt implements QuickInput {
451
451
  }
452
452
 
453
453
  _fireChangedValue(changedValue: string): void {
454
+ this._value = changedValue;
454
455
  this._onDidChangeValueEmitter.fire(changedValue);
455
456
  }
456
457
 
@@ -533,39 +534,6 @@ export class InputBoxExt extends QuickInputExt implements InputBox {
533
534
  this.update({ validationMessage });
534
535
  }
535
536
  }
536
-
537
- override async show(): Promise<void> {
538
- super.show();
539
-
540
- const update = (value: string) => {
541
- this.value = value;
542
- if (this.validationMessage && this.validationMessage.length > 0) {
543
- return this.validationMessage;
544
- }
545
- };
546
-
547
- this.quickOpen.showInputBox({
548
- id: this._id,
549
- busy: this.busy,
550
- buttons: this.buttons,
551
- enabled: this.enabled,
552
- ignoreFocusOut: this.ignoreFocusOut,
553
- password: this.password,
554
- placeholder: this.placeholder,
555
- prompt: this.prompt,
556
- step: this.step,
557
- title: this.title,
558
- totalSteps: this.totalSteps,
559
- validationMessage: this.validationMessage,
560
- value: this.value,
561
- visible: this.visible,
562
- validateInput(value: string): string | undefined {
563
- if (value.length > 0) {
564
- return update(value);
565
- }
566
- }
567
- });
568
- }
569
537
  }
570
538
 
571
539
  /**
@@ -580,6 +548,7 @@ export class QuickPickExt<T extends theia.QuickPickItem> extends QuickInputExt i
580
548
  private _matchOnDescription = true;
581
549
  private _matchOnDetail = true;
582
550
  private _sortByLabel = true;
551
+ private _keepScrollPosition = false;
583
552
  private _activeItems: T[] = [];
584
553
  private _selectedItems: T[] = [];
585
554
  private readonly _onDidChangeActiveEmitter = new Emitter<T[]>();
@@ -666,6 +635,15 @@ export class QuickPickExt<T extends theia.QuickPickItem> extends QuickInputExt i
666
635
  this.update({ sortByLabel });
667
636
  }
668
637
 
638
+ get keepScrollPosition(): boolean {
639
+ return this._keepScrollPosition;
640
+ }
641
+
642
+ set keepScrollPosition(keepScrollPosition: boolean) {
643
+ this._keepScrollPosition = keepScrollPosition;
644
+ this.update({ keepScrollPosition });
645
+ }
646
+
669
647
  get activeItems(): T[] {
670
648
  return this._activeItems;
671
649
  }
@@ -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;
@@ -235,6 +235,19 @@ describe('Type converters:', () => {
235
235
  }
236
236
  };
237
237
 
238
+ const shellPluginTaskWithQuotedCommand: theia.Task = {
239
+ ...shellPluginTask, execution: {
240
+ command: {
241
+ quoting: types.ShellQuoting.Strong,
242
+ value: 'yarn'
243
+ },
244
+ args,
245
+ options: {
246
+ cwd
247
+ }
248
+ }
249
+ };
250
+
238
251
  const pluginTaskWithCommandLine: theia.Task = {
239
252
  name: label,
240
253
  source,
@@ -278,7 +291,7 @@ describe('Type converters:', () => {
278
291
  }
279
292
  };
280
293
 
281
- it('should convert to task dto', () => {
294
+ it('should convert to task dto with string command', () => {
282
295
  // when
283
296
  const result: TaskDto | undefined = Converter.fromTask(shellPluginTask);
284
297
 
@@ -287,6 +300,12 @@ describe('Type converters:', () => {
287
300
  assert.deepStrictEqual(result, shellTaskDto);
288
301
  });
289
302
 
303
+ it('should convert to task dto with ShellStringQuoted', () => {
304
+ const result: TaskDto | undefined = Converter.fromTask(shellPluginTaskWithQuotedCommand);
305
+ assert.notStrictEqual(result, undefined);
306
+ assert.deepStrictEqual(result, shellTaskDto);
307
+ });
308
+
290
309
  it('should convert from task dto', () => {
291
310
  // when
292
311
  const result: theia.Task = Converter.toTask(shellTaskDto);
@@ -675,7 +675,7 @@ export function toLocation(value: model.Location): types.Location {
675
675
  return new types.Location(URI.revive(value.uri), toRange(value.range));
676
676
  }
677
677
 
678
- export function fromCallHierarchyItem(item: theia.CallHierarchyItem): model.CallHierarchyItem {
678
+ export function fromCallHierarchyItem(item: types.CallHierarchyItem): model.CallHierarchyItem {
679
679
  return <model.CallHierarchyItem>{
680
680
  kind: SymbolKind.fromSymbolKind(item.kind),
681
681
  name: item.name,
@@ -684,7 +684,8 @@ export function fromCallHierarchyItem(item: theia.CallHierarchyItem): model.Call
684
684
  range: fromRange(item.range),
685
685
  selectionRange: fromRange(item.selectionRange),
686
686
  tags: item.tags,
687
- data: item.data,
687
+ _itemId: item._itemId,
688
+ _sessionId: item._sessionId,
688
689
  };
689
690
  }
690
691
 
@@ -698,7 +699,9 @@ export function toCallHierarchyItem(value: model.CallHierarchyItem): types.CallH
698
699
  toRange(value.selectionRange),
699
700
  );
700
701
  item.tags = value.tags;
701
- item.data = value.data;
702
+ item._itemId = value._itemId;
703
+ item._sessionId = value._sessionId;
704
+
702
705
  return item;
703
706
  }
704
707
 
@@ -885,13 +888,12 @@ export function fromShellExecution(execution: theia.ShellExecution, taskDto: Tas
885
888
  return taskDto;
886
889
  }
887
890
 
888
- const command = execution.command;
889
- if (typeof command === 'string') {
890
- taskDto.command = command;
891
+ if (execution.command) {
892
+ taskDto.command = getCommand(execution.command);
891
893
  taskDto.args = getShellArgs(execution.args);
892
894
  return taskDto;
893
895
  } else {
894
- throw new Error('Converting ShellQuotedString command is not implemented');
896
+ throw new Error('Command is undefined');
895
897
  }
896
898
  }
897
899
 
@@ -949,6 +951,10 @@ export function getShellArgs(args: undefined | (string | theia.ShellQuotedString
949
951
  return result;
950
952
  }
951
953
 
954
+ function getCommand(command: string | theia.ShellQuotedString): string {
955
+ return typeof command === 'string' ? command : command.value;
956
+ }
957
+
952
958
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
953
959
  export function getShellExecutionOptions(options: theia.ShellExecutionOptions): { [key: string]: any } {
954
960
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -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
@@ -2432,7 +2437,6 @@ export class CallHierarchyItem {
2432
2437
  range: Range;
2433
2438
  selectionRange: Range;
2434
2439
  tags?: readonly SymbolTag[];
2435
- data?: unknown;
2436
2440
 
2437
2441
  constructor(kind: SymbolKind, name: string, detail: string, uri: URI, range: Range, selectionRange: Range) {
2438
2442
  this.kind = kind;
@@ -2443,7 +2447,7 @@ export class CallHierarchyItem {
2443
2447
  this.selectionRange = selectionRange;
2444
2448
  }
2445
2449
 
2446
- static isCallHierarchyItem(thing: {}): thing is theia.CallHierarchyItem {
2450
+ static isCallHierarchyItem(thing: {}): thing is CallHierarchyItem {
2447
2451
  if (thing instanceof CallHierarchyItem) {
2448
2452
  return true;
2449
2453
  }
@@ -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) {