@theia/core 1.53.0-next.5 → 1.53.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 (142) hide show
  1. package/README.md +7 -7
  2. package/i18n/nls.cs.json +30 -0
  3. package/i18n/nls.de.json +30 -0
  4. package/i18n/nls.es.json +30 -0
  5. package/i18n/nls.fr.json +30 -0
  6. package/i18n/nls.hu.json +30 -0
  7. package/i18n/nls.it.json +30 -0
  8. package/i18n/nls.ja.json +30 -0
  9. package/i18n/nls.json +31 -1
  10. package/i18n/nls.ko.json +582 -0
  11. package/i18n/nls.pl.json +30 -0
  12. package/i18n/nls.pt-br.json +30 -0
  13. package/i18n/nls.ru.json +30 -0
  14. package/i18n/nls.tr.json +582 -0
  15. package/i18n/nls.zh-cn.json +30 -0
  16. package/i18n/nls.zh-tw.json +582 -0
  17. package/lib/browser/catalog.json +6801 -0
  18. package/lib/browser/context-key-service.d.ts +3 -2
  19. package/lib/browser/context-key-service.d.ts.map +1 -1
  20. package/lib/browser/context-key-service.js.map +1 -1
  21. package/lib/browser/frontend-application-module.d.ts.map +1 -1
  22. package/lib/browser/frontend-application-module.js.map +1 -1
  23. package/lib/browser/json-schema-store.d.ts +0 -3
  24. package/lib/browser/json-schema-store.d.ts.map +1 -1
  25. package/lib/browser/json-schema-store.js +2 -12
  26. package/lib/browser/json-schema-store.js.map +1 -1
  27. package/lib/browser/opener-service.d.ts +5 -0
  28. package/lib/browser/opener-service.d.ts.map +1 -1
  29. package/lib/browser/opener-service.js +5 -2
  30. package/lib/browser/opener-service.js.map +1 -1
  31. package/lib/browser/saveable-service.d.ts.map +1 -1
  32. package/lib/browser/saveable-service.js +6 -2
  33. package/lib/browser/saveable-service.js.map +1 -1
  34. package/lib/browser/saveable.d.ts +17 -1
  35. package/lib/browser/saveable.d.ts.map +1 -1
  36. package/lib/browser/saveable.js +62 -1
  37. package/lib/browser/saveable.js.map +1 -1
  38. package/lib/browser/shell/tab-bar-toolbar/tab-bar-toolbar-menu-adapters.d.ts +2 -2
  39. package/lib/browser/shell/tab-bar-toolbar/tab-bar-toolbar-menu-adapters.d.ts.map +1 -1
  40. package/lib/browser/shell/tab-bar-toolbar/tab-bar-toolbar-menu-adapters.js.map +1 -1
  41. package/lib/browser/shell/tab-bar-toolbar/tab-bar-toolbar-registry.d.ts +6 -16
  42. package/lib/browser/shell/tab-bar-toolbar/tab-bar-toolbar-registry.d.ts.map +1 -1
  43. package/lib/browser/shell/tab-bar-toolbar/tab-bar-toolbar-registry.js +11 -29
  44. package/lib/browser/shell/tab-bar-toolbar/tab-bar-toolbar-registry.js.map +1 -1
  45. package/lib/browser/shell/tab-bar-toolbar/tab-bar-toolbar-types.d.ts +39 -78
  46. package/lib/browser/shell/tab-bar-toolbar/tab-bar-toolbar-types.d.ts.map +1 -1
  47. package/lib/browser/shell/tab-bar-toolbar/tab-bar-toolbar-types.js +8 -39
  48. package/lib/browser/shell/tab-bar-toolbar/tab-bar-toolbar-types.js.map +1 -1
  49. package/lib/browser/shell/tab-bar-toolbar/tab-bar-toolbar.d.ts +10 -10
  50. package/lib/browser/shell/tab-bar-toolbar/tab-bar-toolbar.d.ts.map +1 -1
  51. package/lib/browser/shell/tab-bar-toolbar/tab-bar-toolbar.js +43 -32
  52. package/lib/browser/shell/tab-bar-toolbar/tab-bar-toolbar.js.map +1 -1
  53. package/lib/browser/view-container.d.ts +2 -2
  54. package/lib/browser/view-container.d.ts.map +1 -1
  55. package/lib/browser/view-container.js.map +1 -1
  56. package/lib/browser/widget-open-handler.d.ts +4 -1
  57. package/lib/browser/widget-open-handler.d.ts.map +1 -1
  58. package/lib/browser/widget-open-handler.js.map +1 -1
  59. package/lib/browser/widgets/index.d.ts +1 -0
  60. package/lib/browser/widgets/index.d.ts.map +1 -1
  61. package/lib/browser/widgets/index.js +1 -0
  62. package/lib/browser/widgets/index.js.map +1 -1
  63. package/lib/browser/widgets/split-widget.d.ts +45 -0
  64. package/lib/browser/widgets/split-widget.d.ts.map +1 -0
  65. package/lib/browser/widgets/split-widget.js +126 -0
  66. package/lib/browser/widgets/split-widget.js.map +1 -0
  67. package/lib/common/event.d.ts +2 -0
  68. package/lib/common/event.d.ts.map +1 -1
  69. package/lib/common/event.js +4 -0
  70. package/lib/common/event.js.map +1 -1
  71. package/lib/common/json-schema.d.ts +2 -0
  72. package/lib/common/json-schema.d.ts.map +1 -1
  73. package/lib/common/menu/menu-types.d.ts.map +1 -1
  74. package/lib/common/menu/menu-types.js.map +1 -1
  75. package/lib/electron-browser/electron-uri-handler.d.ts +6 -0
  76. package/lib/electron-browser/electron-uri-handler.d.ts.map +1 -0
  77. package/lib/electron-browser/electron-uri-handler.js +49 -0
  78. package/lib/electron-browser/electron-uri-handler.js.map +1 -0
  79. package/lib/electron-browser/menu/electron-main-menu-factory.d.ts +1 -1
  80. package/lib/electron-browser/menu/electron-main-menu-factory.d.ts.map +1 -1
  81. package/lib/electron-browser/menu/electron-main-menu-factory.js +6 -6
  82. package/lib/electron-browser/menu/electron-main-menu-factory.js.map +1 -1
  83. package/lib/electron-browser/preload.d.ts.map +1 -1
  84. package/lib/electron-browser/preload.js +12 -0
  85. package/lib/electron-browser/preload.js.map +1 -1
  86. package/lib/electron-browser/window/electron-window-module.d.ts.map +1 -1
  87. package/lib/electron-browser/window/electron-window-module.js +3 -0
  88. package/lib/electron-browser/window/electron-window-module.js.map +1 -1
  89. package/lib/electron-browser/window/external-app-open-handler.js +1 -1
  90. package/lib/electron-browser/window/external-app-open-handler.js.map +1 -1
  91. package/lib/electron-common/electron-api.d.ts +2 -0
  92. package/lib/electron-common/electron-api.d.ts.map +1 -1
  93. package/lib/electron-common/electron-api.js +2 -1
  94. package/lib/electron-common/electron-api.js.map +1 -1
  95. package/lib/electron-main/electron-api-main.d.ts +2 -0
  96. package/lib/electron-main/electron-api-main.d.ts.map +1 -1
  97. package/lib/electron-main/electron-api-main.js +27 -3
  98. package/lib/electron-main/electron-api-main.js.map +1 -1
  99. package/lib/electron-main/electron-main-application.d.ts +5 -3
  100. package/lib/electron-main/electron-main-application.d.ts.map +1 -1
  101. package/lib/electron-main/electron-main-application.js +57 -14
  102. package/lib/electron-main/electron-main-application.js.map +1 -1
  103. package/lib/electron-main/theia-electron-window.d.ts +1 -0
  104. package/lib/electron-main/theia-electron-window.d.ts.map +1 -1
  105. package/lib/electron-main/theia-electron-window.js +3 -0
  106. package/lib/electron-main/theia-electron-window.js.map +1 -1
  107. package/lib/node/i18n/theia-localization-contribution.d.ts.map +1 -1
  108. package/lib/node/i18n/theia-localization-contribution.js +12 -8
  109. package/lib/node/i18n/theia-localization-contribution.js.map +1 -1
  110. package/package.json +10 -8
  111. package/src/browser/context-key-service.ts +3 -3
  112. package/src/browser/frontend-application-module.ts +0 -1
  113. package/src/browser/json-schema-store.ts +2 -11
  114. package/src/browser/opener-service.ts +12 -2
  115. package/src/browser/saveable-service.ts +6 -2
  116. package/src/browser/saveable.ts +69 -1
  117. package/src/browser/shell/tab-bar-toolbar/tab-bar-toolbar-menu-adapters.ts +2 -2
  118. package/src/browser/shell/tab-bar-toolbar/tab-bar-toolbar-registry.ts +18 -33
  119. package/src/browser/shell/tab-bar-toolbar/tab-bar-toolbar-types.ts +62 -124
  120. package/src/browser/shell/tab-bar-toolbar/tab-bar-toolbar.tsx +40 -25
  121. package/src/browser/style/index.css +1 -0
  122. package/src/browser/style/split-widget.css +38 -0
  123. package/src/browser/style/tabs.css +13 -24
  124. package/src/browser/style/view-container.css +0 -7
  125. package/src/browser/view-container.ts +2 -2
  126. package/src/browser/widget-open-handler.ts +4 -1
  127. package/src/browser/widgets/index.ts +1 -0
  128. package/src/browser/widgets/split-widget.ts +163 -0
  129. package/src/common/event.ts +6 -0
  130. package/src/common/json-schema.ts +2 -0
  131. package/src/common/menu/menu-types.ts +1 -0
  132. package/src/electron-browser/electron-uri-handler.ts +42 -0
  133. package/src/electron-browser/menu/electron-main-menu-factory.ts +7 -6
  134. package/src/electron-browser/preload.ts +16 -1
  135. package/src/electron-browser/window/electron-window-module.ts +3 -0
  136. package/src/electron-browser/window/external-app-open-handler.ts +1 -1
  137. package/src/electron-common/electron-api.ts +3 -0
  138. package/src/electron-main/electron-api-main.ts +31 -5
  139. package/src/electron-main/electron-main-application.ts +62 -20
  140. package/src/electron-main/theia-electron-window.ts +5 -0
  141. package/src/node/i18n/theia-localization-contribution.ts +12 -8
  142. package/i18n/nls.pt-pt.json +0 -552
@@ -20,18 +20,22 @@ const tslib_1 = require("tslib");
20
20
  const inversify_1 = require("inversify");
21
21
  let TheiaLocalizationContribution = class TheiaLocalizationContribution {
22
22
  async registerLocalizations(registry) {
23
- registry.registerLocalizationFromRequire('cs', require('../../../i18n/nls.cs.json'));
24
- registry.registerLocalizationFromRequire('de', require('../../../i18n/nls.de.json'));
25
- registry.registerLocalizationFromRequire('es', require('../../../i18n/nls.es.json'));
23
+ // Attempt to use the same languages as VS Code
24
+ // See https://code.visualstudio.com/docs/getstarted/locales#_available-locales
25
+ registry.registerLocalizationFromRequire('zh-cn', require('../../../i18n/nls.zh-cn.json'));
26
+ registry.registerLocalizationFromRequire('zh-tw', require('../../../i18n/nls.zh-tw.json'));
26
27
  registry.registerLocalizationFromRequire('fr', require('../../../i18n/nls.fr.json'));
27
- registry.registerLocalizationFromRequire('hu', require('../../../i18n/nls.hu.json'));
28
+ registry.registerLocalizationFromRequire('de', require('../../../i18n/nls.de.json'));
28
29
  registry.registerLocalizationFromRequire('it', require('../../../i18n/nls.it.json'));
30
+ registry.registerLocalizationFromRequire('es', require('../../../i18n/nls.es.json'));
29
31
  registry.registerLocalizationFromRequire('ja', require('../../../i18n/nls.ja.json'));
30
- registry.registerLocalizationFromRequire('pl', require('../../../i18n/nls.pl.json'));
31
- registry.registerLocalizationFromRequire('pt-br', require('../../../i18n/nls.pt-br.json'));
32
- registry.registerLocalizationFromRequire('pt-pt', require('../../../i18n/nls.pt-pt.json'));
32
+ registry.registerLocalizationFromRequire('ko', require('../../../i18n/nls.ko.json'));
33
33
  registry.registerLocalizationFromRequire('ru', require('../../../i18n/nls.ru.json'));
34
- registry.registerLocalizationFromRequire('zh-cn', require('../../../i18n/nls.zh-cn.json'));
34
+ registry.registerLocalizationFromRequire('pt-br', require('../../../i18n/nls.pt-br.json'));
35
+ registry.registerLocalizationFromRequire('tr', require('../../../i18n/nls.tr.json'));
36
+ registry.registerLocalizationFromRequire('pl', require('../../../i18n/nls.pl.json'));
37
+ registry.registerLocalizationFromRequire('cs', require('../../../i18n/nls.cs.json'));
38
+ registry.registerLocalizationFromRequire('hu', require('../../../i18n/nls.hu.json'));
35
39
  }
36
40
  };
37
41
  exports.TheiaLocalizationContribution = TheiaLocalizationContribution;
@@ -1 +1 @@
1
- {"version":3,"file":"theia-localization-contribution.js","sourceRoot":"","sources":["../../../src/node/i18n/theia-localization-contribution.ts"],"names":[],"mappings":";AAAA,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;;;;AAEhF,yCAAuC;AAIhC,IAAM,6BAA6B,GAAnC,MAAM,6BAA6B;IACtC,KAAK,CAAC,qBAAqB,CAAC,QAA8B;QACtD,QAAQ,CAAC,+BAA+B,CAAC,IAAI,EAAE,OAAO,CAAC,2BAA2B,CAAC,CAAC,CAAC;QACrF,QAAQ,CAAC,+BAA+B,CAAC,IAAI,EAAE,OAAO,CAAC,2BAA2B,CAAC,CAAC,CAAC;QACrF,QAAQ,CAAC,+BAA+B,CAAC,IAAI,EAAE,OAAO,CAAC,2BAA2B,CAAC,CAAC,CAAC;QACrF,QAAQ,CAAC,+BAA+B,CAAC,IAAI,EAAE,OAAO,CAAC,2BAA2B,CAAC,CAAC,CAAC;QACrF,QAAQ,CAAC,+BAA+B,CAAC,IAAI,EAAE,OAAO,CAAC,2BAA2B,CAAC,CAAC,CAAC;QACrF,QAAQ,CAAC,+BAA+B,CAAC,IAAI,EAAE,OAAO,CAAC,2BAA2B,CAAC,CAAC,CAAC;QACrF,QAAQ,CAAC,+BAA+B,CAAC,IAAI,EAAE,OAAO,CAAC,2BAA2B,CAAC,CAAC,CAAC;QACrF,QAAQ,CAAC,+BAA+B,CAAC,IAAI,EAAE,OAAO,CAAC,2BAA2B,CAAC,CAAC,CAAC;QACrF,QAAQ,CAAC,+BAA+B,CAAC,OAAO,EAAE,OAAO,CAAC,8BAA8B,CAAC,CAAC,CAAC;QAC3F,QAAQ,CAAC,+BAA+B,CAAC,OAAO,EAAE,OAAO,CAAC,8BAA8B,CAAC,CAAC,CAAC;QAC3F,QAAQ,CAAC,+BAA+B,CAAC,IAAI,EAAE,OAAO,CAAC,2BAA2B,CAAC,CAAC,CAAC;QACrF,QAAQ,CAAC,+BAA+B,CAAC,OAAO,EAAE,OAAO,CAAC,8BAA8B,CAAC,CAAC,CAAC;IAC/F,CAAC;CACJ,CAAA;AAfY,sEAA6B;wCAA7B,6BAA6B;IADzC,IAAA,sBAAU,GAAE;GACA,6BAA6B,CAezC"}
1
+ {"version":3,"file":"theia-localization-contribution.js","sourceRoot":"","sources":["../../../src/node/i18n/theia-localization-contribution.ts"],"names":[],"mappings":";AAAA,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;;;;AAEhF,yCAAuC;AAIhC,IAAM,6BAA6B,GAAnC,MAAM,6BAA6B;IACtC,KAAK,CAAC,qBAAqB,CAAC,QAA8B;QACtD,+CAA+C;QAC/C,+EAA+E;QAC/E,QAAQ,CAAC,+BAA+B,CAAC,OAAO,EAAE,OAAO,CAAC,8BAA8B,CAAC,CAAC,CAAC;QAC3F,QAAQ,CAAC,+BAA+B,CAAC,OAAO,EAAE,OAAO,CAAC,8BAA8B,CAAC,CAAC,CAAC;QAC3F,QAAQ,CAAC,+BAA+B,CAAC,IAAI,EAAE,OAAO,CAAC,2BAA2B,CAAC,CAAC,CAAC;QACrF,QAAQ,CAAC,+BAA+B,CAAC,IAAI,EAAE,OAAO,CAAC,2BAA2B,CAAC,CAAC,CAAC;QACrF,QAAQ,CAAC,+BAA+B,CAAC,IAAI,EAAE,OAAO,CAAC,2BAA2B,CAAC,CAAC,CAAC;QACrF,QAAQ,CAAC,+BAA+B,CAAC,IAAI,EAAE,OAAO,CAAC,2BAA2B,CAAC,CAAC,CAAC;QACrF,QAAQ,CAAC,+BAA+B,CAAC,IAAI,EAAE,OAAO,CAAC,2BAA2B,CAAC,CAAC,CAAC;QACrF,QAAQ,CAAC,+BAA+B,CAAC,IAAI,EAAE,OAAO,CAAC,2BAA2B,CAAC,CAAC,CAAC;QACrF,QAAQ,CAAC,+BAA+B,CAAC,IAAI,EAAE,OAAO,CAAC,2BAA2B,CAAC,CAAC,CAAC;QACrF,QAAQ,CAAC,+BAA+B,CAAC,OAAO,EAAE,OAAO,CAAC,8BAA8B,CAAC,CAAC,CAAC;QAC3F,QAAQ,CAAC,+BAA+B,CAAC,IAAI,EAAE,OAAO,CAAC,2BAA2B,CAAC,CAAC,CAAC;QACrF,QAAQ,CAAC,+BAA+B,CAAC,IAAI,EAAE,OAAO,CAAC,2BAA2B,CAAC,CAAC,CAAC;QACrF,QAAQ,CAAC,+BAA+B,CAAC,IAAI,EAAE,OAAO,CAAC,2BAA2B,CAAC,CAAC,CAAC;QACrF,QAAQ,CAAC,+BAA+B,CAAC,IAAI,EAAE,OAAO,CAAC,2BAA2B,CAAC,CAAC,CAAC;IACzF,CAAC;CACJ,CAAA;AAnBY,sEAA6B;wCAA7B,6BAA6B;IADzC,IAAA,sBAAU,GAAE;GACA,6BAA6B,CAmBzC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theia/core",
3
- "version": "1.53.0-next.5+1e5fb536d",
3
+ "version": "1.53.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",
@@ -16,8 +16,8 @@
16
16
  "@phosphor/signaling": "1",
17
17
  "@phosphor/virtualdom": "1",
18
18
  "@phosphor/widgets": "1",
19
- "@theia/application-package": "1.53.0-next.5+1e5fb536d",
20
- "@theia/request": "1.53.0-next.5+1e5fb536d",
19
+ "@theia/application-package": "1.53.0",
20
+ "@theia/request": "1.53.0",
21
21
  "@types/body-parser": "^1.16.4",
22
22
  "@types/cookie": "^0.3.3",
23
23
  "@types/dompurify": "^2.2.2",
@@ -203,18 +203,20 @@
203
203
  "generate-layout": "electron ./scripts/generate-layout",
204
204
  "generate-theia-re-exports": "theia-re-exports generate && theia-re-exports template README_TEMPLATE.md > README.md",
205
205
  "lint": "theiaext lint",
206
- "prepare": "yarn -s generate-theia-re-exports",
206
+ "prepare": "yarn -s generate-theia-re-exports && yarn download:json-schema",
207
+ "download:json-schema": "node ./scripts/download-catalog.js",
207
208
  "test": "theiaext test",
208
209
  "version": "yarn -s generate-theia-re-exports",
209
210
  "watch": "theiaext watch"
210
211
  },
211
212
  "devDependencies": {
212
- "@theia/ext-scripts": "1.52.0",
213
- "@theia/re-exports": "1.52.0",
214
- "minimist": "^1.2.0"
213
+ "@theia/ext-scripts": "1.53.0",
214
+ "@theia/re-exports": "1.53.0",
215
+ "minimist": "^1.2.0",
216
+ "nodejs-file-downloader": "4.13.0"
215
217
  },
216
218
  "nyc": {
217
219
  "extends": "../../configs/nyc.json"
218
220
  },
219
- "gitHead": "1e5fb536d65550ad8fa0fefcec731645b2afc74a"
221
+ "gitHead": "e094481839bc0920b91f726f81cb759a4cba9cc5"
220
222
  }
@@ -16,6 +16,7 @@
16
16
 
17
17
  import { injectable } from 'inversify';
18
18
  import { Emitter, Event } from '../common/event';
19
+ import { Disposable } from '../common';
19
20
 
20
21
  export type ContextKeyValue = null | undefined | boolean | number | string
21
22
  | Array<null | undefined | boolean | number | string>
@@ -83,11 +84,10 @@ export interface ContextKeyService extends ContextMatcher {
83
84
  setContext(key: string, value: unknown): void;
84
85
  }
85
86
 
86
- export type ScopedValueStore = Omit<ContextKeyService, 'onDidChange' | 'match' | 'parseKeys' | 'with' | 'createOverlay'>;
87
+ export type ScopedValueStore = Omit<ContextKeyService, 'onDidChange' | 'match' | 'parseKeys' | 'with' | 'createOverlay'> & Disposable;
87
88
 
88
89
  @injectable()
89
90
  export class ContextKeyServiceDummyImpl implements ContextKeyService {
90
-
91
91
  protected readonly onDidChangeEmitter = new Emitter<ContextKeyChangeEvent>();
92
92
  readonly onDidChange = this.onDidChangeEmitter.event;
93
93
  protected fireDidChange(event: ContextKeyChangeEvent): void {
@@ -122,7 +122,7 @@ export class ContextKeyServiceDummyImpl implements ContextKeyService {
122
122
  /**
123
123
  * Details should implemented by an extension, e.g. by the monaco extension.
124
124
  */
125
- createScoped(target: HTMLElement): ContextKeyService {
125
+ createScoped(target: HTMLElement): ScopedValueStore {
126
126
  return this;
127
127
  }
128
128
 
@@ -465,7 +465,6 @@ export const frontendApplicationModule = new ContainerModule((bind, _unbind, _is
465
465
  bind(FrontendApplicationContribution).toService(StylingService);
466
466
 
467
467
  bind(SecondaryWindowHandler).toSelf().inSingletonScope();
468
-
469
468
  bind(ViewColumnService).toSelf().inSingletonScope();
470
469
 
471
470
  bind(UndoRedoHandlerService).toSelf().inSingletonScope();
@@ -18,9 +18,7 @@ import { injectable, inject, named } from 'inversify';
18
18
  import { ContributionProvider } from '../common/contribution-provider';
19
19
  import { FrontendApplicationContribution } from './frontend-application-contribution';
20
20
  import { MaybePromise } from '../common';
21
- import { Endpoint } from './endpoint';
22
21
  import { timeout, Deferred } from '../common/promise-util';
23
- import { RequestContext, RequestService } from '@theia/request';
24
22
 
25
23
  export interface JsonSchemaConfiguration {
26
24
  fileMatch: string | string[];
@@ -95,16 +93,9 @@ export class JsonSchemaStore implements FrontendApplicationContribution {
95
93
 
96
94
  @injectable()
97
95
  export class DefaultJsonSchemaContribution implements JsonSchemaContribution {
98
-
99
- @inject(RequestService)
100
- protected readonly requestService: RequestService;
101
-
102
- protected readonly jsonSchemaUrl = `${new Endpoint().httpScheme}//schemastore.org/api/json/catalog.json`;
103
-
104
96
  async registerSchemas(context: JsonSchemaRegisterContext): Promise<void> {
105
- const response = await this.requestService.request({ url: this.jsonSchemaUrl });
106
- const schemas = RequestContext.asJson<{ schemas: DefaultJsonSchemaContribution.SchemaData[] }>(response).schemas;
107
- for (const s of schemas) {
97
+ const catalog = require('./catalog.json') as { schemas: DefaultJsonSchemaContribution.SchemaData[] };
98
+ for (const s of catalog.schemas) {
108
99
  if (s.fileMatch) {
109
100
  context.registerSchema({
110
101
  fileMatch: s.fileMatch,
@@ -79,6 +79,12 @@ export interface OpenerService {
79
79
  * Add open handler i.e. for custom editors
80
80
  */
81
81
  addHandler?(openHandler: OpenHandler): Disposable;
82
+
83
+ /**
84
+ * Remove open handler
85
+ */
86
+ removeHandler?(openHandler: OpenHandler): void;
87
+
82
88
  /**
83
89
  * Event that fires when a new opener is added or removed.
84
90
  */
@@ -108,11 +114,15 @@ export class DefaultOpenerService implements OpenerService {
108
114
  this.onDidChangeOpenersEmitter.fire();
109
115
 
110
116
  return Disposable.create(() => {
111
- this.customEditorOpenHandlers.splice(this.customEditorOpenHandlers.indexOf(openHandler), 1);
112
- this.onDidChangeOpenersEmitter.fire();
117
+ this.removeHandler(openHandler);
113
118
  });
114
119
  }
115
120
 
121
+ removeHandler(openHandler: OpenHandler): void {
122
+ this.customEditorOpenHandlers.splice(this.customEditorOpenHandlers.indexOf(openHandler), 1);
123
+ this.onDidChangeOpenersEmitter.fire();
124
+ }
125
+
116
126
  async getOpener(uri: URI, options?: OpenerOptions): Promise<OpenHandler> {
117
127
  const handlers = await this.prioritize(uri, options);
118
128
  if (handlers.length >= 1) {
@@ -174,7 +174,10 @@ export class SaveableService implements FrontendApplicationContribution {
174
174
  setDirty(saveableWidget, saveable.dirty);
175
175
  saveable.onDirtyChanged(() => setDirty(saveableWidget, saveable.dirty));
176
176
  const closeWithSaving = this.createCloseWithSaving();
177
- const closeWithoutSaving = () => this.closeWithoutSaving(saveableWidget, false);
177
+ const closeWithoutSaving = async () => {
178
+ const revert = Saveable.closingWidgetWouldLoseSaveable(saveableWidget, Array.from(this.saveThrottles.keys()));
179
+ await this.closeWithoutSaving(saveableWidget, revert);
180
+ };
178
181
  Object.assign(saveableWidget, {
179
182
  closeWithoutSaving,
180
183
  closeWithSaving,
@@ -224,7 +227,8 @@ export class SaveableService implements FrontendApplicationContribution {
224
227
  }
225
228
  const notLastWithDocument = !Saveable.closingWidgetWouldLoseSaveable(widget, Array.from(this.saveThrottles.keys()));
226
229
  if (notLastWithDocument) {
227
- return widget.closeWithoutSaving(false).then(() => undefined);
230
+ await widget.closeWithoutSaving(false);
231
+ return undefined;
228
232
  }
229
233
  if (options && options.shouldSave) {
230
234
  return options.shouldSave();
@@ -21,7 +21,7 @@ import { MaybePromise } from '../common/types';
21
21
  import { Key } from './keyboard/keys';
22
22
  import { AbstractDialog } from './dialogs';
23
23
  import { nls } from '../common/nls';
24
- import { DisposableCollection, isObject } from '../common';
24
+ import { Disposable, DisposableCollection, isObject } from '../common';
25
25
  import { BinaryBuffer } from '../common/buffer';
26
26
 
27
27
  export type AutoSaveMode = 'off' | 'afterDelay' | 'onFocusChange' | 'onWindowChange';
@@ -112,6 +112,74 @@ export class DelegatingSaveable implements Saveable {
112
112
 
113
113
  }
114
114
 
115
+ export class CompositeSaveable implements Saveable {
116
+ protected isDirty = false;
117
+ protected readonly onDirtyChangedEmitter = new Emitter<void>();
118
+ protected readonly onContentChangedEmitter = new Emitter<void>();
119
+ protected readonly toDispose = new DisposableCollection(this.onDirtyChangedEmitter, this.onContentChangedEmitter);
120
+ protected readonly saveablesMap = new Map<Saveable, Disposable>();
121
+
122
+ get dirty(): boolean {
123
+ return this.isDirty;
124
+ }
125
+
126
+ get onDirtyChanged(): Event<void> {
127
+ return this.onDirtyChangedEmitter.event;
128
+ }
129
+
130
+ get onContentChanged(): Event<void> {
131
+ return this.onContentChangedEmitter.event;
132
+ }
133
+
134
+ async save(options?: SaveOptions): Promise<void> {
135
+ await Promise.all(this.saveables.map(saveable => saveable.save(options)));
136
+ }
137
+
138
+ async revert(options?: Saveable.RevertOptions): Promise<void> {
139
+ await Promise.all(this.saveables.map(saveable => saveable.revert?.(options)));
140
+ }
141
+
142
+ get saveables(): readonly Saveable[] {
143
+ return Array.from(this.saveablesMap.keys());
144
+ }
145
+
146
+ add(saveable: Saveable): void {
147
+ if (this.saveablesMap.has(saveable)) {
148
+ return;
149
+ }
150
+ const toDispose = new DisposableCollection();
151
+ this.toDispose.push(toDispose);
152
+ this.saveablesMap.set(saveable, toDispose);
153
+ toDispose.push(Disposable.create(() => {
154
+ this.saveablesMap.delete(saveable);
155
+ }));
156
+ toDispose.push(saveable.onDirtyChanged(() => {
157
+ const wasDirty = this.isDirty;
158
+ this.isDirty = this.saveables.some(s => s.dirty);
159
+ if (this.isDirty !== wasDirty) {
160
+ this.onDirtyChangedEmitter.fire();
161
+ }
162
+ }));
163
+ toDispose.push(saveable.onContentChanged(() => {
164
+ this.onContentChangedEmitter.fire();
165
+ }));
166
+ if (saveable.dirty && !this.isDirty) {
167
+ this.isDirty = true;
168
+ this.onDirtyChangedEmitter.fire();
169
+ }
170
+ }
171
+
172
+ remove(saveable: Saveable): boolean {
173
+ const toDispose = this.saveablesMap.get(saveable);
174
+ toDispose?.dispose();
175
+ return !!toDispose;
176
+ }
177
+
178
+ dispose(): void {
179
+ this.toDispose.dispose();
180
+ }
181
+ }
182
+
115
183
  export namespace Saveable {
116
184
  export interface RevertOptions {
117
185
  /**
@@ -15,11 +15,11 @@
15
15
  // *****************************************************************************
16
16
 
17
17
  import { MenuNode, MenuPath } from '../../../common';
18
- import { NAVIGATION, TabBarToolbarItem } from './tab-bar-toolbar-types';
18
+ import { NAVIGATION, RenderedToolbarItem } from './tab-bar-toolbar-types';
19
19
 
20
20
  export const TOOLBAR_WRAPPER_ID_SUFFIX = '-as-tabbar-toolbar-item';
21
21
 
22
- export class ToolbarMenuNodeWrapper implements TabBarToolbarItem {
22
+ export class ToolbarMenuNodeWrapper implements RenderedToolbarItem {
23
23
  constructor(protected readonly menuNode: MenuNode, readonly group?: string, readonly menuPath?: MenuPath) { }
24
24
  get id(): string { return this.menuNode.id + TOOLBAR_WRAPPER_ID_SUFFIX; }
25
25
  get command(): string { return this.menuNode.command ?? ''; };
@@ -17,11 +17,11 @@
17
17
  import debounce = require('lodash.debounce');
18
18
  import { inject, injectable, named } from 'inversify';
19
19
  // eslint-disable-next-line max-len
20
- import { CommandMenuNode, CommandRegistry, CompoundMenuNode, ContributionProvider, Disposable, DisposableCollection, Emitter, Event, MenuModelRegistry, MenuNode, MenuPath } from '../../../common';
20
+ import { CommandRegistry, ContributionProvider, Disposable, DisposableCollection, Emitter, Event, MenuModelRegistry, MenuNode, MenuPath } from '../../../common';
21
21
  import { ContextKeyService } from '../../context-key-service';
22
22
  import { FrontendApplicationContribution } from '../../frontend-application-contribution';
23
23
  import { Widget } from '../../widgets';
24
- import { AnyToolbarItem, ConditionalToolbarItem, MenuDelegate, MenuToolbarItem, ReactTabBarToolbarItem, TabBarToolbarItem } from './tab-bar-toolbar-types';
24
+ import { MenuDelegate, ReactTabBarToolbarItem, RenderedToolbarItem, TabBarToolbarItem } from './tab-bar-toolbar-types';
25
25
  import { ToolbarMenuNodeWrapper } from './tab-bar-toolbar-menu-adapters';
26
26
 
27
27
  /**
@@ -75,7 +75,7 @@ export class TabBarToolbarRegistry implements FrontendApplicationContribution {
75
75
  *
76
76
  * @param item the item to register.
77
77
  */
78
- registerItem(item: TabBarToolbarItem | ReactTabBarToolbarItem): Disposable {
78
+ registerItem(item: RenderedToolbarItem | ReactTabBarToolbarItem): Disposable {
79
79
  const { id } = item;
80
80
  if (this.items.has(id)) {
81
81
  throw new Error(`A toolbar item is already registered with the '${id}' ID.`);
@@ -110,24 +110,17 @@ export class TabBarToolbarRegistry implements FrontendApplicationContribution {
110
110
  for (const delegate of this.menuDelegates.values()) {
111
111
  if (delegate.isVisible(widget)) {
112
112
  const menu = this.menuRegistry.getMenu(delegate.menuPath);
113
- const children = CompoundMenuNode.getFlatChildren(menu.children);
114
- for (const child of children) {
113
+ for (const child of menu.children) {
115
114
  if (!child.when || this.contextKeyService.match(child.when, widget.node)) {
116
115
  if (child.children) {
117
116
  for (const grandchild of child.children) {
118
117
  if (!grandchild.when || this.contextKeyService.match(grandchild.when, widget.node)) {
119
- if (CommandMenuNode.is(grandchild)) {
120
- result.push(new ToolbarMenuNodeWrapper(grandchild, child.id, delegate.menuPath));
121
- } else if (CompoundMenuNode.is(grandchild)) {
122
- let menuPath;
123
- if (menuPath = this.menuRegistry.getPath(grandchild)) {
124
- result.push(new ToolbarMenuNodeWrapper(grandchild, child.id, menuPath));
125
- }
126
- }
118
+ const menuPath = this.menuRegistry.getPath(grandchild);
119
+ result.push(new ToolbarMenuNodeWrapper(grandchild, child.id, menuPath));
127
120
  }
128
121
  }
129
122
  } else if (child.command) {
130
- result.push(new ToolbarMenuNodeWrapper(child, '', delegate.menuPath));
123
+ result.push(new ToolbarMenuNodeWrapper(child, ''));
131
124
  }
132
125
  }
133
126
  }
@@ -145,15 +138,17 @@ export class TabBarToolbarRegistry implements FrontendApplicationContribution {
145
138
  * @returns `false` if the `item` should be suppressed, otherwise `true`
146
139
  */
147
140
  protected isItemVisible(item: TabBarToolbarItem | ReactTabBarToolbarItem, widget: Widget): boolean {
148
- if (TabBarToolbarItem.is(item) && item.command && !this.isTabBarToolbarItemVisible(item, widget)) {
141
+ if (!this.isConditionalItemVisible(item, widget)) {
149
142
  return false;
150
143
  }
151
- if (MenuToolbarItem.is(item) && !this.isMenuToolbarItemVisible(item, widget)) {
144
+
145
+ if (item.command && !this.commandRegistry.isVisible(item.command, widget)) {
152
146
  return false;
153
147
  }
154
- if (AnyToolbarItem.isConditional(item) && !this.isConditionalItemVisible(item, widget)) {
148
+ if (item.menuPath && !this.isNonEmptyMenu(item, widget)) {
155
149
  return false;
156
150
  }
151
+
157
152
  // The item is not vetoed. Accept it
158
153
  return true;
159
154
  }
@@ -166,7 +161,7 @@ export class TabBarToolbarRegistry implements FrontendApplicationContribution {
166
161
  * @param widget the widget that is updating the toolbar
167
162
  * @returns `false` if the `item` should be suppressed, otherwise `true`
168
163
  */
169
- protected isConditionalItemVisible(item: ConditionalToolbarItem, widget: Widget): boolean {
164
+ protected isConditionalItemVisible(item: TabBarToolbarItem, widget: Widget): boolean {
170
165
  if (item.isVisible && !item.isVisible(widget)) {
171
166
  return false;
172
167
  }
@@ -176,19 +171,6 @@ export class TabBarToolbarRegistry implements FrontendApplicationContribution {
176
171
  return true;
177
172
  }
178
173
 
179
- /**
180
- * Query whether a tab-bar toolbar `item` that has a command should be shown in the toolbar.
181
- * This implementation returns `false` if the `item`'s command is not visible in the
182
- * `widget` according to the command registry.
183
- *
184
- * @param item a tab-bar toolbar item that has a non-empty `command`
185
- * @param widget the widget that is updating the toolbar
186
- * @returns `false` if the `item` should be suppressed, otherwise `true`
187
- */
188
- protected isTabBarToolbarItemVisible(item: TabBarToolbarItem, widget: Widget): boolean {
189
- return this.commandRegistry.isVisible(item.command, widget);
190
- }
191
-
192
174
  /**
193
175
  * Query whether a menu toolbar `item` should be shown in the toolbar.
194
176
  * This implementation returns `false` if the `item` does not have any actual menu to show.
@@ -197,7 +179,10 @@ export class TabBarToolbarRegistry implements FrontendApplicationContribution {
197
179
  * @param widget the widget that is updating the toolbar
198
180
  * @returns `false` if the `item` should be suppressed, otherwise `true`
199
181
  */
200
- protected isMenuToolbarItemVisible(item: MenuToolbarItem, widget: Widget): boolean {
182
+ isNonEmptyMenu(item: TabBarToolbarItem, widget: Widget | undefined): boolean {
183
+ if (!item.menuPath) {
184
+ return false;
185
+ }
201
186
  const menu = this.menuRegistry.getMenu(item.menuPath);
202
187
  const isVisible: (node: MenuNode) => boolean = node =>
203
188
  node.children?.length
@@ -220,7 +205,7 @@ export class TabBarToolbarRegistry implements FrontendApplicationContribution {
220
205
  }
221
206
  }
222
207
 
223
- registerMenuDelegate(menuPath: MenuPath, when?: string | ((widget: Widget) => boolean)): Disposable {
208
+ registerMenuDelegate(menuPath: MenuPath, when?: ((widget: Widget) => boolean)): Disposable {
224
209
  const id = this.toElementId(menuPath);
225
210
  if (!this.menuDelegates.has(id)) {
226
211
  const isVisible: MenuDelegate['isVisible'] = !when