@theia/plugin-ext 1.47.1 → 1.48.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/lib/common/plugin-api-rpc.d.ts +19 -0
  2. package/lib/common/plugin-api-rpc.d.ts.map +1 -1
  3. package/lib/common/plugin-api-rpc.js +12 -1
  4. package/lib/common/plugin-api-rpc.js.map +1 -1
  5. package/lib/main/browser/documents-main.d.ts +2 -1
  6. package/lib/main/browser/documents-main.d.ts.map +1 -1
  7. package/lib/main/browser/documents-main.js +2 -1
  8. package/lib/main/browser/documents-main.js.map +1 -1
  9. package/lib/main/browser/languages-main.d.ts.map +1 -1
  10. package/lib/main/browser/languages-main.js +0 -1
  11. package/lib/main/browser/languages-main.js.map +1 -1
  12. package/lib/main/browser/main-context.d.ts.map +1 -1
  13. package/lib/main/browser/main-context.js +5 -11
  14. package/lib/main/browser/main-context.js.map +1 -1
  15. package/lib/main/browser/notebooks/notebook-documents-main.d.ts +11 -5
  16. package/lib/main/browser/notebooks/notebook-documents-main.d.ts.map +1 -1
  17. package/lib/main/browser/notebooks/notebook-documents-main.js +11 -0
  18. package/lib/main/browser/notebooks/notebook-documents-main.js.map +1 -1
  19. package/lib/main/browser/notebooks/notebook-kernels-main.d.ts.map +1 -1
  20. package/lib/main/browser/notebooks/notebook-kernels-main.js +16 -10
  21. package/lib/main/browser/notebooks/notebook-kernels-main.js.map +1 -1
  22. package/lib/main/browser/notebooks/notebooks-main.d.ts +12 -10
  23. package/lib/main/browser/notebooks/notebooks-main.d.ts.map +1 -1
  24. package/lib/main/browser/notebooks/notebooks-main.js +36 -7
  25. package/lib/main/browser/notebooks/notebooks-main.js.map +1 -1
  26. package/lib/main/browser/notebooks/renderers/cell-output-webview.d.ts.map +1 -1
  27. package/lib/main/browser/notebooks/renderers/cell-output-webview.js +5 -1
  28. package/lib/main/browser/notebooks/renderers/cell-output-webview.js.map +1 -1
  29. package/lib/main/browser/notebooks/renderers/output-webview-internal.d.ts.map +1 -1
  30. package/lib/main/browser/notebooks/renderers/output-webview-internal.js +7 -0
  31. package/lib/main/browser/notebooks/renderers/output-webview-internal.js.map +1 -1
  32. package/lib/main/browser/plugin-ext-frontend-module.d.ts.map +1 -1
  33. package/lib/main/browser/plugin-ext-frontend-module.js +3 -0
  34. package/lib/main/browser/plugin-ext-frontend-module.js.map +1 -1
  35. package/lib/main/browser/terminal-main.d.ts +11 -1
  36. package/lib/main/browser/terminal-main.d.ts.map +1 -1
  37. package/lib/main/browser/terminal-main.js +37 -0
  38. package/lib/main/browser/terminal-main.js.map +1 -1
  39. package/lib/main/browser/text-editor-main.d.ts.map +1 -1
  40. package/lib/main/browser/text-editor-main.js +6 -0
  41. package/lib/main/browser/text-editor-main.js.map +1 -1
  42. package/lib/main/browser/text-editors-main.d.ts +4 -3
  43. package/lib/main/browser/text-editors-main.d.ts.map +1 -1
  44. package/lib/main/browser/text-editors-main.js +18 -6
  45. package/lib/main/browser/text-editors-main.js.map +1 -1
  46. package/lib/main/browser/webview/webview-secondary-window-support.d.ts +8 -0
  47. package/lib/main/browser/webview/webview-secondary-window-support.d.ts.map +1 -0
  48. package/lib/main/browser/webview/webview-secondary-window-support.js +52 -0
  49. package/lib/main/browser/webview/webview-secondary-window-support.js.map +1 -0
  50. package/lib/plugin/dialogs.js +1 -1
  51. package/lib/plugin/dialogs.js.map +1 -1
  52. package/lib/plugin/notebook/notebook-document.d.ts.map +1 -1
  53. package/lib/plugin/notebook/notebook-document.js +16 -0
  54. package/lib/plugin/notebook/notebook-document.js.map +1 -1
  55. package/lib/plugin/notebook/notebook-kernels.d.ts +5 -2
  56. package/lib/plugin/notebook/notebook-kernels.d.ts.map +1 -1
  57. package/lib/plugin/notebook/notebook-kernels.js +17 -7
  58. package/lib/plugin/notebook/notebook-kernels.js.map +1 -1
  59. package/lib/plugin/notebook/notebooks.d.ts.map +1 -1
  60. package/lib/plugin/notebook/notebooks.js +18 -1
  61. package/lib/plugin/notebook/notebooks.js.map +1 -1
  62. package/lib/plugin/plugin-context.d.ts.map +1 -1
  63. package/lib/plugin/plugin-context.js +5 -1
  64. package/lib/plugin/plugin-context.js.map +1 -1
  65. package/lib/plugin/preference-registry.js +4 -4
  66. package/lib/plugin/preference-registry.js.map +1 -1
  67. package/lib/plugin/quick-open.d.ts.map +1 -1
  68. package/lib/plugin/quick-open.js +0 -1
  69. package/lib/plugin/quick-open.js.map +1 -1
  70. package/lib/plugin/terminal-ext.d.ts +3 -0
  71. package/lib/plugin/terminal-ext.d.ts.map +1 -1
  72. package/lib/plugin/terminal-ext.js +19 -0
  73. package/lib/plugin/terminal-ext.js.map +1 -1
  74. package/lib/plugin/types-impl.d.ts +2 -1
  75. package/lib/plugin/types-impl.d.ts.map +1 -1
  76. package/lib/plugin/types-impl.js +1 -0
  77. package/lib/plugin/types-impl.js.map +1 -1
  78. package/lib/plugin/webviews.d.ts +2 -0
  79. package/lib/plugin/webviews.d.ts.map +1 -1
  80. package/lib/plugin/webviews.js +7 -0
  81. package/lib/plugin/webviews.js.map +1 -1
  82. package/package.json +29 -29
  83. package/src/common/plugin-api-rpc.ts +29 -0
  84. package/src/main/browser/documents-main.ts +4 -0
  85. package/src/main/browser/languages-main.ts +0 -1
  86. package/src/main/browser/main-context.ts +7 -11
  87. package/src/main/browser/notebooks/notebook-documents-main.ts +20 -5
  88. package/src/main/browser/notebooks/notebook-kernels-main.ts +15 -10
  89. package/src/main/browser/notebooks/notebooks-main.ts +41 -12
  90. package/src/main/browser/notebooks/renderers/cell-output-webview.tsx +5 -1
  91. package/src/main/browser/notebooks/renderers/output-webview-internal.ts +8 -0
  92. package/src/main/browser/plugin-ext-frontend-module.ts +3 -0
  93. package/src/main/browser/terminal-main.ts +46 -0
  94. package/src/main/browser/text-editor-main.ts +7 -1
  95. package/src/main/browser/text-editors-main.ts +25 -6
  96. package/src/main/browser/webview/pre/main.js +2 -2
  97. package/src/main/browser/webview/webview-secondary-window-support.ts +47 -0
  98. package/src/plugin/dialogs.ts +1 -1
  99. package/src/plugin/notebook/notebook-document.ts +14 -1
  100. package/src/plugin/notebook/notebook-kernels.ts +22 -8
  101. package/src/plugin/notebook/notebooks.ts +19 -2
  102. package/src/plugin/plugin-context.ts +8 -2
  103. package/src/plugin/preference-registry.ts +4 -4
  104. package/src/plugin/quick-open.ts +0 -1
  105. package/src/plugin/terminal-ext.ts +20 -1
  106. package/src/plugin/types-impl.ts +2 -1
  107. package/src/plugin/webviews.ts +9 -0
@@ -287,7 +287,8 @@ export class NotebookDocument implements Disposable {
287
287
  } else if (rawEvent.kind === notebookCommon.NotebookCellsChangeType.Output) {
288
288
  this.setCellOutputs(rawEvent.index, rawEvent.outputs);
289
289
  relaxedCellChanges.push({ cell: this.cells[rawEvent.index].apiCell, outputs: this.cells[rawEvent.index].apiCell.outputs });
290
-
290
+ } else if (rawEvent.kind === notebookCommon.NotebookCellsChangeType.ChangeDocumentMetadata) {
291
+ this.metadata = result.metadata ?? {};
291
292
  // } else if (rawEvent.kind === notebookCommon.NotebookCellsChangeType.OutputItem) {
292
293
  // this._setCellOutputItems(rawEvent.index, rawEvent.outputId, rawEvent.append, rawEvent.outputItems);
293
294
  // relaxedCellChanges.push({ cell: this.cells[rawEvent.index].apiCell, outputs: this.cells[rawEvent.index].apiCell.outputs });
@@ -357,6 +358,18 @@ export class NotebookDocument implements Disposable {
357
358
  const extCell = new Cell(this, this.editorsAndDocuments, cell);
358
359
  if (!initialization) {
359
360
  addedCellDocuments.push(Cell.asModelAddData(this.apiNotebook, cell));
361
+ this.editorsAndDocuments.$acceptEditorsAndDocumentsDelta({
362
+ addedDocuments: [
363
+ {
364
+ uri: cell.uri,
365
+ versionId: 1,
366
+ lines: cell.source,
367
+ EOL: cell.eol,
368
+ modeId: '',
369
+ isDirty: false
370
+ }
371
+ ]
372
+ });
360
373
  }
361
374
  return extCell;
362
375
  });
@@ -20,11 +20,11 @@
20
20
 
21
21
  import {
22
22
  CellExecuteUpdateDto, NotebookKernelDto, NotebookKernelsExt, NotebookKernelsMain,
23
- NotebookKernelSourceActionDto, NotebookOutputDto, PluginModel, PluginPackage, PLUGIN_RPC_CONTEXT
23
+ NotebookKernelSourceActionDto, NotebookOutputDto, PluginModel, PLUGIN_RPC_CONTEXT
24
24
  } from '../../common';
25
25
  import { RPCProtocol } from '../../common/rpc-protocol';
26
26
  import { UriComponents } from '../../common/uri-components';
27
- import { CancellationTokenSource, Disposable, DisposableCollection, Emitter, Path } from '@theia/core';
27
+ import { CancellationTokenSource, Disposable, DisposableCollection, Emitter } from '@theia/core';
28
28
  import { Cell } from './notebook-document';
29
29
  import { NotebooksExtImpl } from './notebooks';
30
30
  import { NotebookCellOutputConverter, NotebookCellOutputItem, NotebookKernelSourceAction } from '../type-converters';
@@ -34,6 +34,8 @@ import { CommandRegistryImpl } from '../command-registry';
34
34
  import { NotebookCellOutput, NotebookRendererScript, URI } from '../types-impl';
35
35
  import { toUriComponents } from '../../main/browser/hierarchy/hierarchy-types-converters';
36
36
  import type * as theia from '@theia/plugin';
37
+ import { WebviewsExtImpl } from '../webviews';
38
+ import { WorkspaceExtImpl } from '../workspace';
37
39
 
38
40
  interface KernelData {
39
41
  extensionId: string;
@@ -64,8 +66,21 @@ export class NotebookKernelsExtImpl implements NotebookKernelsExt {
64
66
  rpc: RPCProtocol,
65
67
  private readonly notebooks: NotebooksExtImpl,
66
68
  private readonly commands: CommandRegistryImpl,
69
+ private readonly webviews: WebviewsExtImpl,
70
+ workspace: WorkspaceExtImpl
67
71
  ) {
68
72
  this.proxy = rpc.getProxy(PLUGIN_RPC_CONTEXT.NOTEBOOK_KERNELS_MAIN);
73
+
74
+ // call onDidChangeSelection for all kernels after trust is granted to inform extensions they can set the kernel as assoiciated
75
+ // the jupyter extension for example does not set kernel association after trust is granted
76
+ workspace.onDidGrantWorkspaceTrust(() => {
77
+ this.kernelData.forEach(kernel => {
78
+ kernel.associatedNotebooks.forEach(async (_, uri) => {
79
+ const notebook = await this.notebooks.waitForNotebookDocument(URI.parse(uri));
80
+ kernel.onDidChangeSelection.fire({ selected: true, notebook: notebook.apiNotebook });
81
+ });
82
+ });
83
+ });
69
84
  }
70
85
 
71
86
  private currentHandle = 0;
@@ -216,8 +231,7 @@ export class NotebookKernelsExtImpl implements NotebookKernelsExt {
216
231
  return that.proxy.$postMessage(handle, 'notebook:' + editor?.notebook.uri.toString(), message);
217
232
  },
218
233
  asWebviewUri(localResource: theia.Uri): theia.Uri {
219
- const basePath = PluginPackage.toPluginUrl(extension, '');
220
- return URI.from({ path: new Path(basePath).join(localResource.path).toString(), scheme: 'https' });
234
+ return that.webviews.toGeneralWebviewResource(extension, localResource);
221
235
  }
222
236
  };
223
237
 
@@ -294,20 +308,20 @@ export class NotebookKernelsExtImpl implements NotebookKernelsExt {
294
308
  };
295
309
  }
296
310
 
297
- async $acceptNotebookAssociation(handle: number, uri: UriComponents, value: boolean): Promise<void> {
311
+ async $acceptNotebookAssociation(handle: number, uri: UriComponents, selected: boolean): Promise<void> {
298
312
  const obj = this.kernelData.get(handle);
299
313
  if (obj) {
300
314
  // update data structure
301
315
  const notebook = await this.notebooks.waitForNotebookDocument(URI.from(uri));
302
- if (value) {
316
+ if (selected) {
303
317
  obj.associatedNotebooks.set(notebook.uri.toString(), true);
304
318
  } else {
305
319
  obj.associatedNotebooks.delete(notebook.uri.toString());
306
320
  }
307
- console.debug(`NotebookController[${handle}] ASSOCIATE notebook`, notebook.uri.toString(), value);
321
+ console.debug(`NotebookController[${handle}] ASSOCIATE notebook`, notebook.uri.toString(), selected);
308
322
  // send event
309
323
  obj.onDidChangeSelection.fire({
310
- selected: value,
324
+ selected: selected,
311
325
  notebook: notebook.apiNotebook
312
326
  });
313
327
  }
@@ -36,7 +36,7 @@ import { NotebookDocument } from './notebook-document';
36
36
  import { NotebookEditor } from './notebook-editor';
37
37
  import { EditorsAndDocumentsExtImpl } from '../editors-and-documents';
38
38
  import { DocumentsExtImpl } from '../documents';
39
- import { NotebookModelResource } from '@theia/notebook/lib/common';
39
+ import { CellUri, NotebookCellModelResource, NotebookModelResource } from '@theia/notebook/lib/common';
40
40
 
41
41
  export class NotebooksExtImpl implements NotebooksExt {
42
42
 
@@ -76,7 +76,7 @@ export class NotebooksExtImpl implements NotebooksExt {
76
76
  rpc: RPCProtocol,
77
77
  commands: CommandRegistryExt,
78
78
  private textDocumentsAndEditors: EditorsAndDocumentsExtImpl,
79
- private textDocuments: DocumentsExtImpl
79
+ private textDocuments: DocumentsExtImpl,
80
80
  ) {
81
81
  this.notebookProxy = rpc.getProxy(PLUGIN_RPC_CONTEXT.NOTEBOOKS_MAIN);
82
82
  this.notebookDocumentsProxy = rpc.getProxy(PLUGIN_RPC_CONTEXT.NOTEBOOK_DOCUMENTS_MAIN);
@@ -86,6 +86,12 @@ export class NotebooksExtImpl implements NotebooksExt {
86
86
  processArgument: arg => {
87
87
  if (NotebookModelResource.is(arg)) {
88
88
  return this.documents.get(arg.notebookModelUri.toString())?.apiNotebook;
89
+ } else if (NotebookCellModelResource.is(arg)) {
90
+ const cellUri = CellUri.parse(arg.notebookCellModelUri);
91
+ if (cellUri) {
92
+ return this.documents.get(cellUri?.notebook.toString())?.getCell(cellUri.handle)?.apiCell;
93
+ }
94
+ return undefined;
89
95
  } else {
90
96
  return arg;
91
97
  }
@@ -236,6 +242,17 @@ export class NotebooksExtImpl implements NotebooksExt {
236
242
  this.documents.get(uri.toString())?.dispose();
237
243
  this.documents.set(uri.toString(), document);
238
244
 
245
+ this.textDocumentsAndEditors.$acceptEditorsAndDocumentsDelta({
246
+ addedDocuments: modelData.cells.map(cell => ({
247
+ uri: cell.uri,
248
+ versionId: 1,
249
+ lines: cell.source,
250
+ EOL: cell.eol,
251
+ modeId: '',
252
+ isDirty: false
253
+ }))
254
+ });
255
+
239
256
  this.onDidOpenNotebookDocumentEmitter.fire(document.apiNotebook);
240
257
  }
241
258
  }
@@ -276,7 +276,7 @@ export function createAPIFactory(
276
276
  const notebooksExt = rpc.set(MAIN_RPC_CONTEXT.NOTEBOOKS_EXT, new NotebooksExtImpl(rpc, commandRegistry, editorsAndDocumentsExt, documents));
277
277
  const notebookEditors = rpc.set(MAIN_RPC_CONTEXT.NOTEBOOK_EDITORS_EXT, new NotebookEditorsExtImpl(notebooksExt));
278
278
  const notebookRenderers = rpc.set(MAIN_RPC_CONTEXT.NOTEBOOK_RENDERERS_EXT, new NotebookRenderersExtImpl(rpc, notebooksExt));
279
- const notebookKernels = rpc.set(MAIN_RPC_CONTEXT.NOTEBOOK_KERNELS_EXT, new NotebookKernelsExtImpl(rpc, notebooksExt, commandRegistry));
279
+ const notebookKernels = rpc.set(MAIN_RPC_CONTEXT.NOTEBOOK_KERNELS_EXT, new NotebookKernelsExtImpl(rpc, notebooksExt, commandRegistry, webviewExt, workspaceExt));
280
280
  const notebookDocuments = rpc.set(MAIN_RPC_CONTEXT.NOTEBOOK_DOCUMENTS_EXT, new NotebookDocumentsExtImpl(notebooksExt));
281
281
  const statusBarMessageRegistryExt = new StatusBarMessageRegistryExt(rpc);
282
282
  const terminalExt = rpc.set(MAIN_RPC_CONTEXT.TERMINAL_EXT, new TerminalServiceExtImpl(rpc));
@@ -603,6 +603,12 @@ export function createAPIFactory(
603
603
  registerTerminalQuickFixProvider(id: string, provider: theia.TerminalQuickFixProvider): theia.Disposable {
604
604
  return terminalExt.registerTerminalQuickFixProvider(id, provider);
605
605
  },
606
+
607
+ /** Theia-specific TerminalObserver */
608
+ registerTerminalObserver(observer: theia.TerminalObserver): theia.Disposable {
609
+ return terminalExt.registerTerminalObserver(observer);
610
+ },
611
+
606
612
  /** @stubbed ShareProvider */
607
613
  registerShareProvider: () => Disposable.NULL,
608
614
  };
@@ -738,7 +744,7 @@ export function createAPIFactory(
738
744
  registerTextDocumentContentProvider(scheme: string, provider: theia.TextDocumentContentProvider): theia.Disposable {
739
745
  return workspaceExt.registerTextDocumentContentProvider(scheme, provider);
740
746
  },
741
- registerFileSystemProvider(scheme: string, provider: theia.FileSystemProvider, options?: { isCaseSensitive?: boolean, isReadonly?: boolean | MarkdownString}):
747
+ registerFileSystemProvider(scheme: string, provider: theia.FileSystemProvider, options?: { isCaseSensitive?: boolean, isReadonly?: boolean | MarkdownString }):
742
748
  theia.Disposable {
743
749
  return fileSystemExt.registerFileSystemProvider(scheme, provider, options);
744
750
  },
@@ -198,10 +198,10 @@ export class PreferenceRegistryExtImpl implements PreferenceRegistryExt {
198
198
  }
199
199
 
200
200
  const configInspect: ConfigurationInspect<T> = { key };
201
- configInspect.defaultValue = result.default?.value;
202
- configInspect.globalValue = result.user?.value;
203
- configInspect.workspaceValue = result.workspace?.value;
204
- configInspect.workspaceFolderValue = result.workspaceFolder?.value;
201
+ configInspect.defaultValue = cloneDeep(result.default?.value);
202
+ configInspect.globalValue = cloneDeep(result.user?.value);
203
+ configInspect.workspaceValue = cloneDeep(result.workspace?.value);
204
+ configInspect.workspaceFolderValue = cloneDeep(result.workspaceFolder?.value);
205
205
  return configInspect;
206
206
  }
207
207
  };
@@ -455,7 +455,6 @@ export class QuickInputExt implements theia.QuickInput {
455
455
 
456
456
  hide(): void {
457
457
  this.quickOpenMain.$hide();
458
- this.dispose();
459
458
  }
460
459
 
461
460
  protected convertURL(iconPath: URI | { light: string | URI; dark: string | URI } | ThemeIcon):
@@ -49,7 +49,6 @@ export function getIconClass(options: theia.TerminalOptions | theia.ExtensionTer
49
49
  */
50
50
  @injectable()
51
51
  export class TerminalServiceExtImpl implements TerminalServiceExt {
52
-
53
52
  private readonly proxy: TerminalServiceMain;
54
53
 
55
54
  private readonly _terminals = new Map<string, TerminalExtImpl>();
@@ -58,6 +57,7 @@ export class TerminalServiceExtImpl implements TerminalServiceExt {
58
57
 
59
58
  private static nextProviderId = 0;
60
59
  private readonly terminalLinkProviders = new Map<string, theia.TerminalLinkProvider>();
60
+ private readonly terminalObservers = new Map<string, theia.TerminalObserver>();
61
61
  private readonly terminalProfileProviders = new Map<string, theia.TerminalProfileProvider>();
62
62
  private readonly onDidCloseTerminalEmitter = new Emitter<Terminal>();
63
63
  readonly onDidCloseTerminal: theia.Event<Terminal> = this.onDidCloseTerminalEmitter.event;
@@ -270,6 +270,25 @@ export class TerminalServiceExtImpl implements TerminalServiceExt {
270
270
  return Disposable.NULL;
271
271
  }
272
272
 
273
+ registerTerminalObserver(observer: theia.TerminalObserver): theia.Disposable {
274
+ const id = (TerminalServiceExtImpl.nextProviderId++).toString();
275
+ this.terminalObservers.set(id, observer);
276
+ this.proxy.$registerTerminalObserver(id, observer.nrOfLinesToMatch, observer.outputMatcherRegex);
277
+ return Disposable.create(() => {
278
+ this.proxy.$unregisterTerminalObserver(id);
279
+ this.terminalObservers.delete(id);
280
+ });
281
+ }
282
+
283
+ $reportOutputMatch(observerId: string, groups: string[]): void {
284
+ const observer = this.terminalObservers.get(observerId);
285
+ if (observer) {
286
+ observer.matchOccurred(groups);
287
+ } else {
288
+ throw new Error(`reporting matches for unregistered observer: ${observerId} `);
289
+ }
290
+ }
291
+
273
292
  protected isExtensionTerminalOptions(options: theia.TerminalOptions | theia.ExtensionTerminalOptions): options is theia.ExtensionTerminalOptions {
274
293
  return 'pty' in options;
275
294
  }
@@ -153,7 +153,8 @@ export enum StatusBarAlignment {
153
153
  export enum TextEditorLineNumbersStyle {
154
154
  Off = 0,
155
155
  On = 1,
156
- Relative = 2
156
+ Relative = 2,
157
+ Interval = 3
157
158
  }
158
159
 
159
160
  /**
@@ -24,6 +24,7 @@ import { fromViewColumn, toViewColumn, toWebviewPanelShowOptions } from './type-
24
24
  import { Disposable, WebviewPanelTargetArea, URI } from './types-impl';
25
25
  import { WorkspaceExtImpl } from './workspace';
26
26
  import { PluginIconPath } from './plugin-icon-path';
27
+ import { PluginModel, PluginPackage } from '../common';
27
28
 
28
29
  @injectable()
29
30
  export class WebviewsExtImpl implements WebviewsExt {
@@ -196,6 +197,14 @@ export class WebviewsExtImpl implements WebviewsExt {
196
197
  return undefined;
197
198
  }
198
199
 
200
+ toGeneralWebviewResource(extension: PluginModel, resource: theia.Uri): theia.Uri {
201
+ const extensionUri = URI.parse(extension.packageUri);
202
+ const relativeResourcePath = resource.path.replace(extensionUri.path, '');
203
+ const basePath = PluginPackage.toPluginUrl(extension, '') + relativeResourcePath;
204
+
205
+ return URI.parse(this.initData!.webviewResourceRoot.replace('{{uuid}}', 'webviewUUID')).with({ path: basePath });
206
+ }
207
+
199
208
  public deleteWebview(handle: string): void {
200
209
  this.webviews.delete(handle);
201
210
  }