@theia/plugin-ext 1.18.0-next.8e7f15b3 → 1.18.0-next.93

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 (168) hide show
  1. package/LICENSE +642 -0
  2. package/lib/common/arrays.d.ts +4 -0
  3. package/lib/common/arrays.d.ts.map +1 -1
  4. package/lib/common/arrays.js +9 -1
  5. package/lib/common/arrays.js.map +1 -1
  6. package/lib/common/plugin-api-rpc-model.d.ts +2 -0
  7. package/lib/common/plugin-api-rpc-model.d.ts.map +1 -1
  8. package/lib/common/plugin-api-rpc-model.js.map +1 -1
  9. package/lib/common/plugin-api-rpc.d.ts +27 -8
  10. package/lib/common/plugin-api-rpc.d.ts.map +1 -1
  11. package/lib/common/plugin-api-rpc.js +21 -1
  12. package/lib/common/plugin-api-rpc.js.map +1 -1
  13. package/lib/common/plugin-protocol.d.ts.map +1 -1
  14. package/lib/common/plugin-protocol.js.map +1 -1
  15. package/lib/hosted/browser/hosted-plugin.d.ts +3 -2
  16. package/lib/hosted/browser/hosted-plugin.d.ts.map +1 -1
  17. package/lib/hosted/browser/hosted-plugin.js +15 -7
  18. package/lib/hosted/browser/hosted-plugin.js.map +1 -1
  19. package/lib/hosted/browser/worker/debug-stub.d.ts.map +1 -1
  20. package/lib/hosted/browser/worker/debug-stub.js +1 -0
  21. package/lib/hosted/browser/worker/debug-stub.js.map +1 -1
  22. package/lib/hosted/node/scanners/scanner-theia.d.ts.map +1 -1
  23. package/lib/hosted/node/scanners/scanner-theia.js +2 -2
  24. package/lib/hosted/node/scanners/scanner-theia.js.map +1 -1
  25. package/lib/main/browser/callhierarchy/callhierarchy-type-converters.d.ts.map +1 -1
  26. package/lib/main/browser/callhierarchy/callhierarchy-type-converters.js +2 -1
  27. package/lib/main/browser/callhierarchy/callhierarchy-type-converters.js.map +1 -1
  28. package/lib/main/browser/custom-editors/custom-editor-opener.d.ts +1 -0
  29. package/lib/main/browser/custom-editors/custom-editor-opener.d.ts.map +1 -1
  30. package/lib/main/browser/custom-editors/custom-editor-opener.js +6 -2
  31. package/lib/main/browser/custom-editors/custom-editor-opener.js.map +1 -1
  32. package/lib/main/browser/debug/debug-main.js +1 -1
  33. package/lib/main/browser/debug/debug-main.js.map +1 -1
  34. package/lib/main/browser/debug/plugin-debug-adapter-contribution.d.ts +1 -1
  35. package/lib/main/browser/debug/plugin-debug-adapter-contribution.d.ts.map +1 -1
  36. package/lib/main/browser/debug/plugin-debug-adapter-contribution.js +2 -2
  37. package/lib/main/browser/debug/plugin-debug-adapter-contribution.js.map +1 -1
  38. package/lib/main/browser/debug/plugin-debug-service.d.ts +8 -0
  39. package/lib/main/browser/debug/plugin-debug-service.d.ts.map +1 -1
  40. package/lib/main/browser/debug/plugin-debug-service.js +15 -0
  41. package/lib/main/browser/debug/plugin-debug-service.js.map +1 -1
  42. package/lib/main/browser/debug/plugin-debug-session-factory.d.ts +2 -2
  43. package/lib/main/browser/debug/plugin-debug-session-factory.d.ts.map +1 -1
  44. package/lib/main/browser/dialogs/modal-notification.d.ts +1 -1
  45. package/lib/main/browser/dialogs/modal-notification.d.ts.map +1 -1
  46. package/lib/main/browser/dialogs/modal-notification.js +4 -4
  47. package/lib/main/browser/dialogs/modal-notification.js.map +1 -1
  48. package/lib/main/browser/plugin-ext-frontend-module.d.ts.map +1 -1
  49. package/lib/main/browser/plugin-ext-frontend-module.js +5 -3
  50. package/lib/main/browser/plugin-ext-frontend-module.js.map +1 -1
  51. package/lib/main/browser/plugin-ext-widget.d.ts.map +1 -1
  52. package/lib/main/browser/plugin-ext-widget.js +3 -2
  53. package/lib/main/browser/plugin-ext-widget.js.map +1 -1
  54. package/lib/main/browser/plugin-icon-theme-service.d.ts +2 -0
  55. package/lib/main/browser/plugin-icon-theme-service.d.ts.map +1 -1
  56. package/lib/main/browser/plugin-icon-theme-service.js +15 -2
  57. package/lib/main/browser/plugin-icon-theme-service.js.map +1 -1
  58. package/lib/main/browser/plugin-shared-style.js +1 -1
  59. package/lib/main/browser/plugin-shared-style.js.map +1 -1
  60. package/lib/main/browser/quick-open-main.d.ts +3 -6
  61. package/lib/main/browser/quick-open-main.d.ts.map +1 -1
  62. package/lib/main/browser/quick-open-main.js +48 -100
  63. package/lib/main/browser/quick-open-main.js.map +1 -1
  64. package/lib/main/browser/view/plugin-view-registry.d.ts +3 -1
  65. package/lib/main/browser/view/plugin-view-registry.d.ts.map +1 -1
  66. package/lib/main/browser/view/plugin-view-registry.js +62 -21
  67. package/lib/main/browser/view/plugin-view-registry.js.map +1 -1
  68. package/lib/main/browser/view/plugin-view-widget.d.ts +9 -1
  69. package/lib/main/browser/view/plugin-view-widget.d.ts.map +1 -1
  70. package/lib/main/browser/view/plugin-view-widget.js +13 -1
  71. package/lib/main/browser/view/plugin-view-widget.js.map +1 -1
  72. package/lib/main/browser/view/tree-views-main.d.ts +1 -0
  73. package/lib/main/browser/view/tree-views-main.d.ts.map +1 -1
  74. package/lib/main/browser/view/tree-views-main.js +6 -0
  75. package/lib/main/browser/view/tree-views-main.js.map +1 -1
  76. package/lib/main/browser/webview/webview.d.ts +1 -1
  77. package/lib/main/browser/webview/webview.d.ts.map +1 -1
  78. package/lib/main/browser/webview/webview.js +2 -2
  79. package/lib/main/browser/webview/webview.js.map +1 -1
  80. package/lib/plugin/languages/call-hierarchy.d.ts.map +1 -1
  81. package/lib/plugin/languages/call-hierarchy.js +2 -1
  82. package/lib/plugin/languages/call-hierarchy.js.map +1 -1
  83. package/lib/plugin/languages.d.ts.map +1 -1
  84. package/lib/plugin/languages.js +2 -1
  85. package/lib/plugin/languages.js.map +1 -1
  86. package/lib/plugin/node/debug/debug.d.ts +4 -3
  87. package/lib/plugin/node/debug/debug.d.ts.map +1 -1
  88. package/lib/plugin/node/debug/debug.js +34 -15
  89. package/lib/plugin/node/debug/debug.js.map +1 -1
  90. package/lib/plugin/node/debug/plugin-debug-adapter-session.d.ts +3 -3
  91. package/lib/plugin/node/debug/plugin-debug-adapter-session.d.ts.map +1 -1
  92. package/lib/plugin/node/debug/plugin-debug-adapter-session.js.map +1 -1
  93. package/lib/plugin/node/debug/plugin-debug-adapter-starter.d.ts +6 -4
  94. package/lib/plugin/node/debug/plugin-debug-adapter-starter.d.ts.map +1 -1
  95. package/lib/plugin/node/debug/plugin-debug-adapter-starter.js +23 -13
  96. package/lib/plugin/node/debug/plugin-debug-adapter-starter.js.map +1 -1
  97. package/lib/plugin/plugin-context.d.ts.map +1 -1
  98. package/lib/plugin/plugin-context.js +9 -3
  99. package/lib/plugin/plugin-context.js.map +1 -1
  100. package/lib/plugin/plugin-manager.d.ts +2 -0
  101. package/lib/plugin/plugin-manager.d.ts.map +1 -1
  102. package/lib/plugin/plugin-manager.js +24 -3
  103. package/lib/plugin/plugin-manager.js.map +1 -1
  104. package/lib/plugin/plugin-storage.d.ts +4 -0
  105. package/lib/plugin/plugin-storage.d.ts.map +1 -1
  106. package/lib/plugin/plugin-storage.js +6 -1
  107. package/lib/plugin/plugin-storage.js.map +1 -1
  108. package/lib/plugin/quick-open.d.ts +1 -3
  109. package/lib/plugin/quick-open.d.ts.map +1 -1
  110. package/lib/plugin/quick-open.js +12 -27
  111. package/lib/plugin/quick-open.js.map +1 -1
  112. package/lib/plugin/tasks/tasks.d.ts +1 -1
  113. package/lib/plugin/tasks/tasks.d.ts.map +1 -1
  114. package/lib/plugin/tasks/tasks.js +3 -2
  115. package/lib/plugin/tasks/tasks.js.map +1 -1
  116. package/lib/plugin/tree/tree-views.d.ts +3 -0
  117. package/lib/plugin/tree/tree-views.d.ts.map +1 -1
  118. package/lib/plugin/tree/tree-views.js +15 -1
  119. package/lib/plugin/tree/tree-views.js.map +1 -1
  120. package/lib/plugin/type-converters.d.ts.map +1 -1
  121. package/lib/plugin/type-converters.js +9 -5
  122. package/lib/plugin/type-converters.js.map +1 -1
  123. package/lib/plugin/types-impl.d.ts +57 -1
  124. package/lib/plugin/types-impl.d.ts.map +1 -1
  125. package/lib/plugin/types-impl.js +88 -1
  126. package/lib/plugin/types-impl.js.map +1 -1
  127. package/package.json +29 -27
  128. package/src/common/arrays.ts +8 -0
  129. package/src/common/plugin-api-rpc-model.ts +2 -0
  130. package/src/common/plugin-api-rpc.ts +29 -8
  131. package/src/common/plugin-protocol.ts +1 -0
  132. package/src/hosted/browser/hosted-plugin.ts +17 -8
  133. package/src/hosted/browser/worker/debug-stub.ts +1 -0
  134. package/src/hosted/node/scanners/scanner-theia.ts +3 -2
  135. package/src/main/browser/callhierarchy/callhierarchy-type-converters.ts +2 -1
  136. package/src/main/browser/custom-editors/custom-editor-opener.tsx +7 -2
  137. package/src/main/browser/debug/debug-main.ts +1 -1
  138. package/src/main/browser/debug/plugin-debug-adapter-contribution.ts +3 -3
  139. package/src/main/browser/debug/plugin-debug-service.ts +23 -0
  140. package/src/main/browser/debug/plugin-debug-session-factory.ts +2 -2
  141. package/src/main/browser/dialogs/modal-notification.ts +6 -6
  142. package/src/main/browser/plugin-ext-frontend-module.ts +6 -4
  143. package/src/main/browser/plugin-ext-widget.tsx +3 -2
  144. package/src/main/browser/plugin-icon-theme-service.ts +12 -2
  145. package/src/main/browser/plugin-shared-style.ts +1 -1
  146. package/src/main/browser/quick-open-main.ts +54 -109
  147. package/src/main/browser/style/index.css +1 -5
  148. package/src/main/browser/style/plugin-sidebar.css +1 -1
  149. package/src/main/browser/view/plugin-view-registry.ts +67 -24
  150. package/src/main/browser/view/plugin-view-widget.ts +22 -3
  151. package/src/main/browser/view/tree-views-main.ts +7 -0
  152. package/src/main/browser/webview/pre/host.js +19 -10
  153. package/src/main/browser/webview/pre/main.js +1 -2
  154. package/src/main/browser/webview/pre/service-worker.js +1 -1
  155. package/src/main/browser/webview/webview.ts +2 -2
  156. package/src/plugin/languages/call-hierarchy.ts +2 -1
  157. package/src/plugin/languages.ts +2 -1
  158. package/src/plugin/node/debug/debug.ts +40 -19
  159. package/src/plugin/node/debug/plugin-debug-adapter-session.ts +3 -3
  160. package/src/plugin/node/debug/plugin-debug-adapter-starter.ts +24 -14
  161. package/src/plugin/plugin-context.ts +20 -7
  162. package/src/plugin/plugin-manager.ts +26 -4
  163. package/src/plugin/plugin-storage.ts +6 -0
  164. package/src/plugin/quick-open.ts +14 -31
  165. package/src/plugin/tasks/tasks.ts +3 -2
  166. package/src/plugin/tree/tree-views.ts +17 -1
  167. package/src/plugin/type-converters.ts +9 -6
  168. package/src/plugin/types-impl.ts +82 -1
@@ -44,3 +44,11 @@ export interface Splice<T> {
44
44
  readonly deleteCount: number;
45
45
  readonly toInsert: T[];
46
46
  }
47
+
48
+ /**
49
+ * @returns 'true' if the 'arg' is a 'ReadonlyArray'.
50
+ */
51
+ export function isReadonlyArray(arg: unknown): arg is readonly unknown[] {
52
+ // Since Typescript does not properly narrow down typings for 'ReadonlyArray' we need to help it.
53
+ return Array.isArray(arg);
54
+ }
@@ -523,6 +523,7 @@ export interface CallHierarchyDefinition {
523
523
  uri: UriComponents;
524
524
  range: Range;
525
525
  selectionRange: Range;
526
+ tags?: readonly SymbolTag[];
526
527
  }
527
528
 
528
529
  export interface CallHierarchyReference {
@@ -540,6 +541,7 @@ export interface CallHierarchyItem {
540
541
  uri: UriComponents;
541
542
  range: Range;
542
543
  selectionRange: Range;
544
+ tags?: readonly SymbolTag[];
543
545
  }
544
546
 
545
547
  export interface CallHierarchyIncomingCall {
@@ -91,6 +91,7 @@ import type {
91
91
  TimelineProviderDescriptor
92
92
  } from '@theia/timeline/lib/common/timeline-model';
93
93
  import { SerializableEnvironmentVariableCollection } from '@theia/terminal/lib/common/base-terminal-protocol';
94
+ // eslint-disable-next-line @theia/runtime-import-check
94
95
  import { ThemeType } from '@theia/core/lib/browser/theming';
95
96
  import { Disposable } from '@theia/core/lib/common/disposable';
96
97
  import { PickOptions, QuickInputButtonHandle, QuickPickItem } from '@theia/core/lib/browser';
@@ -554,7 +555,7 @@ export interface TransferQuickInputButton extends theia.QuickInputButton {
554
555
  handle?: number;
555
556
  }
556
557
 
557
- export type TransferQuickInput<T extends theia.QuickPickItem> = TransferQuickPick<T> | TransferInputBox;
558
+ export type TransferQuickInput = TransferQuickPick | TransferInputBox;
558
559
 
559
560
  export interface BaseTransferQuickInput {
560
561
  [key: string]: any;
@@ -565,14 +566,14 @@ export interface BaseTransferQuickInput {
565
566
  visible?: boolean;
566
567
  }
567
568
 
568
- export interface TransferQuickPick<T extends theia.QuickPickItem> extends BaseTransferQuickInput {
569
+ export interface TransferQuickPick extends BaseTransferQuickInput {
569
570
  type?: 'quickPick';
570
571
  value?: string;
571
572
  placeholder?: string;
572
573
  buttons?: TransferQuickInputButton[];
573
574
  items?: TransferQuickPickItems[];
574
- activeItems?: ReadonlyArray<T>;
575
- selectedItems?: ReadonlyArray<T>;
575
+ activeItems?: ReadonlyArray<theia.QuickPickItem>;
576
+ selectedItems?: ReadonlyArray<theia.QuickPickItem>;
576
577
  canSelectMany?: boolean;
577
578
  ignoreFocusOut?: boolean;
578
579
  matchOnDescription?: boolean;
@@ -604,12 +605,11 @@ export interface QuickOpenMain {
604
605
  $setItems(instance: number, items: TransferQuickPickItems[]): Promise<any>;
605
606
  $setError(instance: number, error: Error): Promise<void>;
606
607
  $input(options: theia.InputBoxOptions, validateInput: boolean, token: CancellationToken): Promise<string | undefined>;
607
- $createOrUpdate<T extends theia.QuickPickItem>(params: TransferQuickInput<T>): Promise<void>;
608
+ $createOrUpdate<T extends theia.QuickPickItem>(params: TransferQuickInput): Promise<void>;
608
609
  $dispose(id: number): Promise<void>;
609
610
 
610
611
  $hide(): void;
611
612
  $showInputBox(options: TransferInputBox, validateInput: boolean): Promise<string | undefined>;
612
- $showCustomQuickPick<T extends theia.QuickPickItem>(options: TransferQuickPick<T>): void;
613
613
  }
614
614
 
615
615
  export interface WorkspaceMain {
@@ -667,6 +667,7 @@ export interface TreeViewsMain {
667
667
  $reveal(treeViewId: string, elementParentChain: string[], options: TreeViewRevealOptions): Promise<any>;
668
668
  $setMessage(treeViewId: string, message: string): void;
669
669
  $setTitle(treeViewId: string, title: string): void;
670
+ $setDescription(treeViewId: string, description: string): void;
670
671
  }
671
672
 
672
673
  export interface TreeViewsExt {
@@ -1594,13 +1595,33 @@ export interface StorageExt {
1594
1595
  $updatePluginsWorkspaceData(data: KeysToKeysToAnyValue): void;
1595
1596
  }
1596
1597
 
1598
+ /**
1599
+ * A DebugConfigurationProviderTriggerKind specifies when the `provideDebugConfigurations` method of a `DebugConfigurationProvider` should be called.
1600
+ * Currently there are two situations:
1601
+ * (1) providing debug configurations to populate a newly created `launch.json`
1602
+ * (2) providing dynamically generated configurations when the user asks for them through the UI (e.g. via the "Select and Start Debugging" command).
1603
+ * A trigger kind is used when registering a `DebugConfigurationProvider` with {@link debug.registerDebugConfigurationProvider}.
1604
+ */
1605
+ export enum DebugConfigurationProviderTriggerKind {
1606
+ /**
1607
+ * `DebugConfigurationProvider.provideDebugConfigurations` is called to provide the initial debug
1608
+ * configurations for a newly created launch.json.
1609
+ */
1610
+ Initial = 1,
1611
+ /**
1612
+ * `DebugConfigurationProvider.provideDebugConfigurations` is called to provide dynamically generated debug configurations when the user asks for them through the UI
1613
+ * (e.g. via the "Select and Start Debugging" command).
1614
+ */
1615
+ Dynamic = 2
1616
+ }
1617
+
1597
1618
  export interface DebugExt {
1598
1619
  $onSessionCustomEvent(sessionId: string, event: string, body?: any): void;
1599
1620
  $breakpointsDidChange(added: Breakpoint[], removed: string[], changed: Breakpoint[]): void;
1600
1621
  $sessionDidCreate(sessionId: string): void;
1601
1622
  $sessionDidDestroy(sessionId: string): void;
1602
1623
  $sessionDidChange(sessionId: string | undefined): void;
1603
- $provideDebugConfigurations(debugType: string, workspaceFolder: string | undefined): Promise<theia.DebugConfiguration[]>;
1624
+ $provideDebugConfigurations(debugType: string, workspaceFolder: string | undefined, dynamic?: boolean): Promise<theia.DebugConfiguration[]>;
1604
1625
  $resolveDebugConfigurations(debugConfiguration: theia.DebugConfiguration, workspaceFolder: string | undefined): Promise<theia.DebugConfiguration | undefined>;
1605
1626
  $resolveDebugConfigurationWithSubstitutedVariables(debugConfiguration: theia.DebugConfiguration, workspaceFolder: string | undefined):
1606
1627
  Promise<theia.DebugConfiguration | undefined>;
@@ -1772,7 +1793,7 @@ export const MAIN_RPC_CONTEXT = {
1772
1793
  };
1773
1794
 
1774
1795
  export interface TasksExt {
1775
- $provideTasks(handle: number, token?: CancellationToken): Promise<TaskDto[] | undefined>;
1796
+ $provideTasks(handle: number): Promise<TaskDto[] | undefined>;
1776
1797
  $resolveTask(handle: number, task: TaskDto, token?: CancellationToken): Promise<TaskDto | undefined>;
1777
1798
  $onDidStartTask(execution: TaskExecutionDto, terminalId: number): void;
1778
1799
  $onDidEndTask(id: number): void;
@@ -23,6 +23,7 @@ import { IJSONSchema, IJSONSchemaSnippet } from '@theia/core/lib/common/json-sch
23
23
  import { RecursivePartial } from '@theia/core/lib/common/types';
24
24
  import { PreferenceSchema, PreferenceSchemaProperties } from '@theia/core/lib/common/preferences/preference-schema';
25
25
  import { ProblemMatcherContribution, ProblemPatternContribution, TaskDefinition } from '@theia/task/lib/common';
26
+ // eslint-disable-next-line @theia/runtime-import-check
26
27
  import { ColorDefinition } from '@theia/core/lib/browser/color-registry';
27
28
  import { ResourceLabelFormatter } from '@theia/core/lib/common/label-protocol';
28
29
 
@@ -66,7 +66,7 @@ import { PluginCustomEditorRegistry } from '../../main/browser/custom-editors/pl
66
66
  import { CustomEditorWidget } from '../../main/browser/custom-editors/custom-editor-widget';
67
67
 
68
68
  export type PluginHost = 'frontend' | string;
69
- export type DebugActivationEvent = 'onDebugResolve' | 'onDebugInitialConfigurations' | 'onDebugAdapterProtocolTracker';
69
+ export type DebugActivationEvent = 'onDebugResolve' | 'onDebugInitialConfigurations' | 'onDebugAdapterProtocolTracker' | 'onDebugDynamicConfigurations';
70
70
 
71
71
  export const PluginProgressLocation = 'plugin';
72
72
 
@@ -198,6 +198,8 @@ export class HostedPluginSupport {
198
198
  this.debugSessionManager.onWillStartDebugSession(event => this.ensureDebugActivation(event));
199
199
  this.debugSessionManager.onWillResolveDebugConfiguration(event => this.ensureDebugActivation(event, 'onDebugResolve', event.debugType));
200
200
  this.debugConfigurationManager.onWillProvideDebugConfiguration(event => this.ensureDebugActivation(event, 'onDebugInitialConfigurations'));
201
+ // Activate all providers of dynamic configurations, i.e. Let the user pick a configuration from all the available ones.
202
+ this.debugConfigurationManager.onWillProvideDynamicDebugConfiguration(event => this.ensureDebugActivation(event, 'onDebugDynamicConfigurations', '*'));
201
203
  this.viewRegistry.onDidExpandView(id => this.activateByView(id));
202
204
  this.taskProviderRegistry.onWillProvideTaskProvider(event => this.ensureTaskActivation(event));
203
205
  this.taskResolverRegistry.onWillProvideTaskResolver(event => this.ensureTaskActivation(event));
@@ -302,12 +304,15 @@ export class HostedPluginSupport {
302
304
  */
303
305
  protected async syncPlugins(): Promise<void> {
304
306
  let initialized = 0;
305
- const syncPluginsMeasurement = this.createMeasurement('syncPlugins');
307
+ const waitPluginsMeasurement = this.createMeasurement('waitForDeployment');
308
+ let syncPluginsMeasurement: () => number;
306
309
 
307
310
  const toUnload = new Set(this.contributions.keys());
308
311
  try {
309
312
  const pluginIds: string[] = [];
310
313
  const deployedPluginIds = await this.server.getDeployedPluginIds();
314
+ this.logMeasurement('Waiting for backend deployment', waitPluginsMeasurement);
315
+ syncPluginsMeasurement = this.createMeasurement('syncPlugins');
311
316
  for (const pluginId of deployedPluginIds) {
312
317
  toUnload.delete(pluginId);
313
318
  if (!this.contributions.has(pluginId)) {
@@ -336,7 +341,7 @@ export class HostedPluginSupport {
336
341
  }
337
342
  }
338
343
 
339
- this.logMeasurement('Sync', initialized, syncPluginsMeasurement);
344
+ this.logMeasurement(`Sync of ${this.getPluginCount(initialized)}`, syncPluginsMeasurement);
340
345
  }
341
346
 
342
347
  /**
@@ -374,7 +379,7 @@ export class HostedPluginSupport {
374
379
  }
375
380
  }
376
381
 
377
- this.logMeasurement('Load contributions', loaded, loadPluginsMeasurement);
382
+ this.logMeasurement(`Load contributions of ${this.getPluginCount(loaded)}`, loadPluginsMeasurement);
378
383
 
379
384
  return hostContributions;
380
385
  }
@@ -444,7 +449,7 @@ export class HostedPluginSupport {
444
449
  return;
445
450
  }
446
451
 
447
- this.logMeasurement('Start', started, startPluginsMeasurement);
452
+ this.logMeasurement(`Start of ${this.getPluginCount(started)}`, startPluginsMeasurement);
448
453
  }
449
454
 
450
455
  protected async obtainManager(host: string, hostContributions: PluginContributions[], toDisconnect: DisposableCollection): Promise<PluginManagerExt | undefined> {
@@ -712,15 +717,19 @@ export class HostedPluginSupport {
712
717
  };
713
718
  }
714
719
 
715
- protected logMeasurement(prefix: string, count: number, measurement: () => number): void {
720
+ protected logMeasurement(measurementName: string, measurement: () => number): void {
716
721
  const duration = measurement();
717
722
  if (duration === Number.NaN) {
718
723
  // Measurement was prevented by native API, do not log NaN duration
719
724
  return;
720
725
  }
721
726
 
722
- const pluginCount = `${count} plugin${count === 1 ? '' : 's'}`;
723
- console.log(`[${this.clientId}] ${prefix} of ${pluginCount} took: ${duration.toFixed(1)} ms`);
727
+ const timeFromFrontendStart = `Finished ${(performance.now() / 1000).toFixed(3)} s after frontend start`;
728
+ console.log(`[${this.clientId}] ${measurementName} took: ${duration.toFixed(1)} ms [${timeFromFrontendStart}]`);
729
+ }
730
+
731
+ protected getPluginCount(plugins: number): string {
732
+ return `${plugins} plugin${plugins === 1 ? '' : 's'}`;
724
733
  }
725
734
 
726
735
  protected readonly webviewsToRestore = new Set<WebviewWidget>();
@@ -14,6 +14,7 @@
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
16
 
17
+ // eslint-disable-next-line @theia/runtime-import-check
17
18
  import { DebugExtImpl } from '../../../plugin/node/debug/debug';
18
19
  import { RPCProtocol } from '../../../common/rpc-protocol';
19
20
 
@@ -73,6 +73,7 @@ import {
73
73
  ProblemPatternContribution,
74
74
  TaskDefinition
75
75
  } from '@theia/task/lib/common/task-protocol';
76
+ // eslint-disable-next-line @theia/runtime-import-check
76
77
  import { ColorDefinition } from '@theia/core/lib/browser/color-registry';
77
78
  import { ResourceLabelFormatter } from '@theia/core/lib/common/label-protocol';
78
79
  import { PluginUriFactory } from './plugin-uri-factory';
@@ -217,7 +218,7 @@ export class TheiaPluginScanner implements PluginScanner {
217
218
 
218
219
  for (const location of Object.keys(viewsContainers)) {
219
220
  const containers = this.readViewsContainers(viewsContainers[location], rawPlugin);
220
- const loc = location === 'activitybar' ? 'left' : location;
221
+ const loc = location === 'activitybar' ? 'left' : location === 'panel' ? 'bottom' : location;
221
222
  if (contributions.viewsContainers[loc]) {
222
223
  contributions.viewsContainers[loc] = contributions.viewsContainers[loc].concat(containers);
223
224
  } else {
@@ -698,7 +699,7 @@ export class TheiaPluginScanner implements PluginScanner {
698
699
  taskType: definitionContribution.type,
699
700
  source: pluginName,
700
701
  properties: {
701
- required: definitionContribution.required,
702
+ required: definitionContribution.required || [],
702
703
  all: propertyKeys,
703
704
  schema: definitionContribution
704
705
  }
@@ -151,7 +151,8 @@ export function toDefinition(definition: model.CallHierarchyDefinition | undefin
151
151
  selectionRange: toRange(definition.selectionRange),
152
152
  symbolName: definition.name,
153
153
  symbolKind: SymbolKindConverter.toSymbolKind(definition.kind),
154
- containerName: undefined
154
+ containerName: undefined,
155
+ tags: definition.tags
155
156
  };
156
157
  }
157
158
 
@@ -37,10 +37,14 @@ export class CustomEditorOpener implements OpenHandler {
37
37
  @inject(ApplicationShell) protected readonly shell: ApplicationShell,
38
38
  @inject(WidgetManager) protected readonly widgetManager: WidgetManager
39
39
  ) {
40
- this.id = `custom-editor-${this.editor.viewType}`;
40
+ this.id = CustomEditorOpener.toCustomEditorId(this.editor.viewType);
41
41
  this.label = this.editor.displayName;
42
42
  }
43
43
 
44
+ static toCustomEditorId(editorViewType: string): string {
45
+ return `custom-editor-${editorViewType}`;
46
+ }
47
+
44
48
  canHandle(uri: URI): number {
45
49
  if (this.matches(this.editor.selector, uri)) {
46
50
  return this.getPriority();
@@ -52,7 +56,8 @@ export class CustomEditorOpener implements OpenHandler {
52
56
  switch (this.editor.priority) {
53
57
  case CustomEditorPriority.default: return 500;
54
58
  case CustomEditorPriority.builtin: return 400;
55
- case CustomEditorPriority.option: return 300;
59
+ /** `option` should not open the custom-editor by default. */
60
+ case CustomEditorPriority.option: return 1;
56
61
  default: return 200;
57
62
  }
58
63
  }
@@ -38,7 +38,7 @@ import { DebugProtocol } from 'vscode-debugprotocol';
38
38
  import { DebugConfigurationManager } from '@theia/debug/lib/browser/debug-configuration-manager';
39
39
  import { TerminalService } from '@theia/terminal/lib/browser/base/terminal-service';
40
40
  import { MessageClient } from '@theia/core/lib/common/message-service-protocol';
41
- import { OutputChannelManager } from '@theia/output/lib/common/output-channel';
41
+ import { OutputChannelManager } from '@theia/output/lib/browser/output-channel';
42
42
  import { DebugPreferences } from '@theia/debug/lib/browser/debug-preferences';
43
43
  import { PluginDebugAdapterContribution } from './plugin-debug-adapter-contribution';
44
44
  import { PluginDebugSessionContributionRegistrator, PluginDebugSessionContributionRegistry } from './plugin-debug-session-contribution-registry';
@@ -14,7 +14,7 @@
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
16
 
17
- import { DebugExt, } from '../../../common/plugin-api-rpc';
17
+ import { DebugExt } from '../../../common/plugin-api-rpc';
18
18
  import { DebugConfiguration } from '@theia/debug/lib/common/debug-configuration';
19
19
  import { MaybePromise } from '@theia/core/lib/common/types';
20
20
  import { DebuggerDescription } from '@theia/debug/lib/common/debug-service';
@@ -37,8 +37,8 @@ export class PluginDebugAdapterContribution {
37
37
  return this.description.label;
38
38
  }
39
39
 
40
- async provideDebugConfigurations(workspaceFolderUri: string | undefined): Promise<DebugConfiguration[]> {
41
- return this.debugExt.$provideDebugConfigurations(this.type, workspaceFolderUri);
40
+ async provideDebugConfigurations(workspaceFolderUri: string | undefined, dynamic: boolean = false): Promise<DebugConfiguration[]> {
41
+ return this.debugExt.$provideDebugConfigurations(this.type, workspaceFolderUri, dynamic);
42
42
  }
43
43
 
44
44
  async resolveDebugConfiguration(config: DebugConfiguration, workspaceFolderUri: string | undefined): Promise<DebugConfiguration | undefined> {
@@ -25,6 +25,7 @@ import { WorkspaceService } from '@theia/workspace/lib/browser';
25
25
  import { DebuggerContribution } from '../../../common/plugin-protocol';
26
26
  import { DebugRequestTypes } from '@theia/debug/lib/browser/debug-session-connection';
27
27
  import * as theia from '@theia/plugin';
28
+
28
29
  /**
29
30
  * Debug adapter contribution registrator.
30
31
  */
@@ -111,6 +112,28 @@ export class PluginDebugService implements DebugService, PluginDebugAdapterContr
111
112
  }
112
113
  }
113
114
 
115
+ async provideDynamicDebugConfigurations(): Promise<{ type: string, configurations: DebugConfiguration[] }[]> {
116
+ const result: Promise<{ type: string, configurations: theia.DebugConfiguration[] }>[] = [];
117
+
118
+ for (const [type, contributor] of this.contributors.entries()) {
119
+ const typeConfigurations = this.resolveDynamicConfigurationsForType(type, contributor);
120
+ result.push(typeConfigurations);
121
+ }
122
+
123
+ return Promise.all(result);
124
+ }
125
+
126
+ protected async resolveDynamicConfigurationsForType(
127
+ type: string,
128
+ contributor: PluginDebugAdapterContribution): Promise<{ type: string, configurations: DebugConfiguration[] }> {
129
+
130
+ const configurations = await contributor.provideDebugConfigurations(undefined, true);
131
+ for (const configuration of configurations) {
132
+ configuration.dynamic = true;
133
+ }
134
+ return { type, configurations };
135
+ }
136
+
114
137
  async resolveDebugConfiguration(config: DebugConfiguration, workspaceFolderUri: string | undefined): Promise<DebugConfiguration> {
115
138
  let resolved = config;
116
139
 
@@ -20,7 +20,7 @@ import { EditorManager } from '@theia/editor/lib/browser/editor-manager';
20
20
  import { BreakpointManager } from '@theia/debug/lib/browser/breakpoint/breakpoint-manager';
21
21
  import { LabelProvider } from '@theia/core/lib/browser/label-provider';
22
22
  import { MessageClient } from '@theia/core/lib/common/message-service-protocol';
23
- import { OutputChannelManager } from '@theia/output/lib/common/output-channel';
23
+ import { OutputChannelManager } from '@theia/output/lib/browser/output-channel';
24
24
  import { DebugPreferences } from '@theia/debug/lib/browser/debug-preferences';
25
25
  import { DebugSessionOptions } from '@theia/debug/lib/browser/debug-session-options';
26
26
  import { DebugSession } from '@theia/debug/lib/browser/debug-session';
@@ -30,7 +30,7 @@ import { TerminalWidgetOptions, TerminalWidget } from '@theia/terminal/lib/brows
30
30
  import { TerminalOptionsExt } from '../../../common/plugin-api-rpc';
31
31
  import { FileService } from '@theia/filesystem/lib/browser/file-service';
32
32
  import { DebugContribution } from '@theia/debug/lib/browser/debug-contribution';
33
- import { ContributionProvider } from '@theia/core';
33
+ import { ContributionProvider } from '@theia/core/lib/common/contribution-provider';
34
34
 
35
35
  export class PluginDebugSession extends DebugSession {
36
36
  constructor(
@@ -15,7 +15,7 @@
15
15
  ********************************************************************************/
16
16
  import { injectable } from '@theia/core/shared/inversify';
17
17
  import { Message } from '@theia/core/shared/@phosphor/messaging';
18
- import { Key } from '@theia/core/lib/browser';
18
+ import { codiconArray, Key } from '@theia/core/lib/browser';
19
19
  import { AbstractDialog } from '@theia/core/lib/browser/dialogs';
20
20
  import '../../../../src/main/browser/dialogs/style/modal-notification.css';
21
21
  import { MainMessageItem } from '../../../common/plugin-api-rpc';
@@ -60,7 +60,7 @@ export class ModalNotification extends AbstractDialog<string | undefined> {
60
60
  const iconContainer = messageNode.appendChild(document.createElement('div'));
61
61
  iconContainer.classList.add(ICON);
62
62
  const iconElement = iconContainer.appendChild(document.createElement('i'));
63
- iconElement.classList.add('fa', this.toIconClass(messageType), 'fa-fw', messageType.toString());
63
+ iconElement.classList.add(...this.toIconClass(messageType), messageType.toString());
64
64
 
65
65
  const textContainer = messageNode.appendChild(document.createElement('div'));
66
66
  textContainer.classList.add(TEXT);
@@ -86,13 +86,13 @@ export class ModalNotification extends AbstractDialog<string | undefined> {
86
86
  return messageNode;
87
87
  }
88
88
 
89
- protected toIconClass(icon: MessageType): string {
89
+ protected toIconClass(icon: MessageType): string[] {
90
90
  if (icon === MessageType.Error) {
91
- return 'fa-times-circle';
91
+ return codiconArray('error');
92
92
  }
93
93
  if (icon === MessageType.Warning) {
94
- return 'fa-warning';
94
+ return codiconArray('warning');
95
95
  }
96
- return 'fa-info-circle';
96
+ return codiconArray('info');
97
97
  }
98
98
  }
@@ -21,7 +21,7 @@ import '../../../src/main/browser/style/comments.css';
21
21
  import { ContainerModule } from '@theia/core/shared/inversify';
22
22
  import {
23
23
  FrontendApplicationContribution, WidgetFactory, bindViewContribution,
24
- ViewContainerIdentifier, ViewContainer, createTreeContainer, TreeImpl, TreeWidget, TreeModelImpl, LabelProviderContribution, TreeProps
24
+ ViewContainerIdentifier, ViewContainer, createTreeContainer, TreeImpl, TreeWidget, TreeModelImpl, LabelProviderContribution
25
25
  } from '@theia/core/lib/browser';
26
26
  import { MaybePromise, CommandContribution, ResourceResolver, bindContributionProvider } from '@theia/core/lib/common';
27
27
  import { WebSocketConnectionProvider } from '@theia/core/lib/browser/messaging';
@@ -147,10 +147,12 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
147
147
  createWidget: (identifier: TreeViewWidgetIdentifier) => {
148
148
  const child = createTreeContainer(container, {
149
149
  contextMenuPath: VIEW_ITEM_CONTEXT_MENU,
150
- search: true,
151
- globalSelection: true
150
+ expandOnlyOnExpansionToggleClick: true,
151
+ expansionTogglePadding: 22,
152
+ globalSelection: true,
153
+ leftPadding: 8,
154
+ search: true
152
155
  });
153
- child.rebind(TreeProps).toConstantValue({ leftPadding: 8, expansionTogglePadding: 22, expandOnlyOnExpansionToggleClick: true, });
154
156
  child.bind(TreeViewWidgetIdentifier).toConstantValue(identifier);
155
157
  child.bind(PluginTree).toSelf();
156
158
  child.rebind(TreeImpl).toService(PluginTree);
@@ -23,6 +23,7 @@ import { AlertMessage } from '@theia/core/lib/browser/widgets/alert-message';
23
23
  import { HostedPluginSupport, PluginProgressLocation } from '../../hosted/browser/hosted-plugin';
24
24
  import { ProgressBarFactory } from '@theia/core/lib/browser/progress-bar-factory';
25
25
  import { DisposableCollection } from '@theia/core/lib/common/disposable';
26
+ import { codicon } from '@theia/core/lib/browser';
26
27
 
27
28
  @injectable()
28
29
  export class PluginWidget extends ReactWidget {
@@ -38,7 +39,7 @@ export class PluginWidget extends ReactWidget {
38
39
  this.id = 'plugins';
39
40
  this.title.label = 'Plugins';
40
41
  this.title.caption = 'Plugins';
41
- this.title.iconClass = 'fa plugins-tab-icon';
42
+ this.title.iconClass = codicon('diff-added');
42
43
  this.title.closable = true;
43
44
  this.node.tabIndex = 0;
44
45
  this.addClass('theia-plugins');
@@ -86,7 +87,7 @@ export class PluginWidget extends ReactWidget {
86
87
  return <div key={plugin.model.name} className={this.createPluginClassName(plugin)}>
87
88
  <div className='column flexcontainer pluginInformationContainer'>
88
89
  <div className='row flexcontainer'>
89
- <div className='fa fa-puzzle-piece fa-2x fa-fw'></div>
90
+ <div className={codicon('list-selection')}></div>
90
91
  <div title={plugin.model.name} className='pluginName noWrapInfo'>{plugin.model.name}</div>
91
92
  </div>
92
93
  <div className='row flexcontainer'>
@@ -36,6 +36,7 @@ import { WorkspaceRootNode } from '@theia/navigator/lib/browser/navigator-tree';
36
36
  import { Endpoint } from '@theia/core/lib/browser/endpoint';
37
37
  import { FileService } from '@theia/filesystem/lib/browser/file-service';
38
38
  import { FileStat, FileChangeType } from '@theia/filesystem/lib/common/files';
39
+ import { WorkspaceService } from '@theia/workspace/lib/browser';
39
40
 
40
41
  export interface PluginIconDefinition {
41
42
  iconPath: string;
@@ -107,6 +108,9 @@ export class PluginIconTheme extends PluginIconThemeDefinition implements IconTh
107
108
  @inject(PluginIconThemeDefinition)
108
109
  protected readonly definition: PluginIconThemeDefinition;
109
110
 
111
+ @inject(WorkspaceService)
112
+ protected readonly workspaceService: WorkspaceService;
113
+
110
114
  protected readonly onDidChangeEmitter = new Emitter<DidChangeLabelEvent>();
111
115
  readonly onDidChange = this.onDidChangeEmitter.event;
112
116
 
@@ -508,9 +512,15 @@ export class PluginIconTheme extends PluginIconThemeDefinition implements IconTh
508
512
  const name = this.labelProvider.getName(element);
509
513
  const classNames = this.fileNameIcon(name);
510
514
  if (uri) {
511
- const language = monaco.services.StaticServices.modeService.get().createByFilepathOrFirstLine(monaco.Uri.parse(uri));
515
+ const parsedURI = new URI(uri);
516
+ const isRoot = this.workspaceService.getWorkspaceRootUri(new URI(uri))?.isEqual(parsedURI);
517
+ if (isRoot) {
518
+ classNames.unshift(this.rootFolderIcon);
519
+ } else {
520
+ classNames.unshift(this.fileIcon);
521
+ }
522
+ const language = monaco.services.StaticServices.modeService.get().createByFilepathOrFirstLine(parsedURI['codeUri']);
512
523
  classNames.push(this.languageIcon(language.languageIdentifier.language));
513
- classNames.unshift(this.fileIcon);
514
524
  }
515
525
  return classNames;
516
526
  }
@@ -111,7 +111,7 @@ export class PluginSharedStyle {
111
111
  background-position: 2px;
112
112
  width: ${size}px;
113
113
  height: ${size}px;
114
- background: no-repeat url("${theme.type === 'light' ? lightIconUrl : darkIconUrl}");
114
+ background: center no-repeat url("${theme.type === 'light' ? lightIconUrl : darkIconUrl}");
115
115
  background-size: ${size}px;
116
116
  `));
117
117
  return {