@theia/core 1.18.0-next.de7b81be → 1.20.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 (291) hide show
  1. package/LICENSE +642 -0
  2. package/README.md +3 -2
  3. package/lib/browser/about-dialog.d.ts.map +1 -1
  4. package/lib/browser/about-dialog.js +1 -1
  5. package/lib/browser/about-dialog.js.map +1 -1
  6. package/lib/browser/authentication-service.d.ts.map +1 -1
  7. package/lib/browser/authentication-service.js +1 -1
  8. package/lib/browser/authentication-service.js.map +1 -1
  9. package/lib/browser/color-registry.d.ts +3 -69
  10. package/lib/browser/color-registry.d.ts.map +1 -1
  11. package/lib/browser/color-registry.js +13 -27
  12. package/lib/browser/color-registry.js.map +1 -1
  13. package/lib/browser/common-frontend-contribution.d.ts +7 -0
  14. package/lib/browser/common-frontend-contribution.d.ts.map +1 -1
  15. package/lib/browser/common-frontend-contribution.js +138 -121
  16. package/lib/browser/common-frontend-contribution.js.map +1 -1
  17. package/lib/browser/core-preferences.d.ts +2 -0
  18. package/lib/browser/core-preferences.d.ts.map +1 -1
  19. package/lib/browser/core-preferences.js +33 -18
  20. package/lib/browser/core-preferences.js.map +1 -1
  21. package/lib/browser/dialogs.d.ts +6 -0
  22. package/lib/browser/dialogs.d.ts.map +1 -1
  23. package/lib/browser/dialogs.js +10 -3
  24. package/lib/browser/dialogs.js.map +1 -1
  25. package/lib/browser/frontend-application-module.d.ts.map +1 -1
  26. package/lib/browser/frontend-application-module.js +3 -0
  27. package/lib/browser/frontend-application-module.js.map +1 -1
  28. package/lib/browser/frontend-application.d.ts +6 -0
  29. package/lib/browser/frontend-application.d.ts.map +1 -1
  30. package/lib/browser/frontend-application.js +13 -0
  31. package/lib/browser/frontend-application.js.map +1 -1
  32. package/lib/browser/index.d.ts +1 -0
  33. package/lib/browser/index.d.ts.map +1 -1
  34. package/lib/browser/index.js +1 -0
  35. package/lib/browser/index.js.map +1 -1
  36. package/lib/browser/keybinding.spec.js +5 -0
  37. package/lib/browser/keybinding.spec.js.map +1 -1
  38. package/lib/browser/keyboard/browser-keyboard-frontend-contribution.d.ts.map +1 -1
  39. package/lib/browser/keyboard/browser-keyboard-frontend-contribution.js +16 -11
  40. package/lib/browser/keyboard/browser-keyboard-frontend-contribution.js.map +1 -1
  41. package/lib/browser/keyboard/browser-keyboard-layout-provider.d.ts +1 -1
  42. package/lib/browser/keyboard/browser-keyboard-layout-provider.d.ts.map +1 -1
  43. package/lib/browser/keyboard/browser-keyboard-layout-provider.spec.js +6 -4
  44. package/lib/browser/keyboard/browser-keyboard-layout-provider.spec.js.map +1 -1
  45. package/lib/browser/keyboard/keys.d.ts +2 -251
  46. package/lib/browser/keyboard/keys.d.ts.map +1 -1
  47. package/lib/browser/keyboard/keys.js +12 -614
  48. package/lib/browser/keyboard/keys.js.map +1 -1
  49. package/lib/browser/menu/browser-context-menu-renderer.d.ts +1 -1
  50. package/lib/browser/menu/browser-context-menu-renderer.d.ts.map +1 -1
  51. package/lib/browser/menu/browser-menu-plugin.d.ts +3 -0
  52. package/lib/browser/menu/browser-menu-plugin.d.ts.map +1 -1
  53. package/lib/browser/menu/browser-menu-plugin.js +24 -4
  54. package/lib/browser/menu/browser-menu-plugin.js.map +1 -1
  55. package/lib/browser/messaging/ws-connection-provider.d.ts +3 -3
  56. package/lib/browser/messaging/ws-connection-provider.d.ts.map +1 -1
  57. package/lib/browser/messaging/ws-connection-provider.js +14 -4
  58. package/lib/browser/messaging/ws-connection-provider.js.map +1 -1
  59. package/lib/browser/{nls.d.ts → nls-loader.d.ts} +1 -6
  60. package/lib/browser/nls-loader.d.ts.map +1 -0
  61. package/lib/browser/nls-loader.js +29 -0
  62. package/lib/browser/nls-loader.js.map +1 -0
  63. package/lib/browser/progress-status-bar-item.d.ts +1 -2
  64. package/lib/browser/progress-status-bar-item.d.ts.map +1 -1
  65. package/lib/browser/progress-status-bar-item.js.map +1 -1
  66. package/lib/browser/quick-input/quick-command-frontend-contribution.d.ts.map +1 -1
  67. package/lib/browser/quick-input/quick-command-frontend-contribution.js +2 -1
  68. package/lib/browser/quick-input/quick-command-frontend-contribution.js.map +1 -1
  69. package/lib/browser/quick-input/quick-command-service.d.ts.map +1 -1
  70. package/lib/browser/quick-input/quick-command-service.js +2 -2
  71. package/lib/browser/quick-input/quick-command-service.js.map +1 -1
  72. package/lib/browser/quick-input/quick-input-service.d.ts +1 -201
  73. package/lib/browser/quick-input/quick-input-service.d.ts.map +1 -1
  74. package/lib/browser/quick-input/quick-input-service.js +11 -93
  75. package/lib/browser/quick-input/quick-input-service.js.map +1 -1
  76. package/lib/browser/quick-input/quick-view-service.d.ts +1 -2
  77. package/lib/browser/quick-input/quick-view-service.d.ts.map +1 -1
  78. package/lib/browser/quick-input/quick-view-service.js.map +1 -1
  79. package/lib/browser/shell/application-shell.d.ts +3 -1
  80. package/lib/browser/shell/application-shell.d.ts.map +1 -1
  81. package/lib/browser/shell/application-shell.js +1 -2
  82. package/lib/browser/shell/application-shell.js.map +1 -1
  83. package/lib/browser/shell/shell-layout-restorer.d.ts.map +1 -1
  84. package/lib/browser/shell/shell-layout-restorer.js +5 -3
  85. package/lib/browser/shell/shell-layout-restorer.js.map +1 -1
  86. package/lib/browser/shell/tab-bar-decorator.d.ts +1 -1
  87. package/lib/browser/shell/tab-bar-decorator.d.ts.map +1 -1
  88. package/lib/browser/shell/tab-bar-decorator.js.map +1 -1
  89. package/lib/browser/shell/tab-bar-toolbar.d.ts.map +1 -1
  90. package/lib/browser/shell/tab-bar-toolbar.js +2 -1
  91. package/lib/browser/shell/tab-bar-toolbar.js.map +1 -1
  92. package/lib/browser/shell/tab-bars.d.ts +14 -1
  93. package/lib/browser/shell/tab-bars.d.ts.map +1 -1
  94. package/lib/browser/shell/tab-bars.js +99 -7
  95. package/lib/browser/shell/tab-bars.js.map +1 -1
  96. package/lib/browser/status-bar/status-bar.d.ts +3 -1
  97. package/lib/browser/status-bar/status-bar.d.ts.map +1 -1
  98. package/lib/browser/status-bar/status-bar.js +16 -2
  99. package/lib/browser/status-bar/status-bar.js.map +1 -1
  100. package/lib/browser/storage-service.spec.js +1 -1
  101. package/lib/browser/storage-service.spec.js.map +1 -1
  102. package/lib/browser/theming.d.ts +5 -14
  103. package/lib/browser/theming.d.ts.map +1 -1
  104. package/lib/browser/theming.js +14 -0
  105. package/lib/browser/theming.js.map +1 -1
  106. package/lib/browser/tooltip-service.d.ts +52 -0
  107. package/lib/browser/tooltip-service.d.ts.map +1 -0
  108. package/lib/browser/tooltip-service.js +89 -0
  109. package/lib/browser/tooltip-service.js.map +1 -0
  110. package/lib/browser/tree/tree-model.d.ts.map +1 -1
  111. package/lib/browser/tree/tree-widget.js +1 -1
  112. package/lib/browser/view-container.d.ts +55 -14
  113. package/lib/browser/view-container.d.ts.map +1 -1
  114. package/lib/browser/view-container.js +284 -66
  115. package/lib/browser/view-container.js.map +1 -1
  116. package/lib/browser/window/default-window-service.js +2 -2
  117. package/lib/browser/window/default-window-service.js.map +1 -1
  118. package/lib/browser/window/window-service.d.ts +1 -7
  119. package/lib/browser/window/window-service.d.ts.map +1 -1
  120. package/lib/browser/window/window-service.js +1 -5
  121. package/lib/browser/window/window-service.js.map +1 -1
  122. package/lib/browser/window-contribution.d.ts.map +1 -1
  123. package/lib/browser/window-contribution.js +2 -2
  124. package/lib/browser/window-contribution.js.map +1 -1
  125. package/lib/common/cancellation.d.ts +3 -0
  126. package/lib/common/cancellation.d.ts.map +1 -1
  127. package/lib/common/cancellation.js +8 -1
  128. package/lib/common/cancellation.js.map +1 -1
  129. package/lib/common/color.d.ts +84 -0
  130. package/lib/common/color.d.ts.map +1 -0
  131. package/lib/common/color.js +44 -0
  132. package/lib/common/color.js.map +1 -0
  133. package/lib/common/command.d.ts +1 -0
  134. package/lib/common/command.d.ts.map +1 -1
  135. package/lib/common/command.js +5 -1
  136. package/lib/common/command.js.map +1 -1
  137. package/lib/common/i18n/localization.d.ts +14 -0
  138. package/lib/common/i18n/localization.d.ts.map +1 -1
  139. package/lib/common/i18n/localization.js +54 -1
  140. package/lib/common/i18n/localization.js.map +1 -1
  141. package/lib/common/index.d.ts +1 -0
  142. package/lib/common/index.d.ts.map +1 -1
  143. package/lib/common/index.js +1 -0
  144. package/lib/common/index.js.map +1 -1
  145. package/lib/common/keys.d.ts +269 -0
  146. package/lib/common/keys.d.ts.map +1 -0
  147. package/lib/common/keys.js +634 -0
  148. package/lib/common/keys.js.map +1 -0
  149. package/lib/common/messaging/abstract-connection-provider.d.ts +1 -1
  150. package/lib/common/messaging/abstract-connection-provider.d.ts.map +1 -1
  151. package/lib/common/messaging/abstract-connection-provider.js +3 -1
  152. package/lib/common/messaging/abstract-connection-provider.js.map +1 -1
  153. package/lib/common/messaging/proxy-factory.js +1 -1
  154. package/lib/common/messaging/proxy-factory.js.map +1 -1
  155. package/lib/common/nls.d.ts +28 -0
  156. package/lib/common/nls.d.ts.map +1 -0
  157. package/lib/common/nls.js +91 -0
  158. package/lib/common/nls.js.map +1 -0
  159. package/lib/common/path.d.ts +6 -0
  160. package/lib/common/path.d.ts.map +1 -1
  161. package/lib/common/path.js +16 -4
  162. package/lib/common/path.js.map +1 -1
  163. package/lib/common/path.spec.js +12 -0
  164. package/lib/common/path.spec.js.map +1 -1
  165. package/lib/common/promise-util.d.ts +2 -2
  166. package/lib/common/promise-util.d.ts.map +1 -1
  167. package/lib/common/promise-util.js.map +1 -1
  168. package/lib/common/quick-pick-service.d.ts +219 -1
  169. package/lib/common/quick-pick-service.d.ts.map +1 -1
  170. package/lib/common/quick-pick-service.js +108 -1
  171. package/lib/common/quick-pick-service.js.map +1 -1
  172. package/lib/common/theme.d.ts +30 -0
  173. package/lib/common/theme.d.ts.map +1 -0
  174. package/lib/common/theme.js +18 -0
  175. package/lib/common/theme.js.map +1 -0
  176. package/lib/common/window.d.ts +29 -0
  177. package/lib/common/window.d.ts.map +1 -0
  178. package/lib/common/window.js +23 -0
  179. package/lib/common/window.js.map +1 -0
  180. package/lib/electron-browser/menu/electron-context-menu-renderer.d.ts +9 -5
  181. package/lib/electron-browser/menu/electron-context-menu-renderer.d.ts.map +1 -1
  182. package/lib/electron-browser/menu/electron-context-menu-renderer.js +40 -15
  183. package/lib/electron-browser/menu/electron-context-menu-renderer.js.map +1 -1
  184. package/lib/electron-browser/menu/electron-main-menu-factory.d.ts +5 -8
  185. package/lib/electron-browser/menu/electron-main-menu-factory.d.ts.map +1 -1
  186. package/lib/electron-browser/menu/electron-main-menu-factory.js +10 -17
  187. package/lib/electron-browser/menu/electron-main-menu-factory.js.map +1 -1
  188. package/lib/electron-browser/menu/electron-menu-contribution.d.ts +15 -7
  189. package/lib/electron-browser/menu/electron-menu-contribution.d.ts.map +1 -1
  190. package/lib/electron-browser/menu/electron-menu-contribution.js +112 -42
  191. package/lib/electron-browser/menu/electron-menu-contribution.js.map +1 -1
  192. package/lib/electron-browser/window/electron-window-preferences.d.ts +1 -0
  193. package/lib/electron-browser/window/electron-window-preferences.d.ts.map +1 -1
  194. package/lib/electron-browser/window/electron-window-preferences.js +12 -1
  195. package/lib/electron-browser/window/electron-window-preferences.js.map +1 -1
  196. package/lib/electron-browser/window/electron-window-service.d.ts +1 -1
  197. package/lib/electron-browser/window/electron-window-service.d.ts.map +1 -1
  198. package/lib/electron-common/electron-main-window-service.d.ts +1 -1
  199. package/lib/electron-common/electron-main-window-service.d.ts.map +1 -1
  200. package/lib/electron-common/messaging/electron-messages.d.ts +20 -0
  201. package/lib/electron-common/messaging/electron-messages.d.ts.map +1 -0
  202. package/lib/electron-common/messaging/electron-messages.js +23 -0
  203. package/lib/electron-common/messaging/electron-messages.js.map +1 -0
  204. package/lib/electron-main/electron-main-application.d.ts +6 -0
  205. package/lib/electron-main/electron-main-application.d.ts.map +1 -1
  206. package/lib/electron-main/electron-main-application.js +80 -23
  207. package/lib/electron-main/electron-main-application.js.map +1 -1
  208. package/lib/electron-main/electron-main-window-service-impl.d.ts +1 -1
  209. package/lib/electron-main/electron-main-window-service-impl.d.ts.map +1 -1
  210. package/lib/electron-main/messaging/electron-messaging-contribution.d.ts +1 -1
  211. package/lib/electron-main/messaging/electron-messaging-contribution.d.ts.map +1 -1
  212. package/lib/electron-main/messaging/electron-messaging-contribution.js +1 -2
  213. package/lib/electron-main/messaging/electron-messaging-contribution.js.map +1 -1
  214. package/package.json +13 -9
  215. package/shared/@theia/application-package/lib/api.d.ts +1 -0
  216. package/shared/@theia/application-package/lib/api.js +1 -0
  217. package/src/browser/about-dialog.tsx +2 -2
  218. package/src/browser/authentication-service.ts +1 -2
  219. package/src/browser/color-registry.ts +3 -85
  220. package/src/browser/common-frontend-contribution.ts +116 -99
  221. package/src/browser/core-preferences.ts +37 -18
  222. package/src/browser/dialogs.ts +10 -3
  223. package/src/browser/frontend-application-module.ts +4 -0
  224. package/src/browser/frontend-application.ts +13 -0
  225. package/src/browser/index.ts +1 -0
  226. package/src/browser/keybinding.spec.ts +8 -1
  227. package/src/browser/keyboard/browser-keyboard-frontend-contribution.ts +16 -11
  228. package/src/browser/keyboard/browser-keyboard-layout-provider.spec.ts +10 -4
  229. package/src/browser/keyboard/keys.ts +2 -675
  230. package/src/browser/menu/browser-context-menu-renderer.ts +1 -1
  231. package/src/browser/menu/browser-menu-plugin.ts +25 -5
  232. package/src/browser/messaging/ws-connection-provider.ts +13 -4
  233. package/src/browser/nls-loader.ts +26 -0
  234. package/src/browser/progress-status-bar-item.ts +1 -2
  235. package/src/browser/quick-input/quick-command-frontend-contribution.ts +2 -2
  236. package/src/browser/quick-input/quick-command-service.ts +2 -2
  237. package/src/browser/quick-input/quick-input-service.ts +1 -278
  238. package/src/browser/quick-input/quick-view-service.ts +1 -2
  239. package/src/browser/shell/application-shell.ts +4 -3
  240. package/src/browser/shell/shell-layout-restorer.ts +4 -3
  241. package/src/browser/shell/tab-bar-decorator.ts +1 -1
  242. package/src/browser/shell/tab-bar-toolbar.tsx +3 -1
  243. package/src/browser/shell/tab-bars.ts +103 -8
  244. package/src/browser/status-bar/status-bar.tsx +16 -1
  245. package/src/browser/storage-service.spec.ts +1 -1
  246. package/src/browser/style/alert-messages.css +1 -0
  247. package/src/browser/style/index.css +5 -0
  248. package/src/browser/style/menus.css +10 -1
  249. package/src/browser/style/sidepanel.css +9 -3
  250. package/src/browser/style/tabs.css +30 -0
  251. package/src/browser/style/tooltip.css +28 -0
  252. package/src/browser/style/view-container.css +9 -9
  253. package/src/browser/theming.ts +6 -17
  254. package/src/browser/tooltip-service.tsx +98 -0
  255. package/src/browser/tree/tree-model.ts +1 -1
  256. package/src/browser/tree/tree-widget.tsx +1 -1
  257. package/src/browser/view-container.ts +312 -80
  258. package/src/browser/window/default-window-service.ts +2 -2
  259. package/src/browser/window/window-service.ts +1 -9
  260. package/src/browser/window-contribution.ts +2 -2
  261. package/src/common/cancellation.ts +7 -0
  262. package/src/common/color.ts +100 -0
  263. package/src/common/command.ts +11 -1
  264. package/src/common/i18n/localization.ts +54 -0
  265. package/src/common/i18n/nls.metadata.json +20421 -0
  266. package/src/common/index.ts +1 -0
  267. package/src/common/keys.ts +693 -0
  268. package/src/common/messaging/abstract-connection-provider.ts +3 -1
  269. package/src/common/messaging/proxy-factory.ts +1 -1
  270. package/src/common/nls.ts +104 -0
  271. package/src/common/path.spec.ts +15 -0
  272. package/src/common/path.ts +16 -4
  273. package/src/common/promise-util.ts +3 -3
  274. package/src/common/quick-pick-service.ts +299 -3
  275. package/src/common/theme.ts +32 -0
  276. package/src/common/window.ts +30 -0
  277. package/src/electron-browser/menu/electron-context-menu-renderer.ts +38 -16
  278. package/src/electron-browser/menu/electron-main-menu-factory.ts +10 -15
  279. package/src/electron-browser/menu/electron-menu-contribution.ts +129 -39
  280. package/src/electron-browser/menu/electron-menu-style.css +84 -0
  281. package/src/electron-browser/window/electron-window-preferences.ts +13 -1
  282. package/src/electron-browser/window/electron-window-service.ts +1 -1
  283. package/src/electron-common/electron-main-window-service.ts +1 -1
  284. package/src/electron-common/messaging/electron-messages.ts +20 -0
  285. package/src/electron-main/electron-main-application.ts +86 -20
  286. package/src/electron-main/electron-main-window-service-impl.ts +1 -1
  287. package/src/electron-main/messaging/electron-messaging-contribution.ts +1 -2
  288. package/lib/browser/nls.d.ts.map +0 -1
  289. package/lib/browser/nls.js +0 -64
  290. package/lib/browser/nls.js.map +0 -1
  291. package/src/browser/nls.ts +0 -65
@@ -18,7 +18,7 @@ import { injectable, inject } from 'inversify';
18
18
  import { MenuBar, Menu as MenuWidget, Widget } from '@phosphor/widgets';
19
19
  import { CommandRegistry as PhosphorCommandRegistry } from '@phosphor/commands';
20
20
  import {
21
- CommandRegistry, ActionMenuNode, CompositeMenuNode,
21
+ CommandRegistry, ActionMenuNode, CompositeMenuNode, environment,
22
22
  MenuModelRegistry, MAIN_MENU_BAR, MenuPath, DisposableCollection, Disposable, MenuNode
23
23
  } from '../../common';
24
24
  import { KeybindingRegistry } from '../keybinding';
@@ -28,6 +28,7 @@ import { ContextMenuContext } from './context-menu-context';
28
28
  import { waitForRevealed } from '../widgets';
29
29
  import { ApplicationShell } from '../shell';
30
30
  import { CorePreferences } from '../core-preferences';
31
+ import { PreferenceService } from '../preferences/preference-service';
31
32
 
32
33
  export abstract class MenuBarWidget extends MenuBar {
33
34
  abstract activateMenu(label: string, ...labels: string[]): Promise<MenuWidget>;
@@ -371,21 +372,40 @@ export class BrowserMenuBarContribution implements FrontendApplicationContributi
371
372
  @inject(ApplicationShell)
372
373
  protected readonly shell: ApplicationShell;
373
374
 
375
+ @inject(PreferenceService)
376
+ protected readonly preferenceService: PreferenceService;
377
+
374
378
  constructor(
375
379
  @inject(BrowserMainMenuFactory) protected readonly factory: BrowserMainMenuFactory
376
380
  ) { }
377
381
 
378
382
  onStart(app: FrontendApplication): void {
379
- const logo = this.createLogo();
380
- app.shell.addWidget(logo, { area: 'top' });
381
- const menu = this.factory.createMenuBar();
382
- app.shell.addWidget(menu, { area: 'top' });
383
+ this.appendMenu(app.shell);
383
384
  }
384
385
 
385
386
  get menuBar(): MenuBarWidget | undefined {
386
387
  return this.shell.topPanel.widgets.find(w => w instanceof MenuBarWidget) as MenuBarWidget | undefined;
387
388
  }
388
389
 
390
+ protected appendMenu(shell: ApplicationShell): void {
391
+ const logo = this.createLogo();
392
+ shell.addWidget(logo, { area: 'top' });
393
+ const menu = this.factory.createMenuBar();
394
+ shell.addWidget(menu, { area: 'top' });
395
+ // Hiding the menu is only necessary in electron
396
+ // In the browser we hide the whole top panel
397
+ if (environment.electron.is()) {
398
+ this.preferenceService.ready.then(() => {
399
+ menu.setHidden(['compact', 'hidden'].includes(this.preferenceService.get('window.menuBarVisibility', '')));
400
+ });
401
+ this.preferenceService.onPreferenceChanged(change => {
402
+ if (change.preferenceName === 'window.menuBarVisibility') {
403
+ menu.setHidden(['compact', 'hidden'].includes(change.newValue));
404
+ }
405
+ });
406
+ }
407
+ }
408
+
389
409
  protected createLogo(): Widget {
390
410
  const logo = new Widget();
391
411
  logo.id = 'theia:icon';
@@ -59,13 +59,19 @@ export const DEFAULT_HTTP_FALLBACK_OPTIONS: HttpFallbackOptions = {
59
59
  export class WebSocketConnectionProvider extends AbstractConnectionProvider<WebSocketOptions> {
60
60
 
61
61
  protected readonly onSocketDidOpenEmitter: Emitter<void> = new Emitter();
62
- readonly onSocketDidOpen: Event<void> = this.onSocketDidOpenEmitter.event;
62
+ get onSocketDidOpen(): Event<void> {
63
+ return this.onSocketDidOpenEmitter.event;
64
+ }
63
65
 
64
66
  protected readonly onSocketDidCloseEmitter: Emitter<void> = new Emitter();
65
- readonly onSocketDidClose: Event<void> = this.onSocketDidCloseEmitter.event;
67
+ get onSocketDidClose(): Event<void> {
68
+ return this.onSocketDidCloseEmitter.event;
69
+ }
66
70
 
67
71
  protected readonly onHttpFallbackDidActivateEmitter: Emitter<void> = new Emitter();
68
- readonly onHttpFallbackDidActivate: Event<void> = this.onHttpFallbackDidActivateEmitter.event;
72
+ get onHttpFallbackDidActivate(): Event<void> {
73
+ return this.onHttpFallbackDidActivateEmitter.event;
74
+ }
69
75
 
70
76
  static createProxy<T extends object>(container: interfaces.Container, path: string, arg?: object): JsonRpcProxy<T> {
71
77
  return container.get(WebSocketConnectionProvider).createProxy<T>(path, arg);
@@ -98,7 +104,6 @@ export class WebSocketConnectionProvider extends AbstractConnectionProvider<WebS
98
104
  this.fireSocketDidClose();
99
105
  };
100
106
  socket.onmessage = ({ data }) => {
101
- this.websocketErrorCounter = 0;
102
107
  this.handleIncomingRawMessage(data);
103
108
  };
104
109
  this.socket = socket;
@@ -218,6 +223,10 @@ export class WebSocketConnectionProvider extends AbstractConnectionProvider<WebS
218
223
  }
219
224
 
220
225
  protected fireSocketDidOpen(): void {
226
+ // Once a websocket connection has opened, disable the http fallback
227
+ if (this.httpFallbackOptions?.allowed) {
228
+ this.httpFallbackOptions.allowed = false;
229
+ }
221
230
  this.onSocketDidOpenEmitter.fire(undefined);
222
231
  }
223
232
 
@@ -0,0 +1,26 @@
1
+ /********************************************************************************
2
+ * Copyright (C) 2021 TypeFox and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0.
7
+ *
8
+ * This Source Code may also be made available under the following Secondary
9
+ * Licenses when the conditions for such availability set forth in the Eclipse
10
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ * with the GNU Classpath Exception which is available at
12
+ * https://www.gnu.org/software/classpath/license.html.
13
+ *
14
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
+ ********************************************************************************/
16
+
17
+ import { nls } from '../common/nls';
18
+ import { Endpoint } from './endpoint';
19
+
20
+ export async function loadTranslations(): Promise<void> {
21
+ if (nls.locale) {
22
+ const endpoint = new Endpoint({ path: '/i18n/' + nls.locale }).getRestUrl().toString();
23
+ const response = await fetch(endpoint);
24
+ nls.localization = await response.json();
25
+ }
26
+ }
@@ -16,8 +16,7 @@
16
16
 
17
17
  import { injectable, inject } from 'inversify';
18
18
  import { CancellationToken } from 'vscode-ws-jsonrpc';
19
- import { ProgressClient } from '../common';
20
- import { ProgressMessage, ProgressUpdate } from '../common';
19
+ import { ProgressClient, ProgressMessage, ProgressUpdate } from '../common';
21
20
  import { StatusBar, StatusBarAlignment } from './status-bar';
22
21
  import { Deferred } from '../common/promise-util';
23
22
  import throttle = require('lodash.throttle');
@@ -14,7 +14,7 @@
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
16
  import { injectable, inject, optional } from 'inversify';
17
- import { CommandRegistry, CommandContribution, MenuContribution, MenuModelRegistry } from '../../common';
17
+ import { CommandRegistry, CommandContribution, MenuContribution, MenuModelRegistry, nls } from '../../common';
18
18
  import { KeybindingRegistry, KeybindingContribution } from '../keybinding';
19
19
  import { CommonMenus } from '../common-frontend-contribution';
20
20
  import { CLEAR_COMMAND_HISTORY, quickCommand, QuickCommandService } from './quick-command-service';
@@ -43,7 +43,7 @@ export class QuickCommandFrontendContribution implements CommandContribution, Ke
43
43
  registerMenus(menus: MenuModelRegistry): void {
44
44
  menus.registerMenuAction(CommonMenus.VIEW_PRIMARY, {
45
45
  commandId: quickCommand.id,
46
- label: 'Find Command...'
46
+ label: nls.localizeByDefault('Command Palette...')
47
47
  });
48
48
  }
49
49
 
@@ -28,10 +28,10 @@ export const quickCommand: Command = {
28
28
  id: 'workbench.action.showCommands'
29
29
  };
30
30
 
31
- export const CLEAR_COMMAND_HISTORY: Command = {
31
+ export const CLEAR_COMMAND_HISTORY = Command.toDefaultLocalizedCommand({
32
32
  id: 'clear.command.history',
33
33
  label: 'Clear Command History'
34
- };
34
+ });
35
35
 
36
36
  @injectable()
37
37
  export class QuickCommandService implements QuickAccessContribution, QuickAccessProvider {
@@ -14,281 +14,4 @@
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
16
 
17
- import { CancellationToken, Event } from '../../common';
18
- import URI from '../../common/uri';
19
- import { KeySequence } from '../keyboard';
20
- import * as fuzzy from 'fuzzy';
21
-
22
- export interface Match {
23
- start: number;
24
- end: number;
25
- }
26
- export interface QuickPickItemHighlights {
27
- label?: Match[];
28
- description?: Match[];
29
- detail?: Match[];
30
- }
31
-
32
- export interface QuickPickItem {
33
- type?: 'item' | 'separator';
34
- id?: string;
35
- label: string;
36
- meta?: string;
37
- ariaLabel?: string;
38
- description?: string;
39
- detail?: string;
40
- keySequence?: KeySequence;
41
- iconClasses?: string[];
42
- alwaysShow?: boolean;
43
- highlights?: QuickPickItemHighlights;
44
- buttons?: QuickInputButton[];
45
- execute?: () => void;
46
- }
47
-
48
- export namespace QuickPickItem {
49
- export function is(item: QuickPickSeparator | QuickPickItem): item is QuickPickItem {
50
- // if it's not a separator, it's an item
51
- return item.type !== 'separator';
52
- }
53
- }
54
-
55
- export interface QuickPickSeparator {
56
- type: 'separator';
57
- label?: string;
58
- }
59
-
60
- export namespace QuickPickSeparator {
61
- export function is(item: QuickPickSeparator | QuickPickItem): item is QuickPickSeparator {
62
- return item.type === 'separator';
63
- }
64
- }
65
-
66
- export type QuickPicks = (QuickPickSeparator | QuickPickItem)[];
67
-
68
- export interface QuickPickValue<V> extends QuickPickItem {
69
- value: V
70
- }
71
-
72
- export interface QuickInputButton {
73
- iconPath?: URI | { light: URI; dark: URI } | { id: string };
74
- iconClass?: string;
75
- tooltip?: string;
76
- }
77
-
78
- export interface QuickInputButtonHandle extends QuickInputButton {
79
- index: number; // index of where they are in buttons array if QuickInputButton or -1 if QuickInputButtons.Back
80
- }
81
-
82
- export interface QuickInput {
83
- readonly onDidHide: Event<void>;
84
- readonly onDispose: Event<void>;
85
- title: string | undefined;
86
- description: string | undefined;
87
- step: number | undefined;
88
- totalSteps: number | undefined;
89
- enabled: boolean;
90
- contextKey: string | undefined;
91
- busy: boolean;
92
- ignoreFocusOut: boolean;
93
- show(): void;
94
- hide(): void;
95
- dispose(): void;
96
- }
97
-
98
- export interface InputBox extends QuickInput {
99
- value: string | undefined;
100
- valueSelection: Readonly<[number, number]> | undefined;
101
- placeholder: string | undefined;
102
- password: boolean;
103
- readonly onDidChangeValue: Event<string>;
104
- readonly onDidAccept: Event<void>;
105
- buttons: ReadonlyArray<QuickInputButton>;
106
- readonly onDidTriggerButton: Event<QuickInputButton>;
107
- prompt: string | undefined;
108
- validationMessage: string | undefined;
109
- }
110
-
111
- export interface QuickPick<T extends QuickPickItem> extends QuickInput {
112
- value: string;
113
- placeholder: string | undefined;
114
- items: ReadonlyArray<T | QuickPickSeparator>;
115
- activeItems: ReadonlyArray<T>;
116
- selectedItems: ReadonlyArray<T>;
117
- canSelectMany: boolean;
118
- matchOnDescription: boolean;
119
- matchOnDetail: boolean;
120
- readonly onDidAccept: Event<void>;
121
- readonly onDidChangeValue: Event<string>;
122
- readonly onDidTriggerButton: Event<QuickInputButton>;
123
- readonly onDidTriggerItemButton: Event<QuickPickItemButtonEvent<T>>;
124
- readonly onDidChangeActive: Event<T[]>;
125
- readonly onDidChangeSelection: Event<T[]>;
126
- }
127
-
128
- export interface PickOptions<T extends QuickPickItem> {
129
- placeHolder?: string;
130
- matchOnDescription?: boolean;
131
- matchOnDetail?: boolean;
132
- matchOnLabel?: boolean;
133
- autoFocusOnList?: boolean;
134
- ignoreFocusLost?: boolean;
135
- canPickMany?: boolean;
136
- contextKey?: string;
137
- activeItem?: Promise<T> | T;
138
- onDidFocus?: (entry: T) => void;
139
- }
140
-
141
- export interface InputOptions {
142
- value?: string;
143
- valueSelection?: [number, number];
144
- prompt?: string;
145
- placeHolder?: string;
146
- password?: boolean;
147
- ignoreFocusLost?: boolean;
148
- validateInput?(input: string): Promise<string | null | undefined> | undefined;
149
- }
150
-
151
- export interface QuickPickItemButtonEvent<T extends QuickPickItem> {
152
- button: QuickInputButton;
153
- item: T;
154
- }
155
-
156
- export interface QuickPickOptions<T extends QuickPickItem> {
157
- busy?: boolean;
158
- enabled?: boolean;
159
- title?: string;
160
- description?: string;
161
- value?: string;
162
- filterValue?: (value: string) => string;
163
- ariaLabel?: string;
164
- buttons?: Array<QuickInputButton>;
165
- placeholder?: string;
166
- canAcceptInBackground?: boolean;
167
- customButton?: boolean;
168
- customLabel?: string;
169
- customHover?: string;
170
- canSelectMany?: boolean;
171
- matchOnDescription?: boolean;
172
- matchOnDetail?: boolean;
173
- matchOnLabel?: boolean;
174
- sortByLabel?: boolean;
175
- autoFocusOnList?: boolean;
176
- ignoreFocusOut?: boolean;
177
- valueSelection?: Readonly<[number, number]>;
178
- validationMessage?: string;
179
- hideInput?: boolean;
180
- hideCheckAll?: boolean;
181
- runIfSingle?: boolean
182
- contextKey?: string;
183
- activeItem?: T,
184
- step?: number;
185
- totalSteps?: number;
186
-
187
- onDidAccept?: () => void,
188
- onDidChangeActive?: (quickPick: QuickPick<T>, activeItems: Array<T>) => void,
189
- onDidChangeSelection?: (quickPick: QuickPick<T>, selectedItems: Array<T>) => void,
190
- onDidChangeValue?: (quickPick: QuickPick<T>, filter: string) => void,
191
- onDidCustom?: () => void,
192
- onDidHide?: () => void;
193
- onDidTriggerButton?: (button: QuickInputButton) => void,
194
- onDidTriggerItemButton?: (ItemButtonEvent: QuickPickItemButtonEvent<T>) => void
195
- }
196
-
197
- export const QuickInputService = Symbol('QuickInputService');
198
- export interface QuickInputService {
199
- readonly backButton: QuickInputButton;
200
- readonly onShow: Event<void>;
201
- readonly onHide: Event<void>;
202
- open(filter: string): void;
203
- createInputBox(): InputBox;
204
- input(options?: InputOptions, token?: CancellationToken): Promise<string | undefined>;
205
- pick<T extends QuickPickItem, O extends PickOptions<T>>(picks: Promise<T[]> | T[], options?: O, token?: CancellationToken):
206
- Promise<(O extends { canPickMany: true } ? T[] : T) | undefined>;
207
- showQuickPick<T extends QuickPickItem>(items: Array<T>, options?: QuickPickOptions<T>): Promise<T>;
208
- hide(): void;
209
- /**
210
- * Provides raw access to the quick pick controller.
211
- */
212
- createQuickPick<T extends QuickPickItem>(): QuickPick<T>;
213
- }
214
-
215
- /**
216
- * Filter the list of quick pick items based on the provided filter.
217
- * Items are filtered based on if:
218
- * - their `label` satisfies the filter using `fuzzy`.
219
- * - their `description` satisfies the filter using `fuzzy`.
220
- * - their `detail` satisfies the filter using `fuzzy`.
221
- * Filtered items are also updated to display proper highlights based on how they were filtered.
222
- * @param items the list of quick pick items.
223
- * @param filter the filter to search for.
224
- * @returns the list of quick pick items that satisfy the filter.
225
- */
226
- export function filterItems(items: QuickPickItem[], filter: string): QuickPickItem[] {
227
- filter = filter.trim().toLowerCase();
228
-
229
- if (filter.length === 0) {
230
- for (const item of items) {
231
- item.highlights = undefined; // reset highlights from previous filtering.
232
- }
233
- return items;
234
- }
235
-
236
- const filteredItems: QuickPickItem[] = [];
237
- for (const item of items) {
238
- if (
239
- fuzzy.test(filter, item.label) ||
240
- (item.description && fuzzy.test(filter, item.description)) ||
241
- (item.detail && fuzzy.test(filter, item.detail))
242
- ) {
243
- item.highlights = {
244
- label: findMatches(item.label, filter),
245
- description: item.description ? findMatches(item.description, filter) : undefined,
246
- detail: item.detail ? findMatches(item.detail, filter) : undefined
247
- };
248
- filteredItems.push(item);
249
- }
250
- }
251
- return filteredItems;
252
- }
253
-
254
- /**
255
- * Find match highlights when testing a word against a pattern.
256
- * @param word the word to test.
257
- * @param pattern the word to match against.
258
- * @returns the list of highlights if present.
259
- */
260
- export function findMatches(word: string, pattern: string): Array<{ start: number, end: number }> | undefined {
261
- word = word.toLocaleLowerCase();
262
- pattern = pattern.toLocaleLowerCase();
263
-
264
- if (pattern.trim().length === 0) {
265
- return undefined;
266
- }
267
-
268
- const delimiter = '\u0000'; // null byte that shouldn't appear in the input and is used to denote matches.
269
- const matchResult = fuzzy.match(pattern.replace(/\u0000/gu, ''), word, { pre: delimiter, post: delimiter });
270
- if (!matchResult) {
271
- return undefined;
272
- }
273
-
274
- const match = matchResult.rendered;
275
- const highlights: { start: number, end: number }[] = [];
276
-
277
- let lastIndex = 0;
278
- /** We need to account for the extra markers by removing them from the range */
279
- let offset = 0;
280
-
281
- while (true) {
282
- const start = match.indexOf(delimiter, lastIndex);
283
- if (start === -1) { break; }
284
- const end = match.indexOf(delimiter, start + 1);
285
- if (end === -1) { break; }
286
- highlights.push({
287
- start: start - offset++,
288
- end: end - offset++
289
- });
290
- lastIndex = end + 1;
291
- }
292
-
293
- return highlights.length > 0 ? highlights : undefined;
294
- }
17
+ export * from '../../common/quick-pick-service';
@@ -18,8 +18,7 @@ import { inject, injectable } from 'inversify';
18
18
  import { filterItems, QuickPickItem, QuickPicks } from '..';
19
19
  import { CancellationToken, Disposable } from '../../common';
20
20
  import { ContextKeyService } from '../context-key-service';
21
- import { QuickAccessProvider, QuickAccessRegistry } from './quick-access';
22
- import { QuickAccessContribution } from './quick-access';
21
+ import { QuickAccessContribution, QuickAccessProvider, QuickAccessRegistry } from './quick-access';
23
22
 
24
23
  export interface QuickViewItem {
25
24
  readonly label: string;
@@ -23,7 +23,7 @@ import {
23
23
  } from '@phosphor/widgets';
24
24
  import { Message } from '@phosphor/messaging';
25
25
  import { IDragEvent } from '@phosphor/dragdrop';
26
- import { RecursivePartial, Event as CommonEvent, DisposableCollection, Disposable } from '../../common';
26
+ import { RecursivePartial, Event as CommonEvent, DisposableCollection, Disposable, environment } from '../../common';
27
27
  import { animationFrame } from '../browser';
28
28
  import { Saveable, SaveableWidget, SaveOptions } from '../saveable';
29
29
  import { StatusBarImpl, StatusBarEntry, StatusBarAlignment } from '../status-bar/status-bar';
@@ -37,7 +37,6 @@ import { ContextKeyService } from '../context-key-service';
37
37
  import { Emitter } from '../../common/event';
38
38
  import { waitForRevealed, waitForClosed } from '../widgets';
39
39
  import { CorePreferences } from '../core-preferences';
40
- import { environment } from '../../common';
41
40
  import { BreadcrumbsRendererFactory } from '../breadcrumbs/breadcrumbs-renderer';
42
41
 
43
42
  /** The class name added to ApplicationShell instances. */
@@ -59,7 +58,9 @@ export type ApplicationShellLayoutVersion =
59
58
  /** git history view is replaced by a more generic scm history view, backward compatible to 3.0 */
60
59
  4.0 |
61
60
  /** Replace custom/font-awesome icons with codicons */
62
- 5.0;
61
+ 5.0 |
62
+ /** added the ability to drag and drop view parts between view containers */
63
+ 6.0;
63
64
 
64
65
  /**
65
66
  * When a version is increased, make sure to introduce a migration (ApplicationShellLayoutMigration) to this version.
@@ -25,6 +25,7 @@ import { ThemeService } from '../theming';
25
25
  import { ContributionProvider } from '../../common/contribution-provider';
26
26
  import { MaybePromise } from '../../common/types';
27
27
  import { ApplicationShell, applicationShellLayoutVersion, ApplicationShellLayoutVersion } from './application-shell';
28
+ import { CommonCommands } from '../common-frontend-contribution';
28
29
 
29
30
  /**
30
31
  * A contract for widgets that want to store and restore their inner state, between sessions.
@@ -109,11 +110,11 @@ export interface ApplicationShellLayoutMigration {
109
110
  onWillInflateWidget?(desc: WidgetDescription, context: ApplicationShellLayoutMigrationContext): MaybePromise<WidgetDescription | undefined>;
110
111
  }
111
112
 
112
- export const RESET_LAYOUT: Command = {
113
+ export const RESET_LAYOUT = Command.toLocalizedCommand({
113
114
  id: 'reset.layout',
114
- category: 'View',
115
+ category: CommonCommands.VIEW_CATEGORY,
115
116
  label: 'Reset Workbench Layout'
116
- };
117
+ }, 'theia/core/resetWorkbenchLayout', CommonCommands.VIEW_CATEGORY_KEY);
117
118
 
118
119
  @injectable()
119
120
  export class ShellLayoutRestorer implements CommandContribution {
@@ -57,7 +57,7 @@ export class TabBarDecoratorService implements FrontendApplicationContribution {
57
57
  this.contributions.getContributions().map(decorator => decorator.onDidChangeDecorations(this.fireDidChangeDecorations));
58
58
  }
59
59
 
60
- protected fireDidChangeDecorations = debounce(() => this.onDidChangeDecorationsEmitter.fire(undefined), 150);
60
+ fireDidChangeDecorations = debounce(() => this.onDidChangeDecorationsEmitter.fire(undefined), 150);
61
61
 
62
62
  /**
63
63
  * Assign tabs the decorators provided by all the contributions.
@@ -27,6 +27,7 @@ import { ContextKeyService } from '../context-key-service';
27
27
  import { Event, Emitter } from '../../common/event';
28
28
  import { ContextMenuRenderer, Anchor } from '../context-menu-renderer';
29
29
  import { MenuModelRegistry } from '../../common/menu';
30
+ import { nls } from '../../common/nls';
30
31
 
31
32
  /**
32
33
  * Clients should implement this interface if they want to contribute to the tab-bar toolbar.
@@ -403,7 +404,8 @@ export class TabBarToolbar extends ReactWidget {
403
404
 
404
405
  protected renderMore(): React.ReactNode {
405
406
  return !!this.more.size && <div key='__more__' className={TabBarToolbar.Styles.TAB_BAR_TOOLBAR_ITEM + ' enabled'}>
406
- <div id='__more__' className={codicon('ellipsis', true)} onClick={this.showMoreContextMenu} title='More Actions...' />
407
+ <div id='__more__' className={codicon('ellipsis', true)} onClick={this.showMoreContextMenu}
408
+ title={nls.localizeByDefault('More Actions...')} />
407
409
  </div>;
408
410
  }
409
411