@theia/plugin-ext 1.44.0 → 1.45.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 (115) hide show
  1. package/lib/common/plugin-api-rpc.d.ts +2 -1
  2. package/lib/common/plugin-api-rpc.d.ts.map +1 -1
  3. package/lib/common/plugin-api-rpc.js.map +1 -1
  4. package/lib/common/proxy-handler.d.ts.map +1 -1
  5. package/lib/common/proxy-handler.js +3 -1
  6. package/lib/common/proxy-handler.js.map +1 -1
  7. package/lib/common/test-types.d.ts +9 -0
  8. package/lib/common/test-types.d.ts.map +1 -1
  9. package/lib/common/test-types.js +36 -1
  10. package/lib/common/test-types.js.map +1 -1
  11. package/lib/hosted/browser/hosted-plugin.d.ts +2 -0
  12. package/lib/hosted/browser/hosted-plugin.d.ts.map +1 -1
  13. package/lib/hosted/browser/hosted-plugin.js +54 -6
  14. package/lib/hosted/browser/hosted-plugin.js.map +1 -1
  15. package/lib/hosted/node/plugin-activation-events.d.ts.map +1 -1
  16. package/lib/hosted/node/plugin-activation-events.js +1 -1
  17. package/lib/hosted/node/plugin-activation-events.js.map +1 -1
  18. package/lib/main/browser/debug/plugin-debug-service.d.ts.map +1 -1
  19. package/lib/main/browser/debug/plugin-debug-service.js +7 -0
  20. package/lib/main/browser/debug/plugin-debug-service.js.map +1 -1
  21. package/lib/main/browser/menus/plugin-menu-command-adapter.d.ts +1 -0
  22. package/lib/main/browser/menus/plugin-menu-command-adapter.d.ts.map +1 -1
  23. package/lib/main/browser/menus/plugin-menu-command-adapter.js +30 -0
  24. package/lib/main/browser/menus/plugin-menu-command-adapter.js.map +1 -1
  25. package/lib/main/browser/menus/vscode-theia-menu-mappings.d.ts +2 -2
  26. package/lib/main/browser/menus/vscode-theia-menu-mappings.d.ts.map +1 -1
  27. package/lib/main/browser/menus/vscode-theia-menu-mappings.js +6 -1
  28. package/lib/main/browser/menus/vscode-theia-menu-mappings.js.map +1 -1
  29. package/lib/main/browser/notebooks/notebook-documents-and-editors-main.d.ts +4 -2
  30. package/lib/main/browser/notebooks/notebook-documents-and-editors-main.d.ts.map +1 -1
  31. package/lib/main/browser/notebooks/notebook-documents-and-editors-main.js +34 -21
  32. package/lib/main/browser/notebooks/notebook-documents-and-editors-main.js.map +1 -1
  33. package/lib/main/browser/notebooks/notebook-documents-main.d.ts.map +1 -1
  34. package/lib/main/browser/notebooks/notebook-documents-main.js +8 -9
  35. package/lib/main/browser/notebooks/notebook-documents-main.js.map +1 -1
  36. package/lib/main/browser/notebooks/notebook-dto.d.ts +3 -0
  37. package/lib/main/browser/notebooks/notebook-dto.d.ts.map +1 -1
  38. package/lib/main/browser/notebooks/notebook-dto.js +27 -34
  39. package/lib/main/browser/notebooks/notebook-dto.js.map +1 -1
  40. package/lib/main/browser/notebooks/notebook-kernels-main.js +3 -3
  41. package/lib/main/browser/notebooks/notebook-kernels-main.js.map +1 -1
  42. package/lib/main/browser/notebooks/notebooks-main.d.ts +12 -1
  43. package/lib/main/browser/notebooks/notebooks-main.d.ts.map +1 -1
  44. package/lib/main/browser/notebooks/notebooks-main.js.map +1 -1
  45. package/lib/main/browser/notebooks/renderers/cell-output-webview.d.ts +1 -2
  46. package/lib/main/browser/notebooks/renderers/cell-output-webview.d.ts.map +1 -1
  47. package/lib/main/browser/notebooks/renderers/cell-output-webview.js +1 -1
  48. package/lib/main/browser/notebooks/renderers/cell-output-webview.js.map +1 -1
  49. package/lib/main/browser/plugin-shared-style.d.ts.map +1 -1
  50. package/lib/main/browser/plugin-shared-style.js +3 -2
  51. package/lib/main/browser/plugin-shared-style.js.map +1 -1
  52. package/lib/main/browser/webview/webview.d.ts +13 -1
  53. package/lib/main/browser/webview/webview.d.ts.map +1 -1
  54. package/lib/main/browser/webview/webview.js +28 -1
  55. package/lib/main/browser/webview/webview.js.map +1 -1
  56. package/lib/main/node/plugin-deployer-contribution.d.ts.map +1 -1
  57. package/lib/main/node/plugin-deployer-contribution.js +2 -1
  58. package/lib/main/node/plugin-deployer-contribution.js.map +1 -1
  59. package/lib/main/node/plugin-deployer-impl.d.ts.map +1 -1
  60. package/lib/main/node/plugin-deployer-impl.js +2 -1
  61. package/lib/main/node/plugin-deployer-impl.js.map +1 -1
  62. package/lib/plugin/command-registry.d.ts.map +1 -1
  63. package/lib/plugin/command-registry.js +9 -3
  64. package/lib/plugin/command-registry.js.map +1 -1
  65. package/lib/plugin/notebook/notebook-document.js +3 -3
  66. package/lib/plugin/notebook/notebook-document.js.map +1 -1
  67. package/lib/plugin/notebook/notebooks.d.ts.map +1 -1
  68. package/lib/plugin/notebook/notebooks.js +7 -4
  69. package/lib/plugin/notebook/notebooks.js.map +1 -1
  70. package/lib/plugin/plugin-manager.d.ts +1 -1
  71. package/lib/plugin/plugin-manager.d.ts.map +1 -1
  72. package/lib/plugin/plugin-manager.js +3 -23
  73. package/lib/plugin/plugin-manager.js.map +1 -1
  74. package/lib/plugin/tests.d.ts +6 -1
  75. package/lib/plugin/tests.d.ts.map +1 -1
  76. package/lib/plugin/tests.js +22 -0
  77. package/lib/plugin/tests.js.map +1 -1
  78. package/lib/plugin/type-converters.d.ts +1 -12
  79. package/lib/plugin/type-converters.d.ts.map +1 -1
  80. package/lib/plugin/type-converters.js +3 -121
  81. package/lib/plugin/type-converters.js.map +1 -1
  82. package/lib/plugin/types-impl.d.ts +1 -0
  83. package/lib/plugin/types-impl.d.ts.map +1 -1
  84. package/lib/plugin/types-impl.js.map +1 -1
  85. package/lib/plugin/window-state.d.ts.map +1 -1
  86. package/lib/plugin/window-state.js +3 -4
  87. package/lib/plugin/window-state.js.map +1 -1
  88. package/package.json +29 -29
  89. package/src/common/plugin-api-rpc.ts +2 -1
  90. package/src/common/proxy-handler.ts +3 -1
  91. package/src/common/test-types.ts +20 -0
  92. package/src/hosted/browser/hosted-plugin.ts +51 -6
  93. package/src/hosted/node/plugin-activation-events.ts +10 -9
  94. package/src/main/browser/debug/plugin-debug-service.ts +7 -0
  95. package/src/main/browser/menus/plugin-menu-command-adapter.ts +30 -0
  96. package/src/main/browser/menus/vscode-theia-menu-mappings.ts +7 -2
  97. package/src/main/browser/notebooks/notebook-documents-and-editors-main.ts +36 -22
  98. package/src/main/browser/notebooks/notebook-documents-main.ts +11 -12
  99. package/src/main/browser/notebooks/notebook-dto.ts +24 -34
  100. package/src/main/browser/notebooks/notebook-kernels-main.ts +1 -1
  101. package/src/main/browser/notebooks/notebooks-main.ts +13 -2
  102. package/src/main/browser/notebooks/renderers/cell-output-webview.tsx +3 -3
  103. package/src/main/browser/plugin-shared-style.ts +3 -2
  104. package/src/main/browser/webview/pre/main.js +27 -2
  105. package/src/main/browser/webview/webview.ts +32 -1
  106. package/src/main/node/plugin-deployer-contribution.ts +2 -1
  107. package/src/main/node/plugin-deployer-impl.ts +2 -1
  108. package/src/plugin/command-registry.ts +8 -3
  109. package/src/plugin/notebook/notebook-document.ts +8 -8
  110. package/src/plugin/notebook/notebooks.ts +6 -4
  111. package/src/plugin/plugin-manager.ts +4 -24
  112. package/src/plugin/tests.ts +25 -1
  113. package/src/plugin/type-converters.ts +3 -123
  114. package/src/plugin/types-impl.ts +1 -0
  115. package/src/plugin/window-state.ts +4 -4
@@ -31,8 +31,7 @@ import { DisposableCollection, Mutable, isEmptyObject, isObject } from '@theia/c
31
31
  import * as notebooks from '@theia/notebook/lib/common';
32
32
  import { CommandsConverter } from './command-registry';
33
33
  import { BinaryBuffer } from '@theia/core/lib/common/buffer';
34
- import { CellData, CellExecutionUpdateType, CellOutput, CellOutputItem, CellRange, isTextStreamMime } from '@theia/notebook/lib/common';
35
- import { CellExecuteUpdate, CellExecutionComplete } from '@theia/notebook/lib/browser';
34
+ import { CellRange, isTextStreamMime } from '@theia/notebook/lib/common';
36
35
  import { MarkdownString as MarkdownStringDTO } from '@theia/core/lib/common/markdown-rendering';
37
36
 
38
37
  import { TestItemDTO, TestMessageDTO } from '../common/test-types';
@@ -1636,126 +1635,6 @@ export namespace NotebookKernelSourceAction {
1636
1635
  }
1637
1636
  }
1638
1637
 
1639
- export namespace NotebookDto {
1640
-
1641
- export function toNotebookOutputItemDto(item: CellOutputItem): rpc.NotebookOutputItemDto {
1642
- return {
1643
- mime: item.mime,
1644
- valueBytes: item.data
1645
- };
1646
- }
1647
-
1648
- export function toNotebookOutputDto(output: CellOutput): rpc.NotebookOutputDto {
1649
- return {
1650
- outputId: output.outputId,
1651
- metadata: output.metadata,
1652
- items: output.outputs.map(toNotebookOutputItemDto)
1653
- };
1654
- }
1655
-
1656
- export function toNotebookCellDataDto(cell: CellData): rpc.NotebookCellDataDto {
1657
- return {
1658
- cellKind: cell.cellKind,
1659
- language: cell.language,
1660
- source: cell.source,
1661
- internalMetadata: cell.internalMetadata,
1662
- metadata: cell.metadata,
1663
- outputs: cell.outputs.map(toNotebookOutputDto)
1664
- };
1665
- }
1666
-
1667
- // export function toNotebookDataDto(data: NotebookData): rpc.NotebookDataDto {
1668
- // return {
1669
- // metadata: data.metadata,
1670
- // cells: data.cells.map(toNotebookCellDataDto)
1671
- // };
1672
- // }
1673
-
1674
- export function fromNotebookOutputItemDto(item: rpc.NotebookOutputItemDto): CellOutputItem {
1675
- return {
1676
- mime: item.mime,
1677
- data: item.valueBytes
1678
- };
1679
- }
1680
-
1681
- export function fromNotebookOutputDto(output: rpc.NotebookOutputDto): CellOutput {
1682
- return {
1683
- outputId: output.outputId,
1684
- metadata: output.metadata,
1685
- outputs: output.items.map(fromNotebookOutputItemDto)
1686
- };
1687
- }
1688
-
1689
- export function fromNotebookCellDataDto(cell: rpc.NotebookCellDataDto): CellData {
1690
- return {
1691
- cellKind: cell.cellKind,
1692
- language: cell.language,
1693
- source: cell.source,
1694
- outputs: cell.outputs.map(fromNotebookOutputDto),
1695
- metadata: cell.metadata,
1696
- internalMetadata: cell.internalMetadata
1697
- };
1698
- }
1699
-
1700
- // export function fromNotebookDataDto(data: rpc.NotebookDataDto): NotebookData {
1701
- // return {
1702
- // metadata: data.metadata,
1703
- // cells: data.cells.map(fromNotebookCellDataDto)
1704
- // };
1705
- // }
1706
-
1707
- // export function toNotebookCellDto(cell: Cell): rpc.NotebookCellDto {
1708
- // return {
1709
- // handle: cell.handle,
1710
- // uri: cell.uri,
1711
- // source: cell.textBuffer.getLinesContent(),
1712
- // eol: cell.textBuffer.getEOL(),
1713
- // language: cell.language,
1714
- // cellKind: cell.cellKind,
1715
- // outputs: cell.outputs.map(toNotebookOutputDto),
1716
- // metadata: cell.metadata,
1717
- // internalMetadata: cell.internalMetadata,
1718
- // };
1719
- // }
1720
-
1721
- export function fromCellExecuteUpdateDto(data: rpc.CellExecuteUpdateDto): CellExecuteUpdate {
1722
- if (data.editType === CellExecutionUpdateType.Output) {
1723
- return {
1724
- editType: data.editType,
1725
- cellHandle: data.cellHandle,
1726
- append: data.append,
1727
- outputs: data.outputs.map(fromNotebookOutputDto)
1728
- };
1729
- } else if (data.editType === CellExecutionUpdateType.OutputItems) {
1730
- return {
1731
- editType: data.editType,
1732
- append: data.append,
1733
- outputId: data.outputId,
1734
- items: data.items.map(fromNotebookOutputItemDto)
1735
- };
1736
- } else {
1737
- return data;
1738
- }
1739
- }
1740
-
1741
- export function fromCellExecuteCompleteDto(data: rpc.CellExecutionCompleteDto): CellExecutionComplete {
1742
- return data;
1743
- }
1744
-
1745
- // export function fromCellEditOperationDto(edit: rpc.CellEditOperationDto): CellEditOperation {
1746
- // if (edit.editType === CellEditType.Replace) {
1747
- // return {
1748
- // editType: edit.editType,
1749
- // index: edit.index,
1750
- // count: edit.count,
1751
- // cells: edit.cells.map(fromNotebookCellDataDto)
1752
- // };
1753
- // } else {
1754
- // return edit;
1755
- // }
1756
- // }
1757
- }
1758
-
1759
1638
  export namespace TestMessage {
1760
1639
  export function from(message: theia.TestMessage | readonly theia.TestMessage[]): TestMessageDTO[] {
1761
1640
  if (isReadonlyArray(message)) {
@@ -1765,7 +1644,8 @@ export namespace TestMessage {
1765
1644
  location: fromLocation(message.location),
1766
1645
  message: fromMarkdown(message.message)!,
1767
1646
  expected: message.expectedOutput,
1768
- actual: message.actualOutput
1647
+ actual: message.actualOutput,
1648
+ contextValue: message.contextValue
1769
1649
  }];
1770
1650
  }
1771
1651
  }
@@ -3293,6 +3293,7 @@ export class TestMessage implements theia.TestMessage {
3293
3293
  public expectedOutput?: string;
3294
3294
  public actualOutput?: string;
3295
3295
  public location?: theia.Location;
3296
+ public contextValue?: string;
3296
3297
 
3297
3298
  public static diff(message: string | theia.MarkdownString, expected: string, actual: string): theia.TestMessage {
3298
3299
  const msg = new TestMessage(message);
@@ -19,7 +19,6 @@ import { WindowState } from '@theia/plugin';
19
19
  import { WindowStateExt, WindowMain, PLUGIN_RPC_CONTEXT } from '../common/plugin-api-rpc';
20
20
  import { Event, Emitter } from '@theia/core/lib/common/event';
21
21
  import { RPCProtocol } from '../common/rpc-protocol';
22
- import { Schemes } from '../common/uri-components';
23
22
 
24
23
  export class WindowStateExtImpl implements WindowStateExt {
25
24
 
@@ -50,6 +49,10 @@ export class WindowStateExtImpl implements WindowStateExt {
50
49
  }
51
50
 
52
51
  openUri(uri: URI): Promise<boolean> {
52
+ if (!uri.scheme.trim().length) {
53
+ throw new Error('Invalid scheme - cannot be empty');
54
+ }
55
+
53
56
  return this.proxy.$openUri(uri);
54
57
  }
55
58
 
@@ -57,9 +60,6 @@ export class WindowStateExtImpl implements WindowStateExt {
57
60
  if (!target.scheme.trim().length) {
58
61
  throw new Error('Invalid scheme - cannot be empty');
59
62
  }
60
- if (Schemes.http !== target.scheme && Schemes.https !== target.scheme) {
61
- throw new Error(`Invalid scheme '${target.scheme}'`);
62
- }
63
63
 
64
64
  const uri = await this.proxy.$asExternalUri(target);
65
65
  return URI.revive(uri);