@theia/plugin-ext 1.33.0-next.1 → 1.33.0-next.20

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 (135) hide show
  1. package/lib/common/index.js +2 -0
  2. package/lib/common/index.js.map +1 -1
  3. package/lib/common/plugin-api-rpc-model.d.ts +78 -0
  4. package/lib/common/plugin-api-rpc-model.d.ts.map +1 -1
  5. package/lib/common/plugin-api-rpc-model.js +17 -1
  6. package/lib/common/plugin-api-rpc-model.js.map +1 -1
  7. package/lib/common/plugin-api-rpc.d.ts +20 -7
  8. package/lib/common/plugin-api-rpc.d.ts.map +1 -1
  9. package/lib/common/plugin-api-rpc.js +0 -2
  10. package/lib/common/plugin-api-rpc.js.map +1 -1
  11. package/lib/common/plugin-protocol.d.ts +4 -4
  12. package/lib/common/plugin-protocol.d.ts.map +1 -1
  13. package/lib/common/proxy-handler.d.ts +66 -0
  14. package/lib/common/proxy-handler.d.ts.map +1 -0
  15. package/lib/common/proxy-handler.js +98 -0
  16. package/lib/common/proxy-handler.js.map +1 -0
  17. package/lib/common/reference-map.d.ts +8 -0
  18. package/lib/common/reference-map.d.ts.map +1 -0
  19. package/lib/common/reference-map.js +40 -0
  20. package/lib/common/reference-map.js.map +1 -0
  21. package/lib/common/rpc-protocol.d.ts +25 -51
  22. package/lib/common/rpc-protocol.d.ts.map +1 -1
  23. package/lib/common/rpc-protocol.js +126 -323
  24. package/lib/common/rpc-protocol.js.map +1 -1
  25. package/lib/hosted/browser/hosted-plugin-watcher.d.ts +1 -1
  26. package/lib/hosted/browser/hosted-plugin-watcher.d.ts.map +1 -1
  27. package/lib/hosted/browser/hosted-plugin-watcher.js.map +1 -1
  28. package/lib/hosted/browser/hosted-plugin.d.ts.map +1 -1
  29. package/lib/hosted/browser/hosted-plugin.js +13 -8
  30. package/lib/hosted/browser/hosted-plugin.js.map +1 -1
  31. package/lib/hosted/browser/plugin-worker.d.ts.map +1 -1
  32. package/lib/hosted/browser/plugin-worker.js +14 -9
  33. package/lib/hosted/browser/plugin-worker.js.map +1 -1
  34. package/lib/hosted/browser/worker/worker-main.d.ts +1 -1
  35. package/lib/hosted/browser/worker/worker-main.d.ts.map +1 -1
  36. package/lib/hosted/browser/worker/worker-main.js +23 -22
  37. package/lib/hosted/browser/worker/worker-main.js.map +1 -1
  38. package/lib/hosted/node/hosted-plugin-process.d.ts +5 -4
  39. package/lib/hosted/node/hosted-plugin-process.d.ts.map +1 -1
  40. package/lib/hosted/node/hosted-plugin-process.js +20 -13
  41. package/lib/hosted/node/hosted-plugin-process.js.map +1 -1
  42. package/lib/hosted/node/hosted-plugin-protocol.d.ts +22 -0
  43. package/lib/hosted/node/hosted-plugin-protocol.d.ts.map +1 -0
  44. package/lib/hosted/node/hosted-plugin-protocol.js +37 -0
  45. package/lib/hosted/node/hosted-plugin-protocol.js.map +1 -0
  46. package/lib/hosted/node/hosted-plugin.d.ts +1 -1
  47. package/lib/hosted/node/hosted-plugin.d.ts.map +1 -1
  48. package/lib/hosted/node/hosted-plugin.js.map +1 -1
  49. package/lib/hosted/node/plugin-host.d.ts +1 -1
  50. package/lib/hosted/node/plugin-host.d.ts.map +1 -1
  51. package/lib/hosted/node/plugin-host.js +10 -21
  52. package/lib/hosted/node/plugin-host.js.map +1 -1
  53. package/lib/hosted/node/plugin-service.d.ts +1 -1
  54. package/lib/hosted/node/plugin-service.d.ts.map +1 -1
  55. package/lib/hosted/node/plugin-service.js.map +1 -1
  56. package/lib/main/browser/file-system-main-impl.d.ts +1 -0
  57. package/lib/main/browser/file-system-main-impl.d.ts.map +1 -1
  58. package/lib/main/browser/file-system-main-impl.js +9 -2
  59. package/lib/main/browser/file-system-main-impl.js.map +1 -1
  60. package/lib/main/browser/languages-main.d.ts +1 -0
  61. package/lib/main/browser/languages-main.d.ts.map +1 -1
  62. package/lib/main/browser/languages-main.js +10 -0
  63. package/lib/main/browser/languages-main.js.map +1 -1
  64. package/lib/main/browser/main-context.d.ts.map +1 -1
  65. package/lib/main/browser/main-context.js +0 -3
  66. package/lib/main/browser/main-context.js.map +1 -1
  67. package/lib/main/browser/tasks-main.d.ts.map +1 -1
  68. package/lib/main/browser/tasks-main.js +13 -9
  69. package/lib/main/browser/tasks-main.js.map +1 -1
  70. package/lib/plugin/debug/debug-ext.d.ts +2 -1
  71. package/lib/plugin/debug/debug-ext.d.ts.map +1 -1
  72. package/lib/plugin/debug/debug-ext.js +10 -1
  73. package/lib/plugin/debug/debug-ext.js.map +1 -1
  74. package/lib/plugin/debug/plugin-debug-adapter-session.d.ts +6 -5
  75. package/lib/plugin/debug/plugin-debug-adapter-session.d.ts.map +1 -1
  76. package/lib/plugin/debug/plugin-debug-adapter-session.js +18 -4
  77. package/lib/plugin/debug/plugin-debug-adapter-session.js.map +1 -1
  78. package/lib/plugin/file-system-ext-impl.d.ts +2 -0
  79. package/lib/plugin/file-system-ext-impl.d.ts.map +1 -1
  80. package/lib/plugin/file-system-ext-impl.js +22 -5
  81. package/lib/plugin/file-system-ext-impl.js.map +1 -1
  82. package/lib/plugin/languages/inline-completion.d.ts +21 -0
  83. package/lib/plugin/languages/inline-completion.d.ts.map +1 -0
  84. package/lib/plugin/languages/inline-completion.js +94 -0
  85. package/lib/plugin/languages/inline-completion.js.map +1 -0
  86. package/lib/plugin/languages.d.ts +5 -2
  87. package/lib/plugin/languages.d.ts.map +1 -1
  88. package/lib/plugin/languages.js +16 -1
  89. package/lib/plugin/languages.js.map +1 -1
  90. package/lib/plugin/plugin-context.d.ts.map +1 -1
  91. package/lib/plugin/plugin-context.js +107 -3
  92. package/lib/plugin/plugin-context.js.map +1 -1
  93. package/lib/plugin/theming.d.ts.map +1 -1
  94. package/lib/plugin/theming.js +3 -0
  95. package/lib/plugin/theming.js.map +1 -1
  96. package/lib/plugin/type-converters.d.ts.map +1 -1
  97. package/lib/plugin/type-converters.js +6 -14
  98. package/lib/plugin/type-converters.js.map +1 -1
  99. package/lib/plugin/type-converters.spec.js +5 -4
  100. package/lib/plugin/type-converters.spec.js.map +1 -1
  101. package/lib/plugin/types-impl.d.ts +149 -9
  102. package/lib/plugin/types-impl.d.ts.map +1 -1
  103. package/lib/plugin/types-impl.js +205 -32
  104. package/lib/plugin/types-impl.js.map +1 -1
  105. package/package.json +25 -25
  106. package/src/common/index.ts +4 -0
  107. package/src/common/plugin-api-rpc-model.ts +96 -0
  108. package/src/common/plugin-api-rpc.ts +25 -7
  109. package/src/common/plugin-protocol.ts +4 -4
  110. package/src/common/proxy-handler.ts +126 -0
  111. package/src/common/reference-map.ts +38 -0
  112. package/src/common/rpc-protocol.ts +128 -401
  113. package/src/hosted/browser/hosted-plugin-watcher.ts +4 -3
  114. package/src/hosted/browser/hosted-plugin.ts +17 -8
  115. package/src/hosted/browser/plugin-worker.ts +16 -10
  116. package/src/hosted/browser/worker/worker-main.ts +25 -26
  117. package/src/hosted/node/hosted-plugin-process.ts +25 -16
  118. package/src/hosted/node/hosted-plugin-protocol.ts +49 -0
  119. package/src/hosted/node/hosted-plugin.ts +1 -1
  120. package/src/hosted/node/plugin-host.ts +11 -22
  121. package/src/hosted/node/plugin-service.ts +1 -1
  122. package/src/main/browser/file-system-main-impl.ts +12 -3
  123. package/src/main/browser/languages-main.ts +18 -1
  124. package/src/main/browser/main-context.ts +0 -4
  125. package/src/main/browser/tasks-main.ts +13 -9
  126. package/src/plugin/debug/debug-ext.ts +11 -2
  127. package/src/plugin/debug/plugin-debug-adapter-session.ts +17 -9
  128. package/src/plugin/file-system-ext-impl.ts +21 -5
  129. package/src/plugin/languages/inline-completion.ts +126 -0
  130. package/src/plugin/languages.ts +30 -3
  131. package/src/plugin/plugin-context.ts +142 -4
  132. package/src/plugin/theming.ts +3 -0
  133. package/src/plugin/type-converters.spec.ts +5 -4
  134. package/src/plugin/type-converters.ts +10 -12
  135. package/src/plugin/types-impl.ts +253 -27
@@ -30,22 +30,8 @@ import { startsWithIgnoreCase } from '@theia/core/lib/common/strings';
30
30
  import { SymbolKind } from '../common/plugin-api-rpc-model';
31
31
  import { FileSystemProviderErrorCode, markAsFileSystemProviderError } from '@theia/filesystem/lib/common/files';
32
32
  import * as paths from 'path';
33
- import { ObjectsTransferrer } from '../common/rpc-protocol';
34
33
  import { es5ClassCompat } from '../common/types';
35
34
 
36
- /**
37
- * A reviver that takes URI's transferred via JSON.stringify() and makes
38
- * instances of our local plugin API URI class (below)
39
- */
40
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
41
- export function reviver(key: string | undefined, value: any): any {
42
- const revived = ObjectsTransferrer.reviver(key, value);
43
- if (CodeURI.isUri(revived)) {
44
- return URI.revive(revived);
45
- }
46
- return revived;
47
- }
48
-
49
35
  /**
50
36
  * This is an implementation of #theia.Uri based on vscode-uri.
51
37
  * This is supposed to fix https://github.com/eclipse-theia/theia/issues/8752
@@ -148,6 +134,8 @@ export class Disposable {
148
134
  static create(func: () => void): Disposable {
149
135
  return new Disposable(func);
150
136
  }
137
+
138
+ static NULL: Disposable;
151
139
  }
152
140
 
153
141
  export interface AccessibilityInformation {
@@ -190,7 +178,8 @@ export enum ViewColumn {
190
178
  export enum ColorThemeKind {
191
179
  Light = 1,
192
180
  Dark = 2,
193
- HighContrast = 3
181
+ HighContrast = 3,
182
+ HighContrastLight = 4
194
183
  }
195
184
 
196
185
  export enum ExtensionMode {
@@ -992,6 +981,37 @@ export class CompletionList {
992
981
  }
993
982
  }
994
983
 
984
+ export enum InlineCompletionTriggerKind {
985
+ Invoke = 0,
986
+ Automatic = 1,
987
+ }
988
+
989
+ @es5ClassCompat
990
+ export class InlineCompletionItem implements theia.InlineCompletionItem {
991
+
992
+ filterText?: string;
993
+ insertText: string;
994
+ range?: Range;
995
+ command?: theia.Command;
996
+
997
+ constructor(insertText: string, range?: Range, command?: theia.Command) {
998
+ this.insertText = insertText;
999
+ this.range = range;
1000
+ this.command = command;
1001
+ }
1002
+ }
1003
+
1004
+ @es5ClassCompat
1005
+ export class InlineCompletionList implements theia.InlineCompletionList {
1006
+
1007
+ items: theia.InlineCompletionItem[];
1008
+ commands: theia.Command[] | undefined = undefined;
1009
+
1010
+ constructor(items: theia.InlineCompletionItem[]) {
1011
+ this.items = items;
1012
+ }
1013
+ }
1014
+
995
1015
  export enum DiagnosticSeverity {
996
1016
  Error = 0,
997
1017
  Warning = 1,
@@ -1079,6 +1099,218 @@ export enum MarkerTag {
1079
1099
  Deprecated = 2,
1080
1100
  }
1081
1101
 
1102
+ export enum NotebookCellKind {
1103
+ Markup = 1,
1104
+ Code = 2
1105
+ }
1106
+
1107
+ export enum NotebookCellStatusBarAlignment {
1108
+ Left = 1,
1109
+ Right = 2
1110
+ }
1111
+
1112
+ export enum NotebookControllerAffinity {
1113
+ Default = 1,
1114
+ Preferred = 2
1115
+ }
1116
+
1117
+ export enum NotebookEditorRevealType {
1118
+ Default = 0,
1119
+ InCenter = 1,
1120
+ InCenterIfOutsideViewport = 2,
1121
+ AtTop = 3
1122
+ }
1123
+ @es5ClassCompat
1124
+ export class NotebookCellData implements theia.NotebookCellData {
1125
+ languageId: string;
1126
+ kind: NotebookCellKind;
1127
+ value: string;
1128
+ outputs?: theia.NotebookCellOutput[];
1129
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1130
+ metadata?: { [key: string]: any };
1131
+ executionSummary?: theia.NotebookCellExecutionSummary;
1132
+
1133
+ constructor(kind: NotebookCellKind, value: string, languageId: string) {
1134
+ this.kind = kind;
1135
+ this.value = value;
1136
+ this.languageId = languageId;
1137
+ }
1138
+ }
1139
+
1140
+ @es5ClassCompat
1141
+ export class NotebookCellOutput implements theia.NotebookCellOutput {
1142
+ items: theia.NotebookCellOutputItem[];
1143
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1144
+ metadata?: { [key: string]: any };
1145
+
1146
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1147
+ constructor(items: theia.NotebookCellOutputItem[], metadata?: { [key: string]: any }) {
1148
+ this.items = items;
1149
+ this.metadata = metadata;
1150
+ }
1151
+ }
1152
+
1153
+ export class NotebookCellOutputItem implements theia.NotebookCellOutputItem {
1154
+ mime: string;
1155
+ data: Uint8Array;
1156
+
1157
+ static #encoder = new TextEncoder();
1158
+
1159
+ static text(value: string, mime?: string): NotebookCellOutputItem {
1160
+ const bytes = NotebookCellOutputItem.#encoder.encode(String(value));
1161
+ return new NotebookCellOutputItem(bytes, mime || 'text/plain');
1162
+ }
1163
+
1164
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1165
+ static json(value: any, mime?: string): NotebookCellOutputItem {
1166
+ const jsonStr = JSON.stringify(value, undefined, '\t');
1167
+ return NotebookCellOutputItem.text(jsonStr, mime);
1168
+ }
1169
+
1170
+ static stdout(value: string): NotebookCellOutputItem {
1171
+ return NotebookCellOutputItem.text(value, 'application/vnd.code.notebook.stdout');
1172
+ }
1173
+
1174
+ static stderr(value: string): NotebookCellOutputItem {
1175
+ return NotebookCellOutputItem.text(value, 'application/vnd.code.notebook.stderr');
1176
+ }
1177
+
1178
+ static error(value: Error): NotebookCellOutputItem {
1179
+ return NotebookCellOutputItem.json(value, 'application/vnd.code.notebook.error');
1180
+ }
1181
+
1182
+ constructor(data: Uint8Array, mime: string) {
1183
+ this.data = data;
1184
+ this.mime = mime;
1185
+ }
1186
+ }
1187
+
1188
+ @es5ClassCompat
1189
+ export class NotebookCellStatusBarItem implements theia.NotebookCellStatusBarItem {
1190
+ text: string;
1191
+ alignment: NotebookCellStatusBarAlignment;
1192
+ command?: string | theia.Command;
1193
+ tooltip?: string;
1194
+ priority?: number;
1195
+ accessibilityInformation?: AccessibilityInformation;
1196
+
1197
+ /**
1198
+ * Creates a new NotebookCellStatusBarItem.
1199
+ * @param text The text to show for the item.
1200
+ * @param alignment Whether the item is aligned to the left or right.
1201
+ * @stubbed
1202
+ */
1203
+ constructor(text: string, alignment: NotebookCellStatusBarAlignment) {
1204
+ this.text = text;
1205
+ this.alignment = alignment;
1206
+ }
1207
+ }
1208
+
1209
+ @es5ClassCompat
1210
+ export class NotebookData implements theia.NotebookData {
1211
+ cells: NotebookCellData[];
1212
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1213
+ metadata?: { [key: string]: any };
1214
+
1215
+ constructor(cells: NotebookCellData[]) {
1216
+ this.cells = cells;
1217
+ }
1218
+ }
1219
+
1220
+ export class NotebookDocument implements theia.NotebookDocument {
1221
+ readonly uri: theia.Uri;
1222
+ readonly notebookType: string;
1223
+ readonly version: number;
1224
+ readonly isDirty: boolean;
1225
+ readonly isUntitled: boolean;
1226
+ readonly isClosed: boolean;
1227
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1228
+ readonly metadata: { [key: string]: any };
1229
+ readonly cellCount: number;
1230
+
1231
+ cellAt(index: number): theia.NotebookCell {
1232
+ return {} as theia.NotebookCell;
1233
+ }
1234
+ save(): theia.Thenable<boolean> {
1235
+ return Promise.resolve(false);
1236
+ }
1237
+
1238
+ getCells(range?: theia.NotebookRange | undefined): theia.NotebookCell[] {
1239
+ return [] as NotebookCell[];
1240
+ }
1241
+ }
1242
+ export class NotebookCell implements theia.NotebookCell {
1243
+ readonly index: number;
1244
+ readonly notebook: theia.NotebookDocument;
1245
+ readonly kind: theia.NotebookCellKind;
1246
+ readonly document: theia.TextDocument;
1247
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1248
+ readonly metadata: { readonly [key: string]: any; };
1249
+ readonly outputs: readonly theia.NotebookCellOutput[];
1250
+ readonly executionSummary: theia.NotebookCellExecutionSummary | undefined;
1251
+
1252
+ }
1253
+
1254
+ export class NotebookRange implements theia.NotebookRange {
1255
+ readonly start: number;
1256
+ readonly end: number;
1257
+ readonly isEmpty: boolean;
1258
+
1259
+ with(change: { start?: number; end?: number }): NotebookRange {
1260
+ let newStart = this.start;
1261
+ let newEnd = this.end;
1262
+
1263
+ if (change.start !== undefined) {
1264
+ newStart = change.start;
1265
+ }
1266
+ if (change.end !== undefined) {
1267
+ newEnd = change.end;
1268
+ }
1269
+ if (newStart === this.start && newEnd === this.end) {
1270
+ return this;
1271
+ }
1272
+ return new NotebookRange(newStart, newEnd);
1273
+ }
1274
+
1275
+ constructor(start: number, end: number) {
1276
+ this.start = start;
1277
+ this.end = end;
1278
+ }
1279
+
1280
+ }
1281
+
1282
+ @es5ClassCompat
1283
+ export class NotebookEdit implements theia.NotebookEdit {
1284
+ range: theia.NotebookRange;
1285
+ newCells: theia.NotebookCellData[];
1286
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1287
+ newCellMetadata?: { [key: string]: any; } | undefined;
1288
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1289
+ newNotebookMetadata?: { [key: string]: any; } | undefined;
1290
+
1291
+ static replaceCells(range: NotebookRange, newCells: NotebookCellData[]): NotebookEdit {
1292
+ return new NotebookEdit();
1293
+ }
1294
+
1295
+ static insertCells(index: number, newCells: NotebookCellData[]): NotebookEdit {
1296
+ return new NotebookEdit();
1297
+ }
1298
+
1299
+ static deleteCells(range: NotebookRange): NotebookEdit {
1300
+ return new NotebookEdit();
1301
+ }
1302
+
1303
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1304
+ static updateCellMetadata(index: number, newCellMetadata: { [key: string]: any }): NotebookEdit {
1305
+ return new NotebookEdit();
1306
+ }
1307
+
1308
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1309
+ static updateNotebookMetadata(newNotebookMetadata: { [key: string]: any }): NotebookEdit {
1310
+ return new NotebookEdit();
1311
+ }
1312
+ }
1313
+
1082
1314
  @es5ClassCompat
1083
1315
  export class ParameterInformation {
1084
1316
  label: string | [number, number];
@@ -2008,7 +2240,6 @@ export class CustomExecution {
2008
2240
 
2009
2241
  @es5ClassCompat
2010
2242
  export class TaskGroup {
2011
- private groupId: string;
2012
2243
 
2013
2244
  public static Clean: TaskGroup = new TaskGroup('clean', 'Clean');
2014
2245
  public static Build: TaskGroup = new TaskGroup('build', 'Build');
@@ -2030,19 +2261,13 @@ export class TaskGroup {
2030
2261
  }
2031
2262
  }
2032
2263
 
2033
- constructor(id: string, label: string) {
2034
- if (typeof id !== 'string') {
2035
- throw illegalArgument('id');
2036
- }
2037
- if (typeof label !== 'string') {
2038
- throw illegalArgument('name');
2039
- }
2040
- this.groupId = id;
2264
+ constructor(id: 'clean' | 'build' | 'rebuild' | 'test', label: string);
2265
+ constructor(id: 'clean' | 'build' | 'rebuild' | 'test', label: string, isDefault?: boolean | undefined);
2266
+ constructor(readonly id: 'clean' | 'build' | 'rebuild' | 'test', label: string, isDefault?: boolean | undefined) {
2267
+ this.isDefault = !!isDefault;
2041
2268
  }
2042
2269
 
2043
- get id(): string {
2044
- return this.groupId;
2045
- }
2270
+ readonly isDefault: boolean;
2046
2271
  }
2047
2272
 
2048
2273
  export enum TaskScope {
@@ -2127,6 +2352,7 @@ export class Task {
2127
2352
  }
2128
2353
  this.isTaskBackground = false;
2129
2354
  this.presentationOptions = Object.create(null);
2355
+ this.taskRunOptions = Object.create(null);
2130
2356
  }
2131
2357
 
2132
2358
  get definition(): theia.TaskDefinition {