@theia/plugin-ext 1.24.0-next.5 → 1.24.0-next.52

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 (151) hide show
  1. package/lib/common/plugin-api-rpc-model.d.ts +1 -2
  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 +10 -5
  5. package/lib/common/plugin-api-rpc.d.ts.map +1 -1
  6. package/lib/common/plugin-api-rpc.js.map +1 -1
  7. package/lib/hosted/browser/hosted-plugin.d.ts.map +1 -1
  8. package/lib/hosted/browser/hosted-plugin.js +7 -6
  9. package/lib/hosted/browser/hosted-plugin.js.map +1 -1
  10. package/lib/hosted/node/hosted-plugin-deployer-handler.d.ts.map +1 -1
  11. package/lib/hosted/node/hosted-plugin-deployer-handler.js +2 -10
  12. package/lib/hosted/node/hosted-plugin-deployer-handler.js.map +1 -1
  13. package/lib/main/browser/comments/comment-glyph-widget.d.ts +1 -2
  14. package/lib/main/browser/comments/comment-glyph-widget.d.ts.map +1 -1
  15. package/lib/main/browser/comments/comment-glyph-widget.js.map +1 -1
  16. package/lib/main/browser/comments/comment-thread-widget.d.ts +1 -2
  17. package/lib/main/browser/comments/comment-thread-widget.d.ts.map +1 -1
  18. package/lib/main/browser/comments/comment-thread-widget.js +1 -0
  19. package/lib/main/browser/comments/comment-thread-widget.js.map +1 -1
  20. package/lib/main/browser/comments/comments-contribution.d.ts +1 -2
  21. package/lib/main/browser/comments/comments-contribution.d.ts.map +1 -1
  22. package/lib/main/browser/comments/comments-contribution.js +1 -0
  23. package/lib/main/browser/comments/comments-contribution.js.map +1 -1
  24. package/lib/main/browser/comments/comments-decorator.d.ts +1 -2
  25. package/lib/main/browser/comments/comments-decorator.d.ts.map +1 -1
  26. package/lib/main/browser/comments/comments-decorator.js.map +1 -1
  27. package/lib/main/browser/custom-editors/custom-editors-main.d.ts +2 -2
  28. package/lib/main/browser/custom-editors/custom-editors-main.d.ts.map +1 -1
  29. package/lib/main/browser/custom-editors/custom-editors-main.js +7 -7
  30. package/lib/main/browser/custom-editors/custom-editors-main.js.map +1 -1
  31. package/lib/main/browser/documents-main.d.ts +1 -3
  32. package/lib/main/browser/documents-main.d.ts.map +1 -1
  33. package/lib/main/browser/documents-main.js +3 -3
  34. package/lib/main/browser/documents-main.js.map +1 -1
  35. package/lib/main/browser/editor/untitled-resource.d.ts +3 -10
  36. package/lib/main/browser/editor/untitled-resource.d.ts.map +1 -1
  37. package/lib/main/browser/editor/untitled-resource.js +9 -44
  38. package/lib/main/browser/editor/untitled-resource.js.map +1 -1
  39. package/lib/main/browser/editors-and-documents-main.d.ts +1 -1
  40. package/lib/main/browser/editors-and-documents-main.d.ts.map +1 -1
  41. package/lib/main/browser/editors-and-documents-main.js.map +1 -1
  42. package/lib/main/browser/languages-main.d.ts +5 -5
  43. package/lib/main/browser/languages-main.d.ts.map +1 -1
  44. package/lib/main/browser/languages-main.js +18 -14
  45. package/lib/main/browser/languages-main.js.map +1 -1
  46. package/lib/main/browser/main-context.d.ts.map +1 -1
  47. package/lib/main/browser/main-context.js +1 -3
  48. package/lib/main/browser/main-context.js.map +1 -1
  49. package/lib/main/browser/menus/menus-contribution-handler.d.ts.map +1 -1
  50. package/lib/main/browser/menus/menus-contribution-handler.js +14 -17
  51. package/lib/main/browser/menus/menus-contribution-handler.js.map +1 -1
  52. package/lib/main/browser/plugin-contribution-handler.d.ts.map +1 -1
  53. package/lib/main/browser/plugin-contribution-handler.js +4 -2
  54. package/lib/main/browser/plugin-contribution-handler.js.map +1 -1
  55. package/lib/main/browser/plugin-icon-theme-service.d.ts.map +1 -1
  56. package/lib/main/browser/plugin-icon-theme-service.js +4 -2
  57. package/lib/main/browser/plugin-icon-theme-service.js.map +1 -1
  58. package/lib/main/browser/quick-open-main.d.ts +5 -6
  59. package/lib/main/browser/quick-open-main.d.ts.map +1 -1
  60. package/lib/main/browser/quick-open-main.js +15 -17
  61. package/lib/main/browser/quick-open-main.js.map +1 -1
  62. package/lib/main/browser/text-editor-main.d.ts +1 -1
  63. package/lib/main/browser/text-editor-main.d.ts.map +1 -1
  64. package/lib/main/browser/text-editor-main.js +11 -9
  65. package/lib/main/browser/text-editor-main.js.map +1 -1
  66. package/lib/main/browser/text-editors-main.d.ts +2 -1
  67. package/lib/main/browser/text-editors-main.d.ts.map +1 -1
  68. package/lib/main/browser/text-editors-main.js +4 -2
  69. package/lib/main/browser/text-editors-main.js.map +1 -1
  70. package/lib/main/browser/view/plugin-tree-view-node-label-provider.d.ts.map +1 -1
  71. package/lib/main/browser/view/plugin-tree-view-node-label-provider.js +2 -1
  72. package/lib/main/browser/view/plugin-tree-view-node-label-provider.js.map +1 -1
  73. package/lib/main/browser/view/plugin-view-registry.js +3 -2
  74. package/lib/main/browser/view/plugin-view-registry.js.map +1 -1
  75. package/lib/main/browser/view/tree-view-widget.d.ts +5 -0
  76. package/lib/main/browser/view/tree-view-widget.d.ts.map +1 -1
  77. package/lib/main/browser/view/tree-view-widget.js +19 -1
  78. package/lib/main/browser/view/tree-view-widget.js.map +1 -1
  79. package/lib/main/browser/webview/webview-environment.d.ts +1 -1
  80. package/lib/main/browser/webview/webview-environment.d.ts.map +1 -1
  81. package/lib/main/browser/webview/webview-environment.js +7 -2
  82. package/lib/main/browser/webview/webview-environment.js.map +1 -1
  83. package/lib/main/browser/webview/webview.d.ts.map +1 -1
  84. package/lib/main/browser/webview/webview.js +4 -0
  85. package/lib/main/browser/webview/webview.js.map +1 -1
  86. package/lib/plugin/languages/selection-range.d.ts +2 -2
  87. package/lib/plugin/languages/selection-range.d.ts.map +1 -1
  88. package/lib/plugin/languages/selection-range.js.map +1 -1
  89. package/lib/plugin/languages.d.ts +1 -1
  90. package/lib/plugin/languages.d.ts.map +1 -1
  91. package/lib/plugin/languages.js +6 -2
  92. package/lib/plugin/languages.js.map +1 -1
  93. package/lib/plugin/node/debug/debug.d.ts +2 -2
  94. package/lib/plugin/node/debug/debug.d.ts.map +1 -1
  95. package/lib/plugin/node/debug/debug.js.map +1 -1
  96. package/lib/plugin/output-channel/output-channel-item.d.ts +1 -0
  97. package/lib/plugin/output-channel/output-channel-item.d.ts.map +1 -1
  98. package/lib/plugin/output-channel/output-channel-item.js +5 -0
  99. package/lib/plugin/output-channel/output-channel-item.js.map +1 -1
  100. package/lib/plugin/plugin-context.d.ts.map +1 -1
  101. package/lib/plugin/plugin-context.js +2 -2
  102. package/lib/plugin/plugin-context.js.map +1 -1
  103. package/lib/plugin/quick-open.d.ts +6 -8
  104. package/lib/plugin/quick-open.d.ts.map +1 -1
  105. package/lib/plugin/quick-open.js +16 -11
  106. package/lib/plugin/quick-open.js.map +1 -1
  107. package/lib/plugin/type-converters.d.ts.map +1 -1
  108. package/lib/plugin/type-converters.js +18 -21
  109. package/lib/plugin/type-converters.js.map +1 -1
  110. package/lib/plugin/types-impl.d.ts +0 -1
  111. package/lib/plugin/types-impl.d.ts.map +1 -1
  112. package/lib/plugin/types-impl.js.map +1 -1
  113. package/lib/plugin/webviews.js +3 -3
  114. package/lib/plugin/webviews.js.map +1 -1
  115. package/package.json +24 -23
  116. package/src/common/plugin-api-rpc-model.ts +1 -0
  117. package/src/common/plugin-api-rpc.ts +12 -5
  118. package/src/hosted/browser/hosted-plugin.ts +8 -6
  119. package/src/hosted/node/hosted-plugin-deployer-handler.ts +2 -10
  120. package/src/main/browser/comments/comment-glyph-widget.ts +1 -0
  121. package/src/main/browser/comments/comment-thread-widget.tsx +1 -0
  122. package/src/main/browser/comments/comments-contribution.ts +1 -0
  123. package/src/main/browser/comments/comments-decorator.ts +1 -0
  124. package/src/main/browser/custom-editors/custom-editors-main.ts +9 -9
  125. package/src/main/browser/documents-main.ts +2 -3
  126. package/src/main/browser/editor/untitled-resource.ts +11 -45
  127. package/src/main/browser/editors-and-documents-main.ts +1 -0
  128. package/src/main/browser/languages-main.ts +63 -43
  129. package/src/main/browser/main-context.ts +1 -3
  130. package/src/main/browser/menus/menus-contribution-handler.ts +18 -19
  131. package/src/main/browser/plugin-contribution-handler.ts +4 -2
  132. package/src/main/browser/plugin-icon-theme-service.ts +4 -2
  133. package/src/main/browser/quick-open-main.ts +23 -24
  134. package/src/main/browser/style/tree.css +4 -0
  135. package/src/main/browser/text-editor-main.ts +12 -14
  136. package/src/main/browser/text-editors-main.ts +6 -3
  137. package/src/main/browser/view/plugin-tree-view-node-label-provider.ts +2 -1
  138. package/src/main/browser/view/plugin-view-registry.ts +3 -3
  139. package/src/main/browser/view/tree-view-widget.tsx +21 -3
  140. package/src/main/browser/webview/webview-environment.ts +8 -2
  141. package/src/main/browser/webview/webview.ts +4 -0
  142. package/src/plugin/languages/selection-range.ts +2 -1
  143. package/src/plugin/languages.ts +8 -2
  144. package/src/plugin/node/debug/debug.ts +2 -2
  145. package/src/plugin/output-channel/output-channel-item.ts +6 -0
  146. package/src/plugin/plugin-context.ts +5 -4
  147. package/src/plugin/quick-open.ts +21 -16
  148. package/src/plugin/type-converters.ts +19 -25
  149. package/src/plugin/types-impl.ts +1 -3
  150. package/src/plugin/webviews.ts +3 -3
  151. package/src/typings/monaco/index.d.ts +0 -20
@@ -25,7 +25,8 @@ import {
25
25
  TransferInputBox,
26
26
  TransferQuickPickItems,
27
27
  TransferQuickInput,
28
- TransferQuickInputButton
28
+ TransferQuickInputButton,
29
+ TransferQuickPickItemValue
29
30
  } from '../../common/plugin-api-rpc';
30
31
  import {
31
32
  InputOptions,
@@ -37,12 +38,14 @@ import {
37
38
  import { DisposableCollection, Disposable } from '@theia/core/lib/common/disposable';
38
39
  import { CancellationToken } from '@theia/core/lib/common/cancellation';
39
40
  import { MonacoQuickInputService } from '@theia/monaco/lib/browser/monaco-quick-input-service';
40
- import * as theia from '@theia/plugin';
41
41
  import { QuickInputButtons } from '../../plugin/types-impl';
42
42
  import { getIconUris } from '../../plugin/quick-open';
43
+ import * as monaco from '@theia/monaco-editor-core';
44
+ import { IQuickPickItem, IQuickInput } from '@theia/monaco-editor-core/esm/vs/base/parts/quickinput/common/quickInput';
45
+ import { ThemeIcon } from '@theia/monaco-editor-core/esm/vs/platform/theme/common/themeService';
43
46
 
44
47
  export interface QuickInputSession {
45
- input: monaco.quickInput.IQuickInput;
48
+ input: IQuickInput;
46
49
  handlesToItems: Map<number, TransferQuickPickItems>;
47
50
  }
48
51
 
@@ -68,7 +71,7 @@ export class QuickOpenMainImpl implements QuickOpenMain, Disposable {
68
71
  this.toDispose.dispose();
69
72
  }
70
73
 
71
- async $show(instance: number, options: PickOptions<TransferQuickPickItems>, token: CancellationToken): Promise<number | number[] | undefined> {
74
+ async $show(instance: number, options: PickOptions<TransferQuickPickItemValue>, token: CancellationToken): Promise<number | number[] | undefined> {
72
75
  const contents = new Promise<TransferQuickPickItems[]>((resolve, reject) => {
73
76
  this.items[instance] = { resolve, reject };
74
77
  });
@@ -82,21 +85,14 @@ export class QuickOpenMainImpl implements QuickOpenMain, Disposable {
82
85
  }
83
86
  };
84
87
 
85
- if (options.canPickMany) {
86
- return this.delegate.pick(contents, options as { canPickMany: true }, token).then(items => {
87
- if (items) {
88
- return items.map(item => item.handle);
89
- }
90
- return undefined;
91
- });
92
- } else {
93
- return this.delegate.pick(contents, options, token).then(item => {
94
- if (item) {
95
- return item.handle;
96
- }
97
- return undefined;
98
- });
88
+ const result = await this.delegate.pick<TransferQuickPickItemValue>(contents, options, token);
89
+
90
+ if (Array.isArray(result)) {
91
+ return result.map(({ handle }) => handle);
92
+ } else if (result) {
93
+ return result.handle;
99
94
  }
95
+ return undefined;
100
96
  }
101
97
 
102
98
  $setItems(instance: number, items: TransferQuickPickItems[]): Promise<any> {
@@ -194,19 +190,20 @@ export class QuickOpenMainImpl implements QuickOpenMain, Disposable {
194
190
 
195
191
  private sessions = new Map<number, QuickInputSession>();
196
192
 
197
- $createOrUpdate<T extends theia.QuickPickItem>(params: TransferQuickInput): Promise<void> {
193
+ $createOrUpdate(params: TransferQuickInput): Promise<void> {
198
194
  const sessionId = params.id;
199
- let session = this.sessions.get(sessionId);
200
- if (!session) {
195
+ let session: QuickInputSession;
196
+ const candidate = this.sessions.get(sessionId);
197
+ if (!candidate) {
201
198
  if (params.type === 'quickPick') {
202
199
  const quickPick = this.quickInputService.createQuickPick();
203
200
  quickPick.onDidAccept(() => {
204
201
  this.proxy.$acceptOnDidAccept(sessionId);
205
202
  });
206
- quickPick.onDidChangeActive((items: Array<monaco.quickInput.IQuickPickItem>) => {
203
+ quickPick.onDidChangeActive((items: Array<IQuickPickItem>) => {
207
204
  this.proxy.$onDidChangeActive(sessionId, items.map(item => (item as TransferQuickPickItems).handle));
208
205
  });
209
- quickPick.onDidChangeSelection((items: Array<monaco.quickInput.IQuickPickItem>) => {
206
+ quickPick.onDidChangeSelection((items: Array<IQuickPickItem>) => {
210
207
  this.proxy.$onDidChangeSelection(sessionId, items.map(item => (item as TransferQuickPickItems).handle));
211
208
  });
212
209
  quickPick.onDidTriggerButton((button: QuickInputButtonHandle) => {
@@ -242,6 +239,8 @@ export class QuickOpenMainImpl implements QuickOpenMain, Disposable {
242
239
  };
243
240
  }
244
241
  this.sessions.set(sessionId, session);
242
+ } else {
243
+ session = candidate;
245
244
  }
246
245
  if (session) {
247
246
  const { input, handlesToItems } = session;
@@ -273,7 +272,7 @@ export class QuickOpenMainImpl implements QuickOpenMain, Disposable {
273
272
  const { iconPath, tooltip, handle } = button;
274
273
  if ('id' in iconPath) {
275
274
  return {
276
- iconClass: monaco.theme.ThemeIcon.asClassName(iconPath),
275
+ iconClass: ThemeIcon.asClassName(iconPath),
277
276
  tooltip,
278
277
  handle
279
278
  };
@@ -44,3 +44,7 @@
44
44
  .theia-tree-view .theia-TreeNode:not(:hover):not(.theia-mod-selected) .theia-tree-view-inline-action {
45
45
  display: none;
46
46
  }
47
+
48
+ .codicon.icon-inline {
49
+ font-size: var(--theia-ui-font-size1);
50
+ }
@@ -14,6 +14,8 @@
14
14
  // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  // *****************************************************************************
16
16
 
17
+ import * as monaco from '@theia/monaco-editor-core';
18
+ import { StandaloneCodeEditor } from '@theia/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneCodeEditor';
17
19
  import { Disposable, DisposableCollection } from '@theia/core/lib/common/disposable';
18
20
  import { MonacoEditor } from '@theia/monaco/lib/browser/monaco-editor';
19
21
  import {
@@ -84,23 +86,23 @@ export class TextEditorMain implements Disposable {
84
86
  this.toDisposeOnEditor.push(Disposable.create(() => this.editor = undefined));
85
87
 
86
88
  if (this.editor) {
87
- const monaco = this.editor.getControl();
89
+ const monacoEditor = this.editor.getControl();
88
90
  this.toDisposeOnEditor.push(this.editor.onSelectionChanged(_ => {
89
91
  this.updateProperties();
90
92
  }));
91
- this.toDisposeOnEditor.push(monaco.onDidChangeModel(() => {
93
+ this.toDisposeOnEditor.push(monacoEditor.onDidChangeModel(() => {
92
94
  this.setEditor(undefined);
93
95
  }));
94
- this.toDisposeOnEditor.push(monaco.onDidChangeCursorSelection(e => {
96
+ this.toDisposeOnEditor.push(monacoEditor.onDidChangeCursorSelection(e => {
95
97
  this.updateProperties(e.source);
96
98
  }));
97
- this.toDisposeOnEditor.push(monaco.onDidChangeConfiguration(() => {
99
+ this.toDisposeOnEditor.push(monacoEditor.onDidChangeConfiguration(() => {
98
100
  this.updateProperties();
99
101
  }));
100
- this.toDisposeOnEditor.push(monaco.onDidLayoutChange(() => {
102
+ this.toDisposeOnEditor.push(monacoEditor.onDidLayoutChange(() => {
101
103
  this.updateProperties();
102
104
  }));
103
- this.toDisposeOnEditor.push(monaco.onDidScrollChange(() => {
105
+ this.toDisposeOnEditor.push(monacoEditor.onDidScrollChange(() => {
104
106
  this.updateProperties();
105
107
  }));
106
108
 
@@ -263,12 +265,9 @@ export class TextEditorMain implements Disposable {
263
265
  }
264
266
 
265
267
  insertSnippet(template: string, ranges: Range[], opts: UndoStopOptions): boolean {
268
+ const snippetController: SnippetController2 | null | undefined = this.editor?.getControl().getContribution('snippetController2');
266
269
 
267
- if (!this.editor) {
268
- return false;
269
- }
270
-
271
- const snippetController: SnippetController2 = this.editor!.getControl().getContribution('snippetController2');
270
+ if (!snippetController || !this.editor) { return false; }
272
271
 
273
272
  const selections = ranges.map(r => new monaco.Selection(r.startLineNumber, r.startColumn, r.endLineNumber, r.endColumn));
274
273
  this.editor.getControl().setSelections(selections);
@@ -283,7 +282,7 @@ export class TextEditorMain implements Disposable {
283
282
  if (!this.editor) {
284
283
  return;
285
284
  }
286
- this.editor.getControl().setDecorations(key, ranges.map(option => Object.assign(option, { color: undefined })));
285
+ (this.editor.getControl() as unknown as StandaloneCodeEditor).setDecorations('Plugin decorations', key, ranges.map(option => Object.assign(option, { color: undefined })));
287
286
  }
288
287
 
289
288
  setDecorationsFast(key: string, _ranges: number[]): void {
@@ -295,8 +294,7 @@ export class TextEditorMain implements Disposable {
295
294
  for (let i = 0; i < len; i++) {
296
295
  ranges[i] = new monaco.Range(_ranges[4 * i], _ranges[4 * i + 1], _ranges[4 * i + 2], _ranges[4 * i + 3]);
297
296
  }
298
-
299
- this.editor.getControl().setDecorationsFast(key, ranges);
297
+ (this.editor.getControl() as unknown as StandaloneCodeEditor).setDecorationsFast(key, ranges);
300
298
  }
301
299
 
302
300
  private static toMonacoSelections(selection: Selection): monaco.Selection {
@@ -41,6 +41,9 @@ import { MonacoBulkEditService } from '@theia/monaco/lib/browser/monaco-bulk-edi
41
41
  import { MonacoEditorService } from '@theia/monaco/lib/browser/monaco-editor-service';
42
42
  import { theiaUritoUriComponents, UriComponents } from '../../common/uri-components';
43
43
  import { Endpoint } from '@theia/core/lib/browser/endpoint';
44
+ import * as monaco from '@theia/monaco-editor-core';
45
+ import { ResourceEdit } from '@theia/monaco-editor-core/esm/vs/editor/browser/services/bulkEditService';
46
+ import { IDecorationRenderOptions } from '@theia/monaco-editor-core/esm/vs/editor/common/editorCommon';
44
47
 
45
48
  export class TextEditorsMainImpl implements TextEditorsMain, Disposable {
46
49
 
@@ -120,7 +123,7 @@ export class TextEditorsMainImpl implements TextEditorsMain, Disposable {
120
123
  async $tryApplyWorkspaceEdit(dto: WorkspaceEditDto): Promise<boolean> {
121
124
  const workspaceEdit = toMonacoWorkspaceEdit(dto);
122
125
  try {
123
- const edits = monaco.editor.ResourceEdit.convert(workspaceEdit);
126
+ const edits = ResourceEdit.convert(workspaceEdit);
124
127
  const { success } = await this.bulkEditService.apply(edits);
125
128
  return success;
126
129
  } catch {
@@ -135,9 +138,9 @@ export class TextEditorsMainImpl implements TextEditorsMain, Disposable {
135
138
  return Promise.resolve(this.editorsAndDocuments.getEditor(id)!.insertSnippet(template, ranges, opts));
136
139
  }
137
140
 
138
- $registerTextEditorDecorationType(key: string, options: DecorationRenderOptions): void {
141
+ $registerTextEditorDecorationType(key: string, options: DecorationRenderOptions | IDecorationRenderOptions): void {
139
142
  this.injectRemoteUris(options);
140
- this.monacoEditorService.registerDecorationType(key, options);
143
+ this.monacoEditorService.registerDecorationType('Plugin decoration', key, options as IDecorationRenderOptions);
141
144
  this.toDispose.push(Disposable.create(() => this.$removeTextEditorDecorationType(key)));
142
145
  }
143
146
 
@@ -20,6 +20,7 @@ import { LabelProviderContribution, LabelProvider, URIIconReference } from '@the
20
20
  import { TreeLabelProvider } from '@theia/core/lib/browser/tree/tree-label-provider';
21
21
  import { TreeViewNode } from './tree-view-widget';
22
22
  import { TreeNode } from '@theia/core/lib/browser/tree/tree';
23
+ import { ThemeIcon } from '@theia/monaco-editor-core/esm/vs/platform/theme/common/themeService';
23
24
 
24
25
  @injectable()
25
26
  export class PluginTreeViewNodeLabelProvider implements LabelProviderContribution {
@@ -47,7 +48,7 @@ export class PluginTreeViewNodeLabelProvider implements LabelProviderContributio
47
48
  const uri = node.resourceUri && new URI(node.resourceUri) || undefined;
48
49
  return this.labelProvider.getIcon(URIIconReference.create(node.themeIconId, uri));
49
50
  }
50
- return monaco.theme.ThemeIcon.asClassName({ id: node.themeIconId });
51
+ return ThemeIcon.asClassName({ id: node.themeIconId });
51
52
  }
52
53
  if (node.resourceUri) {
53
54
  return this.labelProvider.getIcon(new URI(node.resourceUri));
@@ -40,7 +40,7 @@ import { DebugConsoleContribution } from '@theia/debug/lib/browser/console/debug
40
40
  import { TERMINAL_WIDGET_FACTORY_ID } from '@theia/terminal/lib/browser/terminal-widget-impl';
41
41
  import { TreeViewWidget } from './tree-view-widget';
42
42
  import { SEARCH_VIEW_CONTAINER_ID } from '@theia/search-in-workspace/lib/browser/search-in-workspace-factory';
43
-
43
+ import { ThemeIcon } from '@theia/monaco-editor-core/esm/vs/platform/theme/common/themeService';
44
44
  import { WebviewView, WebviewViewResolver } from '../webview-views/webview-views';
45
45
  import { WebviewWidget, WebviewWidgetIdentifier } from '../webview/webview';
46
46
  import { CancellationToken } from '@theia/core/lib/common/cancellation';
@@ -229,9 +229,9 @@ export class PluginViewRegistry implements FrontendApplicationContribution {
229
229
  const iconClass = 'plugin-view-container-icon-' + viewContainer.id;
230
230
 
231
231
  if (viewContainer.themeIcon) {
232
- const icon = monaco.theme.ThemeIcon.fromString(viewContainer.themeIcon);
232
+ const icon = ThemeIcon.fromString(viewContainer.themeIcon);
233
233
  if (icon) {
234
- themeIconClass = monaco.theme.ThemeIcon.asClassName(icon) ?? '';
234
+ themeIconClass = ThemeIcon.asClassName(icon) ?? '';
235
235
  }
236
236
  }
237
237
 
@@ -36,7 +36,7 @@ import {
36
36
  import { MenuPath, MenuModelRegistry, ActionMenuNode } from '@theia/core/lib/common/menu';
37
37
  import * as React from '@theia/core/shared/react';
38
38
  import { PluginSharedStyle } from '../plugin-shared-style';
39
- import { ACTION_ITEM, Widget } from '@theia/core/lib/browser/widgets/widget';
39
+ import { ACTION_ITEM, codicon, Widget } from '@theia/core/lib/browser/widgets/widget';
40
40
  import { Emitter, Event } from '@theia/core/lib/common/event';
41
41
  import { MessageService } from '@theia/core/lib/common/message-service';
42
42
  import { View } from '../../../common/plugin-protocol';
@@ -44,6 +44,7 @@ import CoreURI from '@theia/core/lib/common/uri';
44
44
  import { ContextKeyService } from '@theia/core/lib/browser/context-key-service';
45
45
  import * as markdownit from '@theia/core/shared/markdown-it';
46
46
  import { isMarkdownString } from '../../../plugin/markdown-string';
47
+ import { LabelParser } from '@theia/core/lib/browser/label-parser';
47
48
 
48
49
  export const TREE_NODE_HYPERLINK = 'theia-TreeNodeHyperlink';
49
50
  export const VIEW_ITEM_CONTEXT_MENU: MenuPath = ['view-item-context-menu'];
@@ -250,18 +251,35 @@ export class TreeViewWidget extends TreeViewWelcomeWidget {
250
251
  @inject(TooltipService)
251
252
  protected readonly tooltipService: TooltipService;
252
253
 
254
+ @inject(LabelParser)
255
+ protected readonly labelParser: LabelParser;
256
+
257
+ protected readonly markdownIt = markdownit();
258
+
253
259
  @postConstruct()
254
260
  protected override init(): void {
255
261
  super.init();
256
262
  this.id = this.identifier.id;
257
263
  this.addClass('theia-tree-view');
258
264
  this.node.style.height = '100%';
259
-
265
+ this.markdownItPlugin();
260
266
  this.model.onDidChangeWelcomeState(this.update, this);
261
267
  this.toDispose.push(this.model.onDidChangeWelcomeState(this.update, this));
262
268
  this.toDispose.push(this.onDidChangeVisibilityEmitter);
263
269
  }
264
270
 
271
+ protected markdownItPlugin(): void {
272
+ this.markdownIt.renderer.rules.text = (tokens, idx) => {
273
+ const content = tokens[idx].content;
274
+ return this.labelParser.parse(content).map(chunk => {
275
+ if (typeof chunk === 'string') {
276
+ return chunk;
277
+ }
278
+ return `<i class="${codicon(chunk.name)} ${chunk.animation ? `fa-${chunk.animation}` : ''} icon-inline"></i>`;
279
+ }).join('');
280
+ };
281
+ }
282
+
265
283
  protected override renderIcon(node: TreeNode, props: NodeProps): React.ReactNode {
266
284
  const icon = this.toNodeIcon(node);
267
285
  if (icon) {
@@ -285,7 +303,7 @@ export class TreeViewWidget extends TreeViewWelcomeWidget {
285
303
 
286
304
  if (node.tooltip && isMarkdownString(node.tooltip)) {
287
305
  // Render markdown in custom tooltip
288
- const tooltip = markdownit().render(node.tooltip.value);
306
+ const tooltip = this.markdownIt.render(node.tooltip.value);
289
307
 
290
308
  attrs = {
291
309
  ...attrs,
@@ -60,8 +60,14 @@ export class WebviewEnvironment {
60
60
  return (await this.externalEndpointUrl()).toString(true);
61
61
  }
62
62
 
63
- async resourceRoot(): Promise<string> {
64
- return (await this.externalEndpointUrl()).resolve('theia-resource/{{resource}}').toString(true);
63
+ async resourceRoot(host: string): Promise<string> {
64
+ if (host === 'frontend') {
65
+ return (await this.externalEndpointUrl()).withPath('{{path}}').toString(true);
66
+ }
67
+
68
+ // Make sure we preserve the scheme of the resource but convert it into a normal path segment
69
+ // The scheme is important as we need to know if we are requesting a local or a remote resource.
70
+ return (await this.externalEndpointUrl()).resolve('theia-resource/{{scheme}}//{{authority}}/{{path}}').toString(true);
65
71
  }
66
72
 
67
73
  async cspSource(): Promise<string> {
@@ -44,6 +44,7 @@ import { OutputChannelManager } from '@theia/output/lib/browser/output-channel';
44
44
  import { WebviewPreferences } from './webview-preferences';
45
45
  import { WebviewResourceCache } from './webview-resource-cache';
46
46
  import { Endpoint } from '@theia/core/lib/browser/endpoint';
47
+ import { isFirefox } from '@theia/core/lib/browser/browser';
47
48
  import { FileService } from '@theia/filesystem/lib/browser/file-service';
48
49
  import { FileOperationError, FileOperationResult } from '@theia/filesystem/lib/common/files';
49
50
  import { BinaryBufferReadableStream } from '@theia/core/lib/common/buffer';
@@ -250,6 +251,9 @@ export class WebviewWidget extends BaseWidget implements StatefulWidget {
250
251
  const element = document.createElement('iframe');
251
252
  element.className = 'webview';
252
253
  element.sandbox.add('allow-scripts', 'allow-forms', 'allow-same-origin', 'allow-downloads');
254
+ if (!isFirefox) {
255
+ element.setAttribute('allow', 'clipboard-read; clipboard-write; usb; serial; hid;');
256
+ }
253
257
  element.setAttribute('src', `${this.externalEndpoint}/index.html?id=${this.identifier.id}`);
254
258
  element.style.border = 'none';
255
259
  element.style.width = '100%';
@@ -26,6 +26,7 @@ import { URI } from '@theia/core/shared/vscode-uri';
26
26
  import * as model from '../../common/plugin-api-rpc-model';
27
27
  import * as Converter from '../type-converters';
28
28
  import * as types from '../types-impl';
29
+ import { Position } from '../../common/plugin-api-rpc';
29
30
 
30
31
  export class SelectionRangeProviderAdapter {
31
32
 
@@ -34,7 +35,7 @@ export class SelectionRangeProviderAdapter {
34
35
  private readonly documents: DocumentsExtImpl
35
36
  ) { }
36
37
 
37
- provideSelectionRanges(resource: URI, position: monaco.IPosition[], token: theia.CancellationToken): Promise<model.SelectionRange[][]> {
38
+ provideSelectionRanges(resource: URI, position: Position[], token: theia.CancellationToken): Promise<model.SelectionRange[][]> {
38
39
  const documentData = this.documents.getDocumentData(resource);
39
40
 
40
41
  if (!documentData) {
@@ -531,9 +531,11 @@ export class LanguagesExtImpl implements LanguagesExt {
531
531
  // ### Code Reference Provider end
532
532
 
533
533
  // ### Document Symbol Provider begin
534
- registerDocumentSymbolProvider(selector: theia.DocumentSelector, provider: theia.DocumentSymbolProvider, pluginInfo: PluginInfo): theia.Disposable {
534
+ registerDocumentSymbolProvider(selector: theia.DocumentSelector, provider: theia.DocumentSymbolProvider, pluginInfo: PluginInfo,
535
+ metadata?: theia.DocumentSymbolProviderMetadata): theia.Disposable {
535
536
  const callId = this.addNewAdapter(new OutlineAdapter(this.documents, provider));
536
- this.proxy.$registerOutlineSupport(callId, pluginInfo, this.transformDocumentSelector(selector));
537
+ const displayName = (metadata && metadata.label) || getPluginLabel(pluginInfo);
538
+ this.proxy.$registerOutlineSupport(callId, pluginInfo, this.transformDocumentSelector(selector), displayName);
537
539
  return this.createDisposable(callId);
538
540
  }
539
541
 
@@ -700,3 +702,7 @@ function serializeIndentation(indentationRules?: theia.IndentationRule): Seriali
700
702
  unIndentedLinePattern: serializeRegExp(indentationRules.unIndentedLinePattern)
701
703
  };
702
704
  }
705
+
706
+ function getPluginLabel(pluginInfo: PluginInfo): string {
707
+ return pluginInfo.displayName || pluginInfo.name;
708
+ }
@@ -132,7 +132,7 @@ export class DebugExtImpl implements DebugExt {
132
132
  return this.onDidChangeBreakpointsEmitter.event;
133
133
  }
134
134
 
135
- addBreakpoints(breakpoints: theia.Breakpoint[]): void {
135
+ addBreakpoints(breakpoints: readonly theia.Breakpoint[]): void {
136
136
  const added: theia.Breakpoint[] = [];
137
137
  for (const b of breakpoints) {
138
138
  if (this._breakpoints.has(b.id)) {
@@ -147,7 +147,7 @@ export class DebugExtImpl implements DebugExt {
147
147
  }
148
148
  }
149
149
 
150
- removeBreakpoints(breakpoints: theia.Breakpoint[]): void {
150
+ removeBreakpoints(breakpoints: readonly theia.Breakpoint[]): void {
151
151
  const removed: theia.Breakpoint[] = [];
152
152
  const removedIds: string[] = [];
153
153
  for (const b of breakpoints) {
@@ -41,6 +41,12 @@ export class OutputChannelImpl implements theia.OutputChannel {
41
41
  this.append(value + '\n');
42
42
  }
43
43
 
44
+ replace(value: string): void {
45
+ this.validate();
46
+ this.clear();
47
+ this.append(value);
48
+ }
49
+
44
50
  clear(): void {
45
51
  this.validate();
46
52
  this.proxy.$clear(this.name);
@@ -752,8 +752,9 @@ export function createAPIFactory(
752
752
  registerReferenceProvider(selector: theia.DocumentSelector, provider: theia.ReferenceProvider): theia.Disposable {
753
753
  return languagesExt.registerReferenceProvider(selector, provider, pluginToPluginInfo(plugin));
754
754
  },
755
- registerDocumentSymbolProvider(selector: theia.DocumentSelector, provider: theia.DocumentSymbolProvider): theia.Disposable {
756
- return languagesExt.registerDocumentSymbolProvider(selector, provider, pluginToPluginInfo(plugin));
755
+ registerDocumentSymbolProvider(selector: theia.DocumentSelector, provider: theia.DocumentSymbolProvider,
756
+ metadata?: theia.DocumentSymbolProviderMetadata): theia.Disposable {
757
+ return languagesExt.registerDocumentSymbolProvider(selector, provider, pluginToPluginInfo(plugin), metadata);
757
758
  },
758
759
  registerColorProvider(selector: theia.DocumentSelector, provider: theia.DocumentColorProvider): theia.Disposable {
759
760
  return languagesExt.registerColorProvider(selector, provider, pluginToPluginInfo(plugin));
@@ -852,10 +853,10 @@ export function createAPIFactory(
852
853
  stopDebugging(session?: theia.DebugSession): Thenable<void> {
853
854
  return debugExt.stopDebugging(session);
854
855
  },
855
- addBreakpoints(breakpoints: theia.Breakpoint[]): void {
856
+ addBreakpoints(breakpoints: readonly theia.Breakpoint[]): void {
856
857
  debugExt.addBreakpoints(breakpoints);
857
858
  },
858
- removeBreakpoints(breakpoints: theia.Breakpoint[]): void {
859
+ removeBreakpoints(breakpoints: readonly theia.Breakpoint[]): void {
859
860
  debugExt.removeBreakpoints(breakpoints);
860
861
  }
861
862
  };
@@ -19,7 +19,7 @@ import {
19
19
  Item, TransferQuickInputButton, TransferQuickPickItems, TransferQuickInput
20
20
  } from '../common/plugin-api-rpc';
21
21
  import * as theia from '@theia/plugin';
22
- import { QuickPickItem, InputBoxOptions, InputBox, QuickPick, QuickInput } from '@theia/plugin';
22
+ import { QuickPickItem, InputBoxOptions, InputBox, QuickPick, QuickInput, QuickPickItemValue } from '@theia/plugin';
23
23
  import { CancellationToken } from '@theia/core/lib/common/cancellation';
24
24
  import { RPCProtocol } from '../common/rpc-protocol';
25
25
  import { Emitter, Event } from '@theia/core/lib/common/event';
@@ -74,7 +74,7 @@ export class QuickOpenExtImpl implements QuickOpenExt {
74
74
  }
75
75
 
76
76
  /* eslint-disable max-len */
77
- showQuickPick(itemsOrItemsPromise: Array<QuickPickItem> | Promise<Array<QuickPickItem>>, options: theia.QuickPickOptions & { canPickMany: true; }, token?: theia.CancellationToken): Promise<Array<QuickPickItem> | undefined>;
77
+ showQuickPick(itemsOrItemsPromise: Array<QuickPickItem> | Promise<Array<QuickPickItem>>, options: theia.QuickPickOptions & { canPickMany: true; }, token?: theia.CancellationToken): Promise<Array<QuickPickItemValue> | undefined>;
78
78
  showQuickPick(itemsOrItemsPromise: string[] | Promise<string[]>, options?: theia.QuickPickOptions, token?: theia.CancellationToken): Promise<string | undefined>;
79
79
  showQuickPick(itemsOrItemsPromise: Array<QuickPickItem> | Promise<Array<QuickPickItem>>, options?: theia.QuickPickOptions, token?: theia.CancellationToken): Promise<QuickPickItem | undefined>;
80
80
  showQuickPick(itemsOrItemsPromise: Item[] | Promise<Item[]>, options?: theia.QuickPickOptions, token: theia.CancellationToken = CancellationToken.None): Promise<Item | Item[] | undefined> {
@@ -420,10 +420,10 @@ export class QuickInputExt implements QuickInput {
420
420
  this.dispose();
421
421
  }
422
422
 
423
- protected convertURL(iconPath: monaco.Uri | { light: string | monaco.Uri; dark: string | monaco.Uri } | monaco.theme.ThemeIcon):
423
+ protected convertURL(iconPath: URI | { light: string | URI; dark: string | URI } | ThemeIcon):
424
424
  URI | { light: string | URI; dark: string | URI } | ThemeIcon {
425
- const toUrl = (arg: string | monaco.Uri) => {
426
- arg = arg instanceof monaco.Uri && arg.scheme === 'file' ? arg.fsPath : arg;
425
+ const toUrl = (arg: string | URI) => {
426
+ arg = arg instanceof URI && arg.scheme === 'file' ? arg.fsPath : arg;
427
427
  if (typeof arg !== 'string') {
428
428
  return arg.toString(true);
429
429
  }
@@ -435,10 +435,10 @@ export class QuickInputExt implements QuickInput {
435
435
  };
436
436
  if (ThemeIcon.is(iconPath)) {
437
437
  return iconPath;
438
- } else if (typeof iconPath === 'string' || iconPath instanceof monaco.Uri) {
438
+ } else if (typeof iconPath === 'string' || iconPath instanceof URI) {
439
439
  return URI.parse(toUrl(iconPath));
440
440
  } else {
441
- const { light, dark } = iconPath as { light: string | monaco.Uri, dark: string | monaco.Uri };
441
+ const { light, dark } = iconPath as { light: string | URI, dark: string | URI };
442
442
  return {
443
443
  light: toUrl(light),
444
444
  dark: toUrl(dark)
@@ -613,15 +613,20 @@ export class QuickPickExt<T extends theia.QuickPickItem> extends QuickInputExt i
613
613
  this._itemsToHandles.set(item, i);
614
614
  });
615
615
  this.update({
616
- items: items.map((item, i) => ({
617
- type: item.type,
618
- label: item.label,
619
- description: item.description,
620
- handle: i,
621
- detail: item.detail,
622
- picked: item.picked,
623
- alwaysShow: item.alwaysShow
624
- }))
616
+ items: items.map((item, i) => {
617
+ if (item.type === 'separator') {
618
+ return { type: item.type, label: item.label };
619
+ }
620
+ return {
621
+ type: item.type,
622
+ label: item.label,
623
+ description: item.description,
624
+ handle: i,
625
+ detail: item.detail,
626
+ picked: item.picked,
627
+ alwaysShow: item.alwaysShow
628
+ };
629
+ })
625
630
  });
626
631
  }
627
632
 
@@ -735,7 +735,7 @@ export function fromTask(task: theia.Task): TaskDto | undefined {
735
735
  taskDto.problemMatcher = task.problemMatchers;
736
736
  }
737
737
  if ('detail' in task) {
738
- taskDto.detail = (task as theia.Task2).detail;
738
+ taskDto.detail = task.detail;
739
739
  }
740
740
  if (typeof task.scope === 'object') {
741
741
  taskDto.scope = task.scope.uri.toString();
@@ -797,7 +797,7 @@ export function toTask(taskDto: TaskDto): theia.Task {
797
797
  result.name = label;
798
798
  result.source = source;
799
799
  if (detail) {
800
- (result as theia.Task2).detail = detail;
800
+ result.detail = detail;
801
801
  }
802
802
  if (typeof scope === 'string') {
803
803
  const uri = URI.parse(scope);
@@ -1067,31 +1067,24 @@ export function fromColorPresentation(colorPresentation: theia.ColorPresentation
1067
1067
  }
1068
1068
 
1069
1069
  export function convertToTransferQuickPickItems(items: rpc.Item[]): rpc.TransferQuickPickItems[] {
1070
- const pickItems: rpc.TransferQuickPickItems[] = [];
1071
- for (let handle = 0; handle < items.length; handle++) {
1072
- const item = items[handle];
1073
- let label: string;
1074
- let description: string | undefined;
1075
- let detail: string | undefined;
1076
- let picked: boolean | undefined;
1077
- let alwaysShow: boolean | undefined;
1078
-
1070
+ return items.map<rpc.TransferQuickPickItems>((item, index) => {
1079
1071
  if (typeof item === 'string') {
1080
- label = item;
1072
+ return { type: 'item', label: item, handle: index };
1073
+ } else if (item.type === 'separator') {
1074
+ return { ...item, handle: index };
1081
1075
  } else {
1082
- ({ label, description, detail, picked, alwaysShow } = item);
1076
+ const { label, description, detail, picked, alwaysShow } = item;
1077
+ return {
1078
+ type: 'item',
1079
+ label,
1080
+ description,
1081
+ detail,
1082
+ picked,
1083
+ alwaysShow,
1084
+ handle: index,
1085
+ };
1083
1086
  }
1084
-
1085
- pickItems.push({
1086
- label,
1087
- description,
1088
- handle,
1089
- detail,
1090
- picked,
1091
- alwaysShow
1092
- });
1093
- }
1094
- return pickItems;
1087
+ });
1095
1088
  }
1096
1089
 
1097
1090
  export namespace DecorationRenderOptions {
@@ -1217,6 +1210,7 @@ export function pathOrURIToURI(value: string | URI): URI {
1217
1210
  export function pluginToPluginInfo(plugin: Plugin): rpc.PluginInfo {
1218
1211
  return {
1219
1212
  id: plugin.model.id,
1220
- name: plugin.model.name
1213
+ name: plugin.model.name,
1214
+ displayName: plugin.model.displayName
1221
1215
  };
1222
1216
  }
@@ -2086,9 +2086,7 @@ export class Task {
2086
2086
  }
2087
2087
 
2088
2088
  @es5ClassCompat
2089
- export class Task2 extends Task {
2090
- detail?: string;
2091
- }
2089
+ export class Task2 extends Task { }
2092
2090
 
2093
2091
  @es5ClassCompat
2094
2092
  export class DebugAdapterExecutable {
@@ -216,9 +216,9 @@ export class WebviewImpl implements theia.Webview {
216
216
 
217
217
  asWebviewUri(resource: theia.Uri): theia.Uri {
218
218
  const uri = this.initData.webviewResourceRoot
219
- // Make sure we preserve the scheme of the resource but convert it into a normal path segment
220
- // The scheme is important as we need to know if we are requesting a local or a remote resource.
221
- .replace('{{resource}}', resource.scheme + resource.toString().replace(/^\S+?:/, ''))
219
+ .replace('{{scheme}}', resource.scheme)
220
+ .replace('{{authority}}', resource.authority)
221
+ .replace('{{path}}', resource.path.replace(/^\//, ''))
222
222
  .replace('{{uuid}}', this.viewId);
223
223
  return URI.parse(uri);
224
224
  }