@theia/core 1.70.0 → 1.70.2

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 (37) hide show
  1. package/README.md +7 -7
  2. package/i18n/nls.cs.json +4 -4
  3. package/i18n/nls.de.json +4 -4
  4. package/i18n/nls.es.json +4 -4
  5. package/i18n/nls.fr.json +4 -4
  6. package/i18n/nls.hu.json +4 -4
  7. package/i18n/nls.it.json +4 -4
  8. package/i18n/nls.ja.json +4 -4
  9. package/i18n/nls.ko.json +4 -4
  10. package/i18n/nls.pl.json +4 -4
  11. package/i18n/nls.pt-br.json +4 -4
  12. package/i18n/nls.ru.json +4 -4
  13. package/i18n/nls.tr.json +4 -4
  14. package/i18n/nls.zh-cn.json +4 -4
  15. package/i18n/nls.zh-tw.json +4 -4
  16. package/lib/browser/catalog.json +84 -19
  17. package/lib/common/resource.d.ts +2 -0
  18. package/lib/common/resource.d.ts.map +1 -1
  19. package/lib/common/resource.js +7 -3
  20. package/lib/common/resource.js.map +1 -1
  21. package/lib/electron-browser/menu/electron-main-menu-factory.d.ts.map +1 -1
  22. package/lib/electron-browser/menu/electron-main-menu-factory.js +5 -1
  23. package/lib/electron-browser/menu/electron-main-menu-factory.js.map +1 -1
  24. package/lib/electron-main/electron-api-main.js +2 -2
  25. package/lib/electron-main/electron-api-main.js.map +1 -1
  26. package/lib/electron-main/theia-electron-window.d.ts.map +1 -1
  27. package/lib/electron-main/theia-electron-window.js +3 -0
  28. package/lib/electron-main/theia-electron-window.js.map +1 -1
  29. package/lib/node/process-utils.d.ts.map +1 -1
  30. package/lib/node/process-utils.js +9 -1
  31. package/lib/node/process-utils.js.map +1 -1
  32. package/package.json +6 -6
  33. package/src/common/resource.ts +8 -2
  34. package/src/electron-browser/menu/electron-main-menu-factory.ts +5 -1
  35. package/src/electron-main/electron-api-main.ts +2 -2
  36. package/src/electron-main/theia-electron-window.ts +3 -0
  37. package/src/node/process-utils.ts +9 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theia/core",
3
- "version": "1.70.0",
3
+ "version": "1.70.2",
4
4
  "description": "Theia is a cloud & desktop IDE framework implemented in TypeScript.",
5
5
  "main": "lib/common/index.js",
6
6
  "typings": "lib/common/index.d.ts",
@@ -17,8 +17,8 @@
17
17
  "@lumino/virtualdom": "^2.0.4",
18
18
  "@lumino/widgets": "2.7.5",
19
19
  "@parcel/watcher": "^2.5.0",
20
- "@theia/application-package": "1.70.0",
21
- "@theia/request": "1.70.0",
20
+ "@theia/application-package": "1.70.2",
21
+ "@theia/request": "1.70.2",
22
22
  "@types/body-parser": "^1.16.4",
23
23
  "@types/express": "^4.17.21",
24
24
  "@types/fs-extra": "^4.0.2",
@@ -213,13 +213,13 @@
213
213
  "watch": "theiaext watch"
214
214
  },
215
215
  "devDependencies": {
216
- "@theia/ext-scripts": "1.70.0",
217
- "@theia/re-exports": "1.70.0",
216
+ "@theia/ext-scripts": "1.70.2",
217
+ "@theia/re-exports": "1.70.2",
218
218
  "minimist": "^1.2.0",
219
219
  "nodejs-file-downloader": "4.13.0"
220
220
  },
221
221
  "nyc": {
222
222
  "extends": "../../configs/nyc.json"
223
223
  },
224
- "gitHead": "d2e3d1ecaa9b1df7992eeaa1ad4584f436a83e67"
224
+ "gitHead": "083802498e3c7c969e0afa9c763548c4fc9f5ac0"
225
225
  }
@@ -311,13 +311,19 @@ export class InMemoryResources implements ResourceResolver {
311
311
  }
312
312
 
313
313
  export const MEMORY_TEXT = 'mem-txt';
314
+ export const MEMORY_TEXT_READONLY = 'mem-txt-readonly';
314
315
 
315
316
  /**
316
317
  * Resource implementation for 'mem-txt' URI scheme where content is saved in URI query.
317
318
  */
318
319
  export class InMemoryTextResource implements Resource {
320
+
319
321
  constructor(readonly uri: URI) { }
320
322
 
323
+ get readOnly(): boolean {
324
+ return this.uri.scheme === MEMORY_TEXT_READONLY;
325
+ }
326
+
321
327
  async readContents(options?: { encoding?: string | undefined; } | undefined): Promise<string> {
322
328
  return this.uri.query;
323
329
  }
@@ -330,8 +336,8 @@ export class InMemoryTextResource implements Resource {
330
336
  @injectable()
331
337
  export class InMemoryTextResourceResolver implements ResourceResolver {
332
338
  resolve(uri: URI): MaybePromise<Resource> {
333
- if (uri.scheme !== MEMORY_TEXT) {
334
- throw new Error(`Expected a URI with ${MEMORY_TEXT} scheme. Was: ${uri}.`);
339
+ if (uri.scheme !== MEMORY_TEXT && uri.scheme !== MEMORY_TEXT_READONLY) {
340
+ throw new Error(`Expected a URI with ${MEMORY_TEXT} or ${MEMORY_TEXT_READONLY} scheme. Was: ${uri}.`);
335
341
  }
336
342
  return new InMemoryTextResource(uri);
337
343
  }
@@ -233,7 +233,11 @@ export class ElectronMainMenuFactory extends BrowserMainMenuFactory {
233
233
  }
234
234
  };
235
235
 
236
- const role = this.roleFor(menu.id);
236
+ // Only assign Electron roles when no custom args are present.
237
+ // Custom args indicate that command handlers have context-dependent
238
+ // behavior (e.g. chat view copying the whole message when there is
239
+ // no DOM selection) that would be bypassed by the native role.
240
+ const role = args.length === 0 ? this.roleFor(menu.id) : undefined;
237
241
  if (role) {
238
242
  menuItem.role = role;
239
243
  delete menuItem.execute;
@@ -343,13 +343,13 @@ export namespace TheiaRendererAPI {
343
343
  const disposables = new DisposableCollection();
344
344
 
345
345
  return new Promise<boolean>(resolve => {
346
- wc.send(CHANNEL_REQUEST_CLOSE, stopReason, confirmChannel, cancelChannel);
347
346
  createDisposableListener(ipcMain, confirmChannel, e => {
348
347
  resolve(true);
349
348
  }, disposables);
350
349
  createDisposableListener(ipcMain, cancelChannel, e => {
351
350
  resolve(false);
352
351
  }, disposables);
352
+ wc.send(CHANNEL_REQUEST_CLOSE, stopReason, confirmChannel, cancelChannel);
353
353
  }).finally(() => disposables.dispose());
354
354
  }
355
355
 
@@ -360,13 +360,13 @@ export namespace TheiaRendererAPI {
360
360
  const disposables = new DisposableCollection();
361
361
 
362
362
  return new Promise<boolean>(resolve => {
363
- mainWindow.send(CHANNEL_REQUEST_SECONDARY_CLOSE, secondaryWindow.mainFrame.name, confirmChannel, cancelChannel);
364
363
  createDisposableListener(ipcMain, confirmChannel, e => {
365
364
  resolve(true);
366
365
  }, disposables);
367
366
  createDisposableListener(ipcMain, cancelChannel, e => {
368
367
  resolve(false);
369
368
  }, disposables);
369
+ mainWindow.send(CHANNEL_REQUEST_SECONDARY_CLOSE, secondaryWindow.mainFrame.name, confirmChannel, cancelChannel);
370
370
  }).finally(() => disposables.dispose());
371
371
  }
372
372
 
@@ -140,6 +140,9 @@ export class TheiaElectronWindow {
140
140
 
141
141
  protected async doCloseWindow(): Promise<void> {
142
142
  this.closeIsConfirmed = true;
143
+ // Hide the window immediately so the user perceives an instant close.
144
+ // This is done after veto checks have passed to ensure save dialogs remain visible.
145
+ this._window.hide();
143
146
  await TheiaRendererAPI.sendAboutToClose(this._window.webContents);
144
147
  this._window.close();
145
148
  }
@@ -32,7 +32,15 @@ export class ProcessUtils {
32
32
  }
33
33
 
34
34
  protected winTerminateProcessTree(ppid: number): void {
35
- this.spawnSync('taskkill.exe', ['/f', '/t', '/pid', ppid.toString(10)]);
35
+ const result = cp.spawnSync('taskkill.exe', ['/f', '/t', '/pid', ppid.toString(10)], { encoding: 'utf8' });
36
+ if (result.error) {
37
+ throw result.error;
38
+ }
39
+ // taskkill may exit with a non-zero code when some child processes have already exited.
40
+ // This is expected during shutdown — log but don't throw.
41
+ if (result.status !== 0) {
42
+ console.warn(`taskkill.exe exited with ${result.status} for PID ${ppid}. Output:\n${JSON.stringify(result.output)}`);
43
+ }
36
44
  }
37
45
 
38
46
  protected unixTerminateProcessTree(ppid: number): void {