@theia/core 1.57.0 → 1.58.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 (99) hide show
  1. package/README.md +7 -7
  2. package/i18n/nls.cs.json +23 -11
  3. package/i18n/nls.de.json +23 -11
  4. package/i18n/nls.es.json +23 -11
  5. package/i18n/nls.fr.json +23 -11
  6. package/i18n/nls.hu.json +23 -11
  7. package/i18n/nls.it.json +23 -11
  8. package/i18n/nls.ja.json +23 -11
  9. package/i18n/nls.json +24 -12
  10. package/i18n/nls.ko.json +23 -11
  11. package/i18n/nls.pl.json +23 -11
  12. package/i18n/nls.pt-br.json +23 -11
  13. package/i18n/nls.ru.json +23 -11
  14. package/i18n/nls.tr.json +23 -11
  15. package/i18n/nls.zh-cn.json +23 -11
  16. package/i18n/nls.zh-tw.json +23 -11
  17. package/lib/browser/catalog.json +267 -39
  18. package/lib/browser/common-frontend-contribution.d.ts +1 -1
  19. package/lib/browser/common-frontend-contribution.d.ts.map +1 -1
  20. package/lib/browser/common-frontend-contribution.js +16 -7
  21. package/lib/browser/common-frontend-contribution.js.map +1 -1
  22. package/lib/browser/dialogs.d.ts +1 -0
  23. package/lib/browser/dialogs.d.ts.map +1 -1
  24. package/lib/browser/dialogs.js +6 -0
  25. package/lib/browser/dialogs.js.map +1 -1
  26. package/lib/browser/frontend-application-module.d.ts.map +1 -1
  27. package/lib/browser/frontend-application-module.js +1 -0
  28. package/lib/browser/frontend-application-module.js.map +1 -1
  29. package/lib/browser/json-schema-store.d.ts +12 -1
  30. package/lib/browser/json-schema-store.d.ts.map +1 -1
  31. package/lib/browser/json-schema-store.js +31 -1
  32. package/lib/browser/json-schema-store.js.map +1 -1
  33. package/lib/browser/keybinding.js +3 -3
  34. package/lib/browser/keybinding.js.map +1 -1
  35. package/lib/browser/saveable.d.ts +1 -0
  36. package/lib/browser/saveable.d.ts.map +1 -1
  37. package/lib/browser/saveable.js +3 -0
  38. package/lib/browser/saveable.js.map +1 -1
  39. package/lib/browser/secondary-window-handler.d.ts.map +1 -1
  40. package/lib/browser/secondary-window-handler.js +1 -0
  41. package/lib/browser/secondary-window-handler.js.map +1 -1
  42. package/lib/browser/shell/application-shell.d.ts +2 -1
  43. package/lib/browser/shell/application-shell.d.ts.map +1 -1
  44. package/lib/browser/shell/application-shell.js +24 -10
  45. package/lib/browser/shell/application-shell.js.map +1 -1
  46. package/lib/browser/test/jsdom.d.ts.map +1 -1
  47. package/lib/browser/test/jsdom.js +6 -1
  48. package/lib/browser/test/jsdom.js.map +1 -1
  49. package/lib/browser/tree/tree-widget.d.ts +6 -2
  50. package/lib/browser/tree/tree-widget.d.ts.map +1 -1
  51. package/lib/browser/tree/tree-widget.js +4 -4
  52. package/lib/browser/tree/tree-widget.js.map +1 -1
  53. package/lib/browser/window/browser-window-module.d.ts.map +1 -1
  54. package/lib/browser/window/browser-window-module.js +3 -0
  55. package/lib/browser/window/browser-window-module.js.map +1 -1
  56. package/lib/browser/window/default-secondary-window-service.d.ts +5 -0
  57. package/lib/browser/window/default-secondary-window-service.d.ts.map +1 -1
  58. package/lib/browser/window/default-secondary-window-service.js +6 -0
  59. package/lib/browser/window/default-secondary-window-service.js.map +1 -1
  60. package/lib/browser/window/secondary-window-service.d.ts +3 -0
  61. package/lib/browser/window/secondary-window-service.d.ts.map +1 -1
  62. package/lib/browser/window/secondary-window-service.js.map +1 -1
  63. package/lib/browser/window/window-title-service.d.ts +6 -0
  64. package/lib/browser/window/window-title-service.d.ts.map +1 -1
  65. package/lib/browser/window/window-title-service.js +12 -1
  66. package/lib/browser/window/window-title-service.js.map +1 -1
  67. package/lib/common/encoding-service.d.ts +1 -0
  68. package/lib/common/encoding-service.d.ts.map +1 -1
  69. package/lib/common/resource.d.ts +2 -0
  70. package/lib/common/resource.d.ts.map +1 -1
  71. package/lib/common/resource.js +1 -0
  72. package/lib/common/resource.js.map +1 -1
  73. package/lib/electron-browser/window/electron-window-module.d.ts.map +1 -1
  74. package/lib/electron-browser/window/electron-window-module.js +3 -0
  75. package/lib/electron-browser/window/electron-window-module.js.map +1 -1
  76. package/lib/node/messaging/test/test-web-socket-channel.d.ts.map +1 -1
  77. package/lib/node/messaging/test/test-web-socket-channel.js +7 -1
  78. package/lib/node/messaging/test/test-web-socket-channel.js.map +1 -1
  79. package/lib/node/messaging/websocket-endpoint.d.ts +1 -1
  80. package/lib/node/messaging/websocket-endpoint.d.ts.map +1 -1
  81. package/package.json +11 -11
  82. package/src/browser/common-frontend-contribution.ts +16 -7
  83. package/src/browser/dialogs.ts +7 -0
  84. package/src/browser/frontend-application-module.ts +2 -1
  85. package/src/browser/json-schema-store.ts +35 -1
  86. package/src/browser/keybinding.ts +3 -3
  87. package/src/browser/saveable.ts +3 -0
  88. package/src/browser/secondary-window-handler.ts +1 -0
  89. package/src/browser/shell/application-shell.ts +27 -11
  90. package/src/browser/style/dockpanel.css +10 -0
  91. package/src/browser/test/jsdom.ts +6 -1
  92. package/src/browser/tree/tree-widget.tsx +10 -4
  93. package/src/browser/window/browser-window-module.ts +3 -0
  94. package/src/browser/window/default-secondary-window-service.ts +7 -1
  95. package/src/browser/window/secondary-window-service.ts +3 -0
  96. package/src/browser/window/window-title-service.ts +14 -1
  97. package/src/common/resource.ts +4 -0
  98. package/src/electron-browser/window/electron-window-module.ts +3 -0
  99. package/src/node/messaging/test/test-web-socket-channel.ts +6 -1
@@ -1 +1 @@
1
- {"version":3,"file":"test-web-socket-channel.js","sourceRoot":"","sources":["../../../../src/node/messaging/test/test-web-socket-channel.ts"],"names":[],"mappings":";AAAA,gDAAgD;AAChD,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;AAKhF,4CAA+C;AAC/C,0FAA4F;AAC5F,yCAA8C;AAC9C,wGAA6H;AAC7H,oGAA+F;AAC/F,uDAA8C;AAE9C,MAAM,YAAY,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAC;AAChD,MAAM,6BAA8B,SAAQ,gDAAyB;IAI9C,kBAAkB,CAAC,IAAY;QAC9C,OAAO,IAAI,CAAC,YAAY,CAAC;IAC7B,CAAC;IAEkB,eAAe,CAAC,GAAW;QAC1C,OAAO,IAAA,qBAAE,EAAC,GAAG,CAAC,CAAC;IACnB,CAAC;CACJ;AATY;IADR,IAAA,kBAAM,EAAC,YAAY,CAAC;;mEACS;AAWlC,MAAa,yBAAyB;IAGlC,YAAY,EAAE,MAAM,EAAE,IAAI,EAGzB;QACG,MAAM,OAAO,GAAI,MAAM,CAAC,OAAO,EAAkB,CAAC;QAClD,MAAM,GAAG,GAAG,QAAQ,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,IAAI,GAAG,qBAAY,EAAE,CAAC;QACrE,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC,wBAAwB,CAAC,GAAG,CAAC,CAAC;IACjE,CAAC;IAES,wBAAwB,CAAC,SAAiB;QAChD,MAAM,SAAS,GAAG,IAAI,qBAAS,EAAE,CAAC;QAClC,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;QACxD,SAAS,CAAC,IAAI,CAAC,mDAAuB,CAAC,CAAC;QACxC,SAAS,CAAC,MAAM,CAAC,gDAAyB,CAAC,CAAC,EAAE,CAAC,6BAA6B,CAAC,CAAC;QAC9E,OAAO,SAAS,CAAC,GAAG,CAAC,sDAAwB,CAAC,CAAC;IACnD,CAAC;CACJ;AAnBD,8DAmBC"}
1
+ {"version":3,"file":"test-web-socket-channel.js","sourceRoot":"","sources":["../../../../src/node/messaging/test/test-web-socket-channel.ts"],"names":[],"mappings":";AAAA,gDAAgD;AAChD,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mE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AAC,IAAI,CAAC,mDAAuB,CAAC,CAAC;QACxC,SAAS,CAAC,MAAM,CAAC,gDAAyB,CAAC,CAAC,EAAE,CAAC,6BAA6B,CAAC,CAAC;QAC9E,OAAO,SAAS,CAAC,GAAG,CAAC,sDAAwB,CAAC,CAAC;IACnD,CAAC;CACJ;AAxBD,8DAwBC"}
@@ -13,7 +13,7 @@ export declare class WebsocketEndpoint implements BackendApplicationContribution
13
13
  protected readonly messagingListener: MessagingListener;
14
14
  protected checkAliveTimeout: number;
15
15
  protected maxHttpBufferSize: number;
16
- protected readonly wsHandlers: ConnectionHandlers<Socket<import("socket.io/dist/typed-events").DefaultEventsMap, import("socket.io/dist/typed-events").DefaultEventsMap, import("socket.io/dist/typed-events").DefaultEventsMap, any>>;
16
+ protected readonly wsHandlers: ConnectionHandlers<Socket<import("socket.io").DefaultEventsMap, import("socket.io").DefaultEventsMap, import("socket.io").DefaultEventsMap, any>>;
17
17
  registerConnectionHandler(spec: string, callback: (params: MessagingService.PathParams, socket: Socket) => void): void;
18
18
  onStart(server: http.Server | https.Server): void;
19
19
  protected allowConnect(request: http.IncomingMessage): Promise<boolean>;
@@ -1 +1 @@
1
- {"version":3,"file":"websocket-endpoint.d.ts","sourceRoot":"","sources":["../../../src/node/messaging/websocket-endpoint.ts"],"names":[],"mappings":";;AAeA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAU,MAAM,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC;AAExE,qBACa,i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CAAC;IAG1D,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAExD,SAAS,CAAC,iBAAiB,SAAS;IACpC,SAAS,CAAC,iBAAiB,SAAO;IAElC,SAAS,CAAC,QAAQ,CAAC,UAAU,oJAAoC;IAEjE,yBAAyB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,MAAM,EAAE,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI;IAItH,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,GAAG,IAAI;cAqBjC,YAAY,CAAC,OAAO,EAAE,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC;cAQ7D,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAMlE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theia/core",
3
- "version": "1.57.0",
3
+ "version": "1.58.0",
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
  "@phosphor/signaling": "1",
18
18
  "@phosphor/virtualdom": "1",
19
19
  "@phosphor/widgets": "1",
20
- "@theia/application-package": "1.57.0",
21
- "@theia/request": "1.57.0",
20
+ "@theia/application-package": "1.58.0",
21
+ "@theia/request": "1.58.0",
22
22
  "@types/body-parser": "^1.16.4",
23
23
  "@types/cookie": "^0.3.3",
24
24
  "@types/dompurify": "^2.2.2",
@@ -40,7 +40,7 @@
40
40
  "body-parser": "^1.17.2",
41
41
  "cookie": "^0.4.0",
42
42
  "dompurify": "^2.2.9",
43
- "drivelist": "^9.0.2",
43
+ "drivelist": "^12.0.2",
44
44
  "es6-promise": "^4.2.4",
45
45
  "express": "^4.21.0",
46
46
  "fast-json-stable-stringify": "^2.1.0",
@@ -53,7 +53,7 @@
53
53
  "iconv-lite": "^0.6.0",
54
54
  "inversify": "^6.1.3",
55
55
  "jschardet": "^2.1.1",
56
- "keytar": "7.2.0",
56
+ "keytar": "7.9.0",
57
57
  "lodash.debounce": "^4.0.8",
58
58
  "lodash.throttle": "^4.1.1",
59
59
  "markdown-it": "^12.3.2",
@@ -64,7 +64,7 @@
64
64
  "react-dom": "^18.2.0",
65
65
  "react-tooltip": "^4.2.21",
66
66
  "react-virtuoso": "^2.17.0",
67
- "reflect-metadata": "^0.1.10",
67
+ "reflect-metadata": "^0.2.2",
68
68
  "route-parser": "^0.0.5",
69
69
  "safer-buffer": "^2.1.2",
70
70
  "socket.io": "^4.5.3",
@@ -201,22 +201,22 @@
201
201
  "clean": "theiaext clean",
202
202
  "compile": "theiaext compile",
203
203
  "generate-layout": "electron ./scripts/generate-layout",
204
+ "afterInstall": "npm run generate-theia-re-exports && npm run download:json-schema",
204
205
  "generate-theia-re-exports": "theia-re-exports generate && theia-re-exports template README_TEMPLATE.md > README.md",
205
206
  "lint": "theiaext lint",
206
- "prepare": "yarn -s generate-theia-re-exports && yarn download:json-schema",
207
207
  "download:json-schema": "node ./scripts/download-catalog.js",
208
208
  "test": "theiaext test",
209
- "version": "yarn -s generate-theia-re-exports",
209
+ "version": "npm run -s generate-theia-re-exports",
210
210
  "watch": "theiaext watch"
211
211
  },
212
212
  "devDependencies": {
213
- "@theia/ext-scripts": "1.57.0",
214
- "@theia/re-exports": "1.57.0",
213
+ "@theia/ext-scripts": "1.58.0",
214
+ "@theia/re-exports": "1.58.0",
215
215
  "minimist": "^1.2.0",
216
216
  "nodejs-file-downloader": "4.13.0"
217
217
  },
218
218
  "nyc": {
219
219
  "extends": "../../configs/nyc.json"
220
220
  },
221
- "gitHead": "ca1d948d897b9a774f8cd68bb76bd2f335609cd4"
221
+ "gitHead": "6594f32b9727aea20d88934bf386dee06d08fa5e"
222
222
  }
@@ -68,6 +68,7 @@ import { UNTITLED_SCHEME, UntitledResourceResolver } from '../common';
68
68
  import { LanguageQuickPickService } from './i18n/language-quick-pick-service';
69
69
  import { SidebarMenu } from './shell/sidebar-menu-widget';
70
70
  import { UndoRedoHandlerService } from './undo-redo-handler';
71
+ import { timeout } from '../common/promise-util';
71
72
 
72
73
  export namespace CommonMenus {
73
74
 
@@ -291,13 +292,16 @@ export namespace CommonCommands {
291
292
  id: 'workbench.action.files.newFile',
292
293
  category: FILE_CATEGORY
293
294
  });
295
+ // This command immediately opens a new untitled text file
296
+ // Some VS Code extensions use this command to create new files
294
297
  export const NEW_UNTITLED_TEXT_FILE = Command.toDefaultLocalizedCommand({
295
- id: 'workbench.action.files.newUntitledTextFile',
298
+ id: 'workbench.action.files.newUntitledFile',
296
299
  category: FILE_CATEGORY,
297
300
  label: 'New Untitled Text File'
298
301
  });
299
- export const NEW_UNTITLED_FILE = Command.toDefaultLocalizedCommand({
300
- id: 'workbench.action.files.newUntitledFile',
302
+ // This command opens a quick pick to select a file type to create
303
+ export const PICK_NEW_FILE = Command.toDefaultLocalizedCommand({
304
+ id: 'workbench.action.files.pickNewFile',
301
305
  category: CREATE_CATEGORY,
302
306
  label: 'New File...'
303
307
  });
@@ -766,7 +770,7 @@ export class CommonFrontendContribution implements FrontendApplicationContributi
766
770
  });
767
771
 
768
772
  registry.registerMenuAction(CommonMenus.FILE_NEW_TEXT, {
769
- commandId: CommonCommands.NEW_UNTITLED_FILE.id,
773
+ commandId: CommonCommands.PICK_NEW_FILE.id,
770
774
  label: nls.localizeByDefault('New File...'),
771
775
  order: 'a1'
772
776
  });
@@ -1027,10 +1031,15 @@ export class CommonFrontendContribution implements FrontendApplicationContributi
1027
1031
  execute: async () => {
1028
1032
  const untitledUri = this.untitledResourceResolver.createUntitledURI('', await this.workingDirProvider.getUserWorkingDir());
1029
1033
  this.untitledResourceResolver.resolve(untitledUri);
1030
- return open(this.openerService, untitledUri);
1034
+ const editor = await open(this.openerService, untitledUri);
1035
+ // Wait for all of the listeners of the `onDidOpen` event to be notified
1036
+ await timeout(50);
1037
+ // Afterwards, we can return from the command with the newly created editor
1038
+ // If we don't wait, we return from the command before the plugin API has been notified of the new editor
1039
+ return editor;
1031
1040
  }
1032
1041
  });
1033
- commandRegistry.registerCommand(CommonCommands.NEW_UNTITLED_FILE, {
1042
+ commandRegistry.registerCommand(CommonCommands.PICK_NEW_FILE, {
1034
1043
  execute: async () => this.showNewFilePicker()
1035
1044
  });
1036
1045
 
@@ -1187,7 +1196,7 @@ export class CommonFrontendContribution implements FrontendApplicationContributi
1187
1196
  keybinding: this.isElectron() ? 'ctrlcmd+n' : 'alt+n',
1188
1197
  },
1189
1198
  {
1190
- command: CommonCommands.NEW_UNTITLED_FILE.id,
1199
+ command: CommonCommands.PICK_NEW_FILE.id,
1191
1200
  keybinding: 'ctrlcmd+alt+n'
1192
1201
  }
1193
1202
  );
@@ -236,10 +236,17 @@ export abstract class AbstractDialog<T> extends BaseWidget {
236
236
  this.addAcceptAction(this.acceptButton, 'click');
237
237
  }
238
238
  this.addCloseAction(this.closeCrossNode, 'click');
239
+ this.toDisposeOnDetach.push(this.preventTabbingOutsideDialog());
239
240
  // TODO: use DI always to create dialog instances
240
241
  this.toDisposeOnDetach.push(DialogOverlayService.get().push(this));
241
242
  }
242
243
 
244
+ protected preventTabbingOutsideDialog(): Disposable {
245
+ const nonInertSiblings = Array.from(this.node.ownerDocument.body.children).filter(child => child !== this.node && !(child.hasAttribute('inert')));
246
+ nonInertSiblings.forEach(child => child.setAttribute('inert', ''));
247
+ return Disposable.create(() => nonInertSiblings.forEach(child => child.removeAttribute('inert')));
248
+ }
249
+
243
250
  protected handleEscape(event: KeyboardEvent): boolean | void {
244
251
  this.close();
245
252
  }
@@ -65,7 +65,7 @@ import { WebSocketConnectionProvider } from './messaging';
65
65
  import { AboutDialog, AboutDialogProps } from './about-dialog';
66
66
  import { EnvVariablesServer, envVariablesPath, EnvVariable } from './../common/env-variables';
67
67
  import { FrontendApplicationStateService } from './frontend-application-state';
68
- import { JsonSchemaStore, JsonSchemaContribution, DefaultJsonSchemaContribution } from './json-schema-store';
68
+ import { JsonSchemaStore, JsonSchemaContribution, DefaultJsonSchemaContribution, JsonSchemaDataStore } from './json-schema-store';
69
69
  import { TabBarToolbarRegistry, TabBarToolbarContribution, TabBarToolbarFactory, TabBarToolbar } from './shell/tab-bar-toolbar';
70
70
  import { bindCorePreferences, CorePreferences } from './core-preferences';
71
71
  import { ContextKeyService, ContextKeyServiceDummyImpl } from './context-key-service';
@@ -342,6 +342,7 @@ export const frontendApplicationModule = new ContainerModule((bind, _unbind, _is
342
342
  bindContributionProvider(bind, JsonSchemaContribution);
343
343
  bind(JsonSchemaStore).toSelf().inSingletonScope();
344
344
  bind(FrontendApplicationContribution).toService(JsonSchemaStore);
345
+ bind(JsonSchemaDataStore).toSelf().inSingletonScope();
345
346
  bind(DefaultJsonSchemaContribution).toSelf().inSingletonScope();
346
347
  bind(JsonSchemaContribution).toService(DefaultJsonSchemaContribution);
347
348
 
@@ -17,8 +17,9 @@
17
17
  import { injectable, inject, named } from 'inversify';
18
18
  import { ContributionProvider } from '../common/contribution-provider';
19
19
  import { FrontendApplicationContribution } from './frontend-application-contribution';
20
- import { MaybePromise } from '../common';
20
+ import { Emitter, MaybePromise, URI } from '../common';
21
21
  import { timeout, Deferred } from '../common/promise-util';
22
+ import { IJSONSchema } from '../common/json-schema';
22
23
 
23
24
  export interface JsonSchemaConfiguration {
24
25
  fileMatch: string | string[];
@@ -91,6 +92,39 @@ export class JsonSchemaStore implements FrontendApplicationContribution {
91
92
 
92
93
  }
93
94
 
95
+ @injectable()
96
+ export class JsonSchemaDataStore {
97
+
98
+ protected readonly _schemas = new Map<string, string>();
99
+
100
+ protected readonly onDidSchemaUpdateEmitter = new Emitter<URI>();
101
+ readonly onDidSchemaUpdate = this.onDidSchemaUpdateEmitter.event;
102
+
103
+ hasSchema(uri: URI): boolean {
104
+ return this._schemas.has(uri.toString());
105
+ }
106
+
107
+ getSchema(uri: URI): string | undefined {
108
+ return this._schemas.get(uri.toString());
109
+ }
110
+
111
+ setSchema(uri: URI, schema: IJSONSchema | string): void {
112
+ this._schemas.set(uri.toString(), typeof schema === 'string' ? schema : JSON.stringify(schema));
113
+ this.notifySchemaUpdate(uri);
114
+ }
115
+
116
+ deleteSchema(uri: URI): void {
117
+ if (this._schemas.delete(uri.toString())) {
118
+ this.notifySchemaUpdate(uri);
119
+ }
120
+ }
121
+
122
+ notifySchemaUpdate(uri: URI): void {
123
+ this.onDidSchemaUpdateEmitter.fire(uri);
124
+ }
125
+
126
+ }
127
+
94
128
  @injectable()
95
129
  export class DefaultJsonSchemaContribution implements JsonSchemaContribution {
96
130
  async registerSchemas(context: JsonSchemaRegisterContext): Promise<void> {
@@ -622,15 +622,15 @@ export class KeybindingRegistry {
622
622
  matchKeybinding(keySequence: KeySequence, event?: KeyboardEvent): KeybindingRegistry.Match {
623
623
  let disabled: Set<string> | undefined;
624
624
  const isEnabled = (binding: ScopedKeybinding) => {
625
- if (event && !this.isEnabled(binding, event)) {
626
- return false;
627
- }
628
625
  const { command, context, when, keybinding } = binding;
629
626
  if (!this.isUsable(binding)) {
630
627
  disabled = disabled || new Set<string>();
631
628
  disabled.add(JSON.stringify({ command: command.substring(1), context, when, keybinding }));
632
629
  return false;
633
630
  }
631
+ if (event && !this.isEnabled(binding, event)) {
632
+ return false;
633
+ }
634
634
  return !disabled?.has(JSON.stringify({ command, context, when, keybinding }));
635
635
  };
636
636
 
@@ -392,4 +392,7 @@ export class ShouldSaveDialog extends AbstractDialog<boolean> {
392
392
  return this.shouldSave;
393
393
  }
394
394
 
395
+ override async open(disposeOnResolve?: boolean): Promise<boolean | undefined> {
396
+ return super.open(disposeOnResolve);
397
+ }
395
398
  }
@@ -140,6 +140,7 @@ export class SecondaryWindowHandler {
140
140
  widget.secondaryWindow = newWindow;
141
141
  const rootWidget = new SecondaryWindowRootWidget();
142
142
  rootWidget.addClass('secondary-widget-root');
143
+ rootWidget.addClass('monaco-workbench'); // needed for compatility with VSCode styles
143
144
  Widget.attach(rootWidget, element);
144
145
  rootWidget.addWidget(widget);
145
146
  widget.show();
@@ -22,7 +22,7 @@ import {
22
22
  } from '@phosphor/widgets';
23
23
  import { Message } from '@phosphor/messaging';
24
24
  import { IDragEvent } from '@phosphor/dragdrop';
25
- import { RecursivePartial, Event as CommonEvent, DisposableCollection, Disposable, environment, isObject } from '../../common';
25
+ import { RecursivePartial, Event as CommonEvent, DisposableCollection, Disposable, environment, isObject, UntitledResourceResolver, UNTITLED_SCHEME } from '../../common';
26
26
  import { animationFrame } from '../browser';
27
27
  import { Saveable, SaveableWidget, SaveOptions } from '../saveable';
28
28
  import { StatusBarImpl, StatusBarEntry, StatusBarAlignment } from '../status-bar/status-bar';
@@ -232,6 +232,9 @@ export class ApplicationShell extends Widget {
232
232
  @inject(OpenerService)
233
233
  protected readonly openerService: OpenerService;
234
234
 
235
+ @inject(UntitledResourceResolver)
236
+ protected readonly untitledResourceResolver: UntitledResourceResolver;
237
+
235
238
  protected readonly onDidAddWidgetEmitter = new Emitter<Widget>();
236
239
  readonly onDidAddWidget = this.onDidAddWidgetEmitter.event;
237
240
  protected fireDidAddWidget(widget: Widget): void {
@@ -323,6 +326,7 @@ export class ApplicationShell extends Widget {
323
326
 
324
327
  protected initializeShell(): void {
325
328
  this.addClass(APPLICATION_SHELL_CLASS);
329
+ this.addClass('monaco-workbench'); // needed for compatility with VSCode styles
326
330
  this.id = 'theia-app-shell';
327
331
 
328
332
  this.mainPanel = this.createMainPanel();
@@ -572,16 +576,28 @@ export class ApplicationShell extends Widget {
572
576
  uris.forEach(openUri);
573
577
  } else if (event.dataTransfer.files?.length > 0) {
574
578
  // the files were dragged from the outside the workspace
575
- Array.from(event.dataTransfer.files).forEach(file => {
576
- if (file.path) {
577
- const fileUri = URI.fromComponents({
578
- scheme: 'file',
579
- path: file.path,
580
- authority: '',
581
- query: '',
582
- fragment: ''
583
- });
584
- openUri(fileUri);
579
+ Array.from(event.dataTransfer.files).forEach(async file => {
580
+ if (environment.electron.is()) {
581
+ if (file.path) {
582
+ const fileUri = URI.fromFilePath(file.path);
583
+ openUri(fileUri);
584
+ }
585
+ } else {
586
+ const fileContent = await file.text();
587
+ const fileName = file.name;
588
+ const uri = new URI(`${UNTITLED_SCHEME}:/${fileName}`);
589
+ // Only create a new untitled resource if it doesn't already exist.
590
+ // VS Code does the same thing, and there's not really a better solution,
591
+ // since we want to keep the original name of the file,
592
+ // but also to prevent duplicates of the same file.
593
+ if (!this.untitledResourceResolver.has(uri)) {
594
+ const untitledResource = await this.untitledResourceResolver.createUntitledResource(
595
+ fileContent,
596
+ undefined,
597
+ new URI(`${UNTITLED_SCHEME}:/${fileName}`)
598
+ );
599
+ openUri(untitledResource.uri);
600
+ }
585
601
  }
586
602
  });
587
603
  }
@@ -14,6 +14,16 @@
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
16
 
17
+ /*
18
+ * phosphor.js sets the z-index of its panels to 0, which causes overlay issues
19
+ * See also https://github.com/eclipse-theia/theia/issues/14290
20
+ */
21
+ .p-SplitPanel-child,
22
+ .p-DockPanel,
23
+ .p-DockPanel-widget {
24
+ z-index: initial;
25
+ }
26
+
17
27
  .p-DockPanel.p-SplitPanel-child {
18
28
  padding: 0px;
19
29
  }
@@ -43,7 +43,12 @@ export function enableJSDOM(): () => void {
43
43
  });
44
44
  (global as any)['document'] = dom.window.document;
45
45
  (global as any)['window'] = dom.window;
46
- (global as any)['navigator'] = { userAgent: 'node.js', platform: 'Mac' };
46
+ try {
47
+ (global as any)['navigator'] = { userAgent: 'node.js', platform: 'Mac' };
48
+
49
+ } catch (e) {
50
+ // node 21+ already has a navigator object
51
+ }
47
52
 
48
53
  const toCleanup: string[] = [];
49
54
  Object.getOwnPropertyNames((dom.window as any)).forEach(property => {
@@ -32,7 +32,7 @@ import { notEmpty } from '../../common/objects';
32
32
  import { isOSX } from '../../common/os';
33
33
  import { ReactWidget } from '../widgets/react-widget';
34
34
  import * as React from 'react';
35
- import { Virtuoso, VirtuosoHandle } from 'react-virtuoso';
35
+ import { Virtuoso, VirtuosoHandle, VirtuosoProps } from 'react-virtuoso';
36
36
  import { TopDownTreeIterator } from './tree-iterator';
37
37
  import { SearchBox, SearchBoxFactory, SearchBoxProps } from './search-box';
38
38
  import { TreeSearch } from './tree-search';
@@ -111,6 +111,10 @@ export interface TreeProps {
111
111
  */
112
112
  readonly expandOnlyOnExpansionToggleClick?: boolean;
113
113
 
114
+ /**
115
+ * Props that are forwarded to the virtuoso list rendered. Defaults to `{}`.
116
+ */
117
+ readonly viewProps?: VirtuosoProps<unknown, unknown>;
114
118
  }
115
119
 
116
120
  /**
@@ -498,6 +502,7 @@ export class TreeWidget extends ReactWidget implements StatefulWidget {
498
502
  rows={rows}
499
503
  renderNodeRow={this.renderNodeRow}
500
504
  scrollToRow={this.scrollToRow}
505
+ {...this.props.viewProps}
501
506
  />;
502
507
  }
503
508
  // eslint-disable-next-line no-null/no-null
@@ -1546,7 +1551,7 @@ export namespace TreeWidget {
1546
1551
  /**
1547
1552
  * Representation of the tree view properties.
1548
1553
  */
1549
- export interface ViewProps {
1554
+ export interface ViewProps extends VirtuosoProps<unknown, unknown> {
1550
1555
  /**
1551
1556
  * The width property.
1552
1557
  */
@@ -1568,7 +1573,7 @@ export namespace TreeWidget {
1568
1573
  export class View extends React.Component<ViewProps> {
1569
1574
  list: VirtuosoHandle | undefined;
1570
1575
  override render(): React.ReactNode {
1571
- const { rows, width, height, scrollToRow } = this.props;
1576
+ const { rows, width, height, scrollToRow, renderNodeRow, ...other } = this.props;
1572
1577
  return <Virtuoso
1573
1578
  ref={list => {
1574
1579
  this.list = (list || undefined);
@@ -1580,11 +1585,12 @@ export namespace TreeWidget {
1580
1585
  }
1581
1586
  }}
1582
1587
  totalCount={rows.length}
1583
- itemContent={index => this.props.renderNodeRow(rows[index])}
1588
+ itemContent={index => renderNodeRow(rows[index])}
1584
1589
  width={width}
1585
1590
  height={height}
1586
1591
  // This is a pixel value, it will scan 200px to the top and bottom of the current view
1587
1592
  overscan={500}
1593
+ {...other}
1588
1594
  />;
1589
1595
  }
1590
1596
  }
@@ -22,6 +22,8 @@ import { ClipboardService } from '../clipboard-service';
22
22
  import { BrowserClipboardService } from '../browser-clipboard-service';
23
23
  import { SecondaryWindowService } from './secondary-window-service';
24
24
  import { DefaultSecondaryWindowService } from './default-secondary-window-service';
25
+ import { bindContributionProvider } from '../../common';
26
+ import { WindowTitleContribution } from './window-title-service';
25
27
 
26
28
  export default new ContainerModule(bind => {
27
29
  bind(DefaultWindowService).toSelf().inSingletonScope();
@@ -29,4 +31,5 @@ export default new ContainerModule(bind => {
29
31
  bind(FrontendApplicationContribution).toService(DefaultWindowService);
30
32
  bind(ClipboardService).to(BrowserClipboardService).inSingletonScope();
31
33
  bind(SecondaryWindowService).to(DefaultSecondaryWindowService).inSingletonScope();
34
+ bindContributionProvider(bind, WindowTitleContribution);
32
35
  });
@@ -20,11 +20,15 @@ import { ExtractableWidget } from '../widgets';
20
20
  import { ApplicationShell } from '../shell';
21
21
  import { Saveable } from '../saveable';
22
22
  import { PreferenceService } from '../preferences';
23
- import { environment } from '../../common';
23
+ import { Emitter, environment, Event } from '../../common';
24
24
  import { SaveableService } from '../saveable-service';
25
25
 
26
26
  @injectable()
27
27
  export class DefaultSecondaryWindowService implements SecondaryWindowService {
28
+ protected readonly onWindowOpenedEmitter = new Emitter<Window>;
29
+ readonly onWindowOpened: Event<Window> = this.onWindowOpenedEmitter.event;
30
+ protected readonly onWindowClosedEmitter = new Emitter<Window>;
31
+ readonly onWindowClosed: Event<Window> = this.onWindowClosedEmitter.event;
28
32
  // secondary-window.html is part of Theia's generated code. It is generated by dev-packages/application-manager/src/generator/frontend-generator.ts
29
33
  protected static SECONDARY_WINDOW_URL = 'secondary-window.html';
30
34
 
@@ -94,6 +98,7 @@ export class DefaultSecondaryWindowService implements SecondaryWindowService {
94
98
  const newWindow = window.open(DefaultSecondaryWindowService.SECONDARY_WINDOW_URL, this.nextWindowId(), options) ?? undefined;
95
99
  if (newWindow) {
96
100
  this.secondaryWindows.push(newWindow);
101
+ this.onWindowOpenedEmitter.fire(newWindow);
97
102
  newWindow.addEventListener('DOMContentLoaded', () => {
98
103
  newWindow.addEventListener('beforeunload', evt => {
99
104
  const saveable = Saveable.get(widget);
@@ -113,6 +118,7 @@ export class DefaultSecondaryWindowService implements SecondaryWindowService {
113
118
 
114
119
  const extIndex = this.secondaryWindows.indexOf(newWindow);
115
120
  if (extIndex > -1) {
121
+ this.onWindowClosedEmitter.fire(newWindow);
116
122
  this.secondaryWindows.splice(extIndex, 1);
117
123
  };
118
124
  });
@@ -14,6 +14,7 @@
14
14
  // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
15
  // *****************************************************************************
16
16
 
17
+ import { Event } from '../../common';
17
18
  import { ApplicationShell } from '../shell';
18
19
  import { ExtractableWidget } from '../widgets';
19
20
 
@@ -33,6 +34,8 @@ export interface SecondaryWindowService {
33
34
  * @returns the created window or `undefined` if it could not be created
34
35
  */
35
36
  createSecondaryWindow(widget: ExtractableWidget, shell: ApplicationShell): Window | undefined;
37
+ readonly onWindowOpened: Event<Window>;
38
+ readonly onWindowClosed: Event<Window>;
36
39
 
37
40
  /** Handles focussing the given secondary window in the browser and on Electron. */
38
41
  focus(win: Window): void;
@@ -14,11 +14,17 @@
14
14
  // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
15
  // *****************************************************************************
16
16
 
17
- import { inject, injectable, postConstruct } from 'inversify';
17
+ import { inject, injectable, named, postConstruct } from 'inversify';
18
18
  import { escapeRegExpCharacters } from '../../common/strings';
19
19
  import { Emitter, Event } from '../../common/event';
20
20
  import { CorePreferences } from '../core-preferences';
21
21
  import { FrontendApplicationConfigProvider } from '../frontend-application-config-provider';
22
+ import { ContributionProvider } from '../../common';
23
+
24
+ export const WindowTitleContribution = Symbol('WindowTitleAddOnContribution');
25
+ export interface WindowTitleContribution {
26
+ enhanceTitle(title: string, parts: Map<string, string | undefined>): string;
27
+ }
22
28
 
23
29
  export const InitialWindowTitleParts = {
24
30
  activeEditorShort: undefined,
@@ -43,6 +49,9 @@ export class WindowTitleService {
43
49
  @inject(CorePreferences)
44
50
  protected readonly preferences: CorePreferences;
45
51
 
52
+ @inject(ContributionProvider) @named(WindowTitleContribution)
53
+ protected readonly titleContributions: ContributionProvider<WindowTitleContribution>;
54
+
46
55
  protected _title = '';
47
56
  protected titleTemplate?: string;
48
57
 
@@ -95,6 +104,10 @@ export class WindowTitleService {
95
104
  }
96
105
  const separatedTitle = title.split('${separator}').filter(e => e.trim().length > 0);
97
106
  this._title = separatedTitle.join(this.separator);
107
+ const contributions = this.titleContributions.getContributions();
108
+ for (const contribution of contributions) {
109
+ this._title = contribution.enhanceTitle(this.title, this.titleParts);
110
+ }
98
111
  }
99
112
  const developmentHost = this.titleParts.get('developmentHost');
100
113
  if (developmentHost) {
@@ -60,6 +60,8 @@ export interface Resource extends Disposable {
60
60
  readonly onDidChangeReadOnly?: Event<boolean | MarkdownString>;
61
61
 
62
62
  readonly readOnly?: boolean | MarkdownString;
63
+
64
+ readonly initiallyDirty?: boolean;
63
65
  /**
64
66
  * Reads latest content of this resource.
65
67
  *
@@ -378,11 +380,13 @@ export class UntitledResourceResolver implements ResourceResolver {
378
380
  export class UntitledResource implements Resource {
379
381
 
380
382
  protected readonly onDidChangeContentsEmitter = new Emitter<void>();
383
+ initiallyDirty: boolean;
381
384
  get onDidChangeContents(): Event<void> {
382
385
  return this.onDidChangeContentsEmitter.event;
383
386
  }
384
387
 
385
388
  constructor(private resources: Map<string, UntitledResource>, public uri: URI, private content?: string) {
389
+ this.initiallyDirty = (content !== undefined && content.length > 0);
386
390
  this.resources.set(this.uri.toString(), this);
387
391
  }
388
392
 
@@ -30,6 +30,8 @@ import { bindWindowPreferences } from './electron-window-preferences';
30
30
  import { ElectronWindowService } from './electron-window-service';
31
31
  import { ExternalAppOpenHandler } from './external-app-open-handler';
32
32
  import { ElectronUriHandlerContribution } from '../electron-uri-handler';
33
+ import { bindContributionProvider } from '../../common';
34
+ import { WindowTitleContribution } from '../../browser/window/window-title-service';
33
35
 
34
36
  export default new ContainerModule((bind, unbind, isBound, rebind) => {
35
37
  bind(ElectronMainWindowService).toDynamicValue(context =>
@@ -45,4 +47,5 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
45
47
  bind(SecondaryWindowService).to(ElectronSecondaryWindowService).inSingletonScope();
46
48
  bind(ExternalAppOpenHandler).toSelf().inSingletonScope();
47
49
  bind(OpenHandler).toService(ExternalAppOpenHandler);
50
+ bindContributionProvider(bind, WindowTitleContribution);
48
51
  });
@@ -47,7 +47,12 @@ export class TestWebSocketChannelSetup {
47
47
  path: string
48
48
  }) {
49
49
  const address = (server.address() as AddressInfo);
50
- const url = `ws://${address.address}:${address.port}${servicesPath}`;
50
+ let url;
51
+ if (address.family === 'IPv6') {
52
+ url = `ws://[${address.address}]:${address.port}${servicesPath}`;
53
+ } else {
54
+ url = `ws://${address.address}:${address.port}${servicesPath}`;
55
+ }
51
56
  this.connectionProvider = this.createConnectionProvider(url);
52
57
  }
53
58