@theia/core 1.18.0 → 1.21.0-next.12

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 (294) hide show
  1. package/README.md +3 -2
  2. package/lib/browser/about-dialog.d.ts.map +1 -1
  3. package/lib/browser/about-dialog.js +1 -1
  4. package/lib/browser/about-dialog.js.map +1 -1
  5. package/lib/browser/authentication-service.d.ts.map +1 -1
  6. package/lib/browser/authentication-service.js +1 -1
  7. package/lib/browser/authentication-service.js.map +1 -1
  8. package/lib/browser/color-registry.d.ts +3 -69
  9. package/lib/browser/color-registry.d.ts.map +1 -1
  10. package/lib/browser/color-registry.js +13 -27
  11. package/lib/browser/color-registry.js.map +1 -1
  12. package/lib/browser/common-frontend-contribution.d.ts +7 -13
  13. package/lib/browser/common-frontend-contribution.d.ts.map +1 -1
  14. package/lib/browser/common-frontend-contribution.js +213 -250
  15. package/lib/browser/common-frontend-contribution.js.map +1 -1
  16. package/lib/browser/core-preferences.d.ts +1 -0
  17. package/lib/browser/core-preferences.d.ts.map +1 -1
  18. package/lib/browser/core-preferences.js +29 -19
  19. package/lib/browser/core-preferences.js.map +1 -1
  20. package/lib/browser/dialogs.d.ts +6 -0
  21. package/lib/browser/dialogs.d.ts.map +1 -1
  22. package/lib/browser/dialogs.js +10 -3
  23. package/lib/browser/dialogs.js.map +1 -1
  24. package/lib/browser/frontend-application-module.d.ts.map +1 -1
  25. package/lib/browser/frontend-application-module.js +9 -5
  26. package/lib/browser/frontend-application-module.js.map +1 -1
  27. package/lib/browser/frontend-application.d.ts +6 -0
  28. package/lib/browser/frontend-application.d.ts.map +1 -1
  29. package/lib/browser/frontend-application.js +13 -0
  30. package/lib/browser/frontend-application.js.map +1 -1
  31. package/lib/browser/index.d.ts +1 -0
  32. package/lib/browser/index.d.ts.map +1 -1
  33. package/lib/browser/index.js +1 -0
  34. package/lib/browser/index.js.map +1 -1
  35. package/lib/browser/keyboard/browser-keyboard-frontend-contribution.d.ts.map +1 -1
  36. package/lib/browser/keyboard/browser-keyboard-frontend-contribution.js +16 -11
  37. package/lib/browser/keyboard/browser-keyboard-frontend-contribution.js.map +1 -1
  38. package/lib/browser/keyboard/browser-keyboard-layout-provider.d.ts +1 -1
  39. package/lib/browser/keyboard/browser-keyboard-layout-provider.d.ts.map +1 -1
  40. package/lib/browser/keyboard/browser-keyboard-layout-provider.spec.js +6 -4
  41. package/lib/browser/keyboard/browser-keyboard-layout-provider.spec.js.map +1 -1
  42. package/lib/browser/keyboard/keys.d.ts +2 -251
  43. package/lib/browser/keyboard/keys.d.ts.map +1 -1
  44. package/lib/browser/keyboard/keys.js +12 -614
  45. package/lib/browser/keyboard/keys.js.map +1 -1
  46. package/lib/browser/menu/browser-context-menu-renderer.d.ts +1 -1
  47. package/lib/browser/menu/browser-context-menu-renderer.d.ts.map +1 -1
  48. package/lib/browser/menu/browser-menu-plugin.d.ts +3 -0
  49. package/lib/browser/menu/browser-menu-plugin.d.ts.map +1 -1
  50. package/lib/browser/menu/browser-menu-plugin.js +24 -4
  51. package/lib/browser/menu/browser-menu-plugin.js.map +1 -1
  52. package/lib/browser/messaging/ws-connection-provider.d.ts +3 -3
  53. package/lib/browser/messaging/ws-connection-provider.d.ts.map +1 -1
  54. package/lib/browser/messaging/ws-connection-provider.js +14 -4
  55. package/lib/browser/messaging/ws-connection-provider.js.map +1 -1
  56. package/lib/browser/{nls.d.ts → nls-loader.d.ts} +1 -6
  57. package/lib/browser/nls-loader.d.ts.map +1 -0
  58. package/lib/browser/nls-loader.js +29 -0
  59. package/lib/browser/nls-loader.js.map +1 -0
  60. package/lib/browser/preferences/preference-provider.d.ts +0 -2
  61. package/lib/browser/preferences/preference-provider.d.ts.map +1 -1
  62. package/lib/browser/preferences/preference-provider.js +1 -5
  63. package/lib/browser/preferences/preference-provider.js.map +1 -1
  64. package/lib/browser/preferences/preference-service.spec.js +0 -3
  65. package/lib/browser/preferences/preference-service.spec.js.map +1 -1
  66. package/lib/browser/progress-status-bar-item.d.ts +1 -2
  67. package/lib/browser/progress-status-bar-item.d.ts.map +1 -1
  68. package/lib/browser/progress-status-bar-item.js.map +1 -1
  69. package/lib/browser/quick-input/quick-command-frontend-contribution.d.ts.map +1 -1
  70. package/lib/browser/quick-input/quick-command-frontend-contribution.js +2 -1
  71. package/lib/browser/quick-input/quick-command-frontend-contribution.js.map +1 -1
  72. package/lib/browser/quick-input/quick-command-service.d.ts.map +1 -1
  73. package/lib/browser/quick-input/quick-command-service.js +2 -2
  74. package/lib/browser/quick-input/quick-command-service.js.map +1 -1
  75. package/lib/browser/quick-input/quick-input-service.d.ts +1 -201
  76. package/lib/browser/quick-input/quick-input-service.d.ts.map +1 -1
  77. package/lib/browser/quick-input/quick-input-service.js +11 -93
  78. package/lib/browser/quick-input/quick-input-service.js.map +1 -1
  79. package/lib/browser/quick-input/quick-view-service.d.ts +1 -2
  80. package/lib/browser/quick-input/quick-view-service.d.ts.map +1 -1
  81. package/lib/browser/quick-input/quick-view-service.js.map +1 -1
  82. package/lib/browser/shell/application-shell.d.ts +10 -8
  83. package/lib/browser/shell/application-shell.d.ts.map +1 -1
  84. package/lib/browser/shell/application-shell.js +11 -19
  85. package/lib/browser/shell/application-shell.js.map +1 -1
  86. package/lib/browser/shell/current-widget-command-adapter.d.ts +39 -0
  87. package/lib/browser/shell/current-widget-command-adapter.d.ts.map +1 -0
  88. package/lib/browser/shell/current-widget-command-adapter.js +42 -0
  89. package/lib/browser/shell/current-widget-command-adapter.js.map +1 -0
  90. package/lib/browser/shell/shell-layout-restorer.d.ts.map +1 -1
  91. package/lib/browser/shell/shell-layout-restorer.js +5 -3
  92. package/lib/browser/shell/shell-layout-restorer.js.map +1 -1
  93. package/lib/browser/shell/tab-bar-decorator.d.ts +1 -1
  94. package/lib/browser/shell/tab-bar-decorator.d.ts.map +1 -1
  95. package/lib/browser/shell/tab-bar-decorator.js.map +1 -1
  96. package/lib/browser/shell/tab-bar-toolbar.d.ts.map +1 -1
  97. package/lib/browser/shell/tab-bar-toolbar.js +2 -1
  98. package/lib/browser/shell/tab-bar-toolbar.js.map +1 -1
  99. package/lib/browser/shell/tab-bars.d.ts +22 -3
  100. package/lib/browser/shell/tab-bars.d.ts.map +1 -1
  101. package/lib/browser/shell/tab-bars.js +129 -10
  102. package/lib/browser/shell/tab-bars.js.map +1 -1
  103. package/lib/browser/storage-service.spec.js +1 -1
  104. package/lib/browser/storage-service.spec.js.map +1 -1
  105. package/lib/browser/theming.d.ts +5 -14
  106. package/lib/browser/theming.d.ts.map +1 -1
  107. package/lib/browser/theming.js +14 -0
  108. package/lib/browser/theming.js.map +1 -1
  109. package/lib/browser/tooltip-service.d.ts +52 -0
  110. package/lib/browser/tooltip-service.d.ts.map +1 -0
  111. package/lib/browser/tooltip-service.js +89 -0
  112. package/lib/browser/tooltip-service.js.map +1 -0
  113. package/lib/browser/tree/tree-model.d.ts.map +1 -1
  114. package/lib/browser/view-container.d.ts +55 -14
  115. package/lib/browser/view-container.d.ts.map +1 -1
  116. package/lib/browser/view-container.js +284 -66
  117. package/lib/browser/view-container.js.map +1 -1
  118. package/lib/browser/window/default-window-service.js +2 -2
  119. package/lib/browser/window/default-window-service.js.map +1 -1
  120. package/lib/browser/window/window-service.d.ts +1 -7
  121. package/lib/browser/window/window-service.d.ts.map +1 -1
  122. package/lib/browser/window/window-service.js +1 -5
  123. package/lib/browser/window/window-service.js.map +1 -1
  124. package/lib/browser/window-contribution.d.ts.map +1 -1
  125. package/lib/browser/window-contribution.js +2 -2
  126. package/lib/browser/window-contribution.js.map +1 -1
  127. package/lib/common/color.d.ts +84 -0
  128. package/lib/common/color.d.ts.map +1 -0
  129. package/lib/common/color.js +44 -0
  130. package/lib/common/color.js.map +1 -0
  131. package/lib/common/command.d.ts +1 -0
  132. package/lib/common/command.d.ts.map +1 -1
  133. package/lib/common/command.js +5 -2
  134. package/lib/common/command.js.map +1 -1
  135. package/lib/common/i18n/localization.d.ts +14 -0
  136. package/lib/common/i18n/localization.d.ts.map +1 -1
  137. package/lib/common/i18n/localization.js +54 -1
  138. package/lib/common/i18n/localization.js.map +1 -1
  139. package/lib/common/index.d.ts +1 -0
  140. package/lib/common/index.d.ts.map +1 -1
  141. package/lib/common/index.js +1 -0
  142. package/lib/common/index.js.map +1 -1
  143. package/lib/common/keys.d.ts +269 -0
  144. package/lib/common/keys.d.ts.map +1 -0
  145. package/lib/common/keys.js +634 -0
  146. package/lib/common/keys.js.map +1 -0
  147. package/lib/common/messaging/abstract-connection-provider.d.ts +1 -1
  148. package/lib/common/messaging/abstract-connection-provider.d.ts.map +1 -1
  149. package/lib/common/messaging/abstract-connection-provider.js +3 -1
  150. package/lib/common/messaging/abstract-connection-provider.js.map +1 -1
  151. package/lib/common/messaging/proxy-factory.js +1 -1
  152. package/lib/common/messaging/proxy-factory.js.map +1 -1
  153. package/lib/common/nls.d.ts +28 -0
  154. package/lib/common/nls.d.ts.map +1 -0
  155. package/lib/common/nls.js +91 -0
  156. package/lib/common/nls.js.map +1 -0
  157. package/lib/common/path.d.ts +6 -0
  158. package/lib/common/path.d.ts.map +1 -1
  159. package/lib/common/path.js +16 -4
  160. package/lib/common/path.js.map +1 -1
  161. package/lib/common/path.spec.js +12 -0
  162. package/lib/common/path.spec.js.map +1 -1
  163. package/lib/common/promise-util.d.ts +5 -2
  164. package/lib/common/promise-util.d.ts.map +1 -1
  165. package/lib/common/promise-util.js +16 -1
  166. package/lib/common/promise-util.js.map +1 -1
  167. package/lib/common/promise-util.spec.d.ts +2 -0
  168. package/lib/common/promise-util.spec.d.ts.map +1 -0
  169. package/lib/common/promise-util.spec.js +42 -0
  170. package/lib/common/promise-util.spec.js.map +1 -0
  171. package/lib/common/quick-pick-service.d.ts +219 -1
  172. package/lib/common/quick-pick-service.d.ts.map +1 -1
  173. package/lib/common/quick-pick-service.js +108 -1
  174. package/lib/common/quick-pick-service.js.map +1 -1
  175. package/lib/common/theme.d.ts +30 -0
  176. package/lib/common/theme.d.ts.map +1 -0
  177. package/lib/common/theme.js +18 -0
  178. package/lib/common/theme.js.map +1 -0
  179. package/lib/common/window.d.ts +29 -0
  180. package/lib/common/window.d.ts.map +1 -0
  181. package/lib/common/window.js +23 -0
  182. package/lib/common/window.js.map +1 -0
  183. package/lib/electron-browser/menu/electron-context-menu-renderer.d.ts +9 -5
  184. package/lib/electron-browser/menu/electron-context-menu-renderer.d.ts.map +1 -1
  185. package/lib/electron-browser/menu/electron-context-menu-renderer.js +40 -15
  186. package/lib/electron-browser/menu/electron-context-menu-renderer.js.map +1 -1
  187. package/lib/electron-browser/menu/electron-main-menu-factory.d.ts +5 -8
  188. package/lib/electron-browser/menu/electron-main-menu-factory.d.ts.map +1 -1
  189. package/lib/electron-browser/menu/electron-main-menu-factory.js +10 -17
  190. package/lib/electron-browser/menu/electron-main-menu-factory.js.map +1 -1
  191. package/lib/electron-browser/menu/electron-menu-contribution.d.ts +15 -7
  192. package/lib/electron-browser/menu/electron-menu-contribution.d.ts.map +1 -1
  193. package/lib/electron-browser/menu/electron-menu-contribution.js +112 -42
  194. package/lib/electron-browser/menu/electron-menu-contribution.js.map +1 -1
  195. package/lib/electron-browser/window/electron-window-preferences.d.ts +1 -0
  196. package/lib/electron-browser/window/electron-window-preferences.d.ts.map +1 -1
  197. package/lib/electron-browser/window/electron-window-preferences.js +12 -1
  198. package/lib/electron-browser/window/electron-window-preferences.js.map +1 -1
  199. package/lib/electron-browser/window/electron-window-service.d.ts +1 -1
  200. package/lib/electron-browser/window/electron-window-service.d.ts.map +1 -1
  201. package/lib/electron-common/electron-main-window-service.d.ts +1 -1
  202. package/lib/electron-common/electron-main-window-service.d.ts.map +1 -1
  203. package/lib/electron-common/electron-main-window-service.js.map +1 -1
  204. package/lib/electron-common/messaging/electron-messages.d.ts +20 -0
  205. package/lib/electron-common/messaging/electron-messages.d.ts.map +1 -0
  206. package/lib/electron-common/messaging/electron-messages.js +23 -0
  207. package/lib/electron-common/messaging/electron-messages.js.map +1 -0
  208. package/lib/electron-main/electron-main-application.d.ts +16 -0
  209. package/lib/electron-main/electron-main-application.d.ts.map +1 -1
  210. package/lib/electron-main/electron-main-application.js +91 -25
  211. package/lib/electron-main/electron-main-application.js.map +1 -1
  212. package/lib/electron-main/electron-main-window-service-impl.d.ts +1 -1
  213. package/lib/electron-main/electron-main-window-service-impl.d.ts.map +1 -1
  214. package/lib/electron-main/electron-main-window-service-impl.js.map +1 -1
  215. package/lib/electron-main/messaging/electron-messaging-contribution.d.ts +1 -1
  216. package/lib/electron-main/messaging/electron-messaging-contribution.d.ts.map +1 -1
  217. package/lib/electron-main/messaging/electron-messaging-contribution.js +1 -2
  218. package/lib/electron-main/messaging/electron-messaging-contribution.js.map +1 -1
  219. package/package.json +7 -5
  220. package/shared/@theia/application-package/lib/api.d.ts +1 -0
  221. package/shared/@theia/application-package/lib/api.js +1 -0
  222. package/src/browser/about-dialog.tsx +2 -2
  223. package/src/browser/authentication-service.ts +1 -2
  224. package/src/browser/color-registry.ts +3 -85
  225. package/src/browser/common-frontend-contribution.ts +179 -232
  226. package/src/browser/core-preferences.ts +32 -19
  227. package/src/browser/dialogs.ts +10 -3
  228. package/src/browser/frontend-application-module.ts +10 -5
  229. package/src/browser/frontend-application.ts +13 -0
  230. package/src/browser/index.ts +1 -0
  231. package/src/browser/keyboard/browser-keyboard-frontend-contribution.ts +16 -11
  232. package/src/browser/keyboard/browser-keyboard-layout-provider.spec.ts +10 -4
  233. package/src/browser/keyboard/keys.ts +2 -675
  234. package/src/browser/menu/browser-context-menu-renderer.ts +1 -1
  235. package/src/browser/menu/browser-menu-plugin.ts +25 -5
  236. package/src/browser/messaging/ws-connection-provider.ts +13 -4
  237. package/src/browser/nls-loader.ts +26 -0
  238. package/src/browser/preferences/preference-provider.ts +1 -5
  239. package/src/browser/preferences/preference-service.spec.ts +0 -3
  240. package/src/browser/progress-status-bar-item.ts +1 -2
  241. package/src/browser/quick-input/quick-command-frontend-contribution.ts +2 -2
  242. package/src/browser/quick-input/quick-command-service.ts +2 -2
  243. package/src/browser/quick-input/quick-input-service.ts +1 -278
  244. package/src/browser/quick-input/quick-view-service.ts +1 -2
  245. package/src/browser/shell/application-shell.ts +21 -25
  246. package/src/browser/shell/current-widget-command-adapter.ts +57 -0
  247. package/src/browser/shell/shell-layout-restorer.ts +4 -3
  248. package/src/browser/shell/tab-bar-decorator.ts +1 -1
  249. package/src/browser/shell/tab-bar-toolbar.tsx +3 -1
  250. package/src/browser/shell/tab-bars.ts +133 -13
  251. package/src/browser/storage-service.spec.ts +1 -1
  252. package/src/browser/style/index.css +5 -0
  253. package/src/browser/style/sidepanel.css +8 -2
  254. package/src/browser/style/tabs.css +30 -0
  255. package/src/browser/style/tooltip.css +28 -0
  256. package/src/browser/style/view-container.css +9 -9
  257. package/src/browser/theming.ts +6 -17
  258. package/src/browser/tooltip-service.tsx +98 -0
  259. package/src/browser/tree/tree-model.ts +1 -1
  260. package/src/browser/view-container.ts +312 -80
  261. package/src/browser/window/default-window-service.ts +2 -2
  262. package/src/browser/window/window-service.ts +1 -9
  263. package/src/browser/window-contribution.ts +2 -2
  264. package/src/common/color.ts +100 -0
  265. package/src/common/command.ts +11 -2
  266. package/src/common/i18n/localization.ts +54 -0
  267. package/src/common/i18n/nls.metadata.json +20421 -0
  268. package/src/common/index.ts +1 -0
  269. package/src/common/keys.ts +693 -0
  270. package/src/common/messaging/abstract-connection-provider.ts +3 -1
  271. package/src/common/messaging/proxy-factory.ts +1 -1
  272. package/src/common/nls.ts +104 -0
  273. package/src/common/path.spec.ts +15 -0
  274. package/src/common/path.ts +16 -4
  275. package/src/common/promise-util.spec.ts +41 -0
  276. package/src/common/promise-util.ts +23 -4
  277. package/src/common/quick-pick-service.ts +299 -4
  278. package/src/common/theme.ts +32 -0
  279. package/src/common/window.ts +30 -0
  280. package/src/electron-browser/menu/electron-context-menu-renderer.ts +38 -16
  281. package/src/electron-browser/menu/electron-main-menu-factory.ts +10 -15
  282. package/src/electron-browser/menu/electron-menu-contribution.ts +129 -39
  283. package/src/electron-browser/menu/electron-menu-style.css +84 -0
  284. package/src/electron-browser/window/electron-window-preferences.ts +13 -1
  285. package/src/electron-browser/window/electron-window-service.ts +1 -1
  286. package/src/electron-common/electron-main-window-service.ts +1 -2
  287. package/src/electron-common/messaging/electron-messages.ts +20 -0
  288. package/src/electron-main/electron-main-application.ts +107 -24
  289. package/src/electron-main/electron-main-window-service-impl.ts +1 -2
  290. package/src/electron-main/messaging/electron-messaging-contribution.ts +1 -2
  291. package/lib/browser/nls.d.ts.map +0 -1
  292. package/lib/browser/nls.js +0 -64
  293. package/lib/browser/nls.js.map +0 -1
  294. package/src/browser/nls.ts +0 -65
@@ -19,6 +19,7 @@ import { createPreferenceProxy, PreferenceProxy, PreferenceService, PreferenceCo
19
19
  import { SUPPORTED_ENCODINGS } from './supported-encodings';
20
20
  import { FrontendApplicationConfigProvider } from './frontend-application-config-provider';
21
21
  import { isOSX } from '../common/os';
22
+ import { nls } from '../common/nls';
22
23
 
23
24
  export const corePreferenceSchema: PreferenceSchema = {
24
25
  'type': 'object',
@@ -31,19 +32,21 @@ export const corePreferenceSchema: PreferenceSchema = {
31
32
  'always',
32
33
  ],
33
34
  default: 'ifRequired',
34
- description: 'When to confirm before closing the application window.',
35
+ // eslint-disable-next-line max-len
36
+ description: nls.localizeByDefault('Controls whether to show a confirmation dialog before closing the browser tab or window. Note that even if enabled, browsers may still decide to close a tab or window without confirmation and that this setting is only a hint that may not work in all cases.'),
35
37
  },
36
38
  'breadcrumbs.enabled': {
37
39
  'type': 'boolean',
38
40
  'default': true,
39
- 'description': 'Enable/disable navigation breadcrumbs.',
41
+ 'description': nls.localizeByDefault('Enable/disable navigation breadcrumbs.'),
40
42
  'scope': 'application'
41
43
  },
42
44
  'files.encoding': {
43
45
  'type': 'string',
44
46
  'enum': Object.keys(SUPPORTED_ENCODINGS),
45
47
  'default': 'utf8',
46
- 'description': 'The default character set encoding to use when reading and writing files. This setting can also be configured per language.',
48
+ 'description': nls.localizeByDefault(
49
+ 'The default character set encoding to use when reading and writing files. This setting can also be configured per language.'),
47
50
  'scope': 'language-overridable',
48
51
  'enumDescriptions': Object.keys(SUPPORTED_ENCODINGS).map(key => SUPPORTED_ENCODINGS[key].labelLong),
49
52
  'included': Object.keys(SUPPORTED_ENCODINGS).length > 1
@@ -55,21 +58,22 @@ export const corePreferenceSchema: PreferenceSchema = {
55
58
  'keyCode',
56
59
  ],
57
60
  default: 'code',
58
- description: 'Whether to interpret keypresses by the `code` of the physical key, or by the `keyCode` provided by the OS.'
61
+ description: nls.localizeByDefault(
62
+ 'Controls the dispatching logic for key presses to use either `code` (recommended) or `keyCode`.')
59
63
  },
60
64
  'window.menuBarVisibility': {
61
65
  type: 'string',
62
66
  enum: ['classic', 'visible', 'hidden', 'compact'],
63
67
  markdownEnumDescriptions: [
64
- 'Menu is displayed at the top of the window and only hidden in full screen mode.',
65
- 'Menu is always visible at the top of the window even in full screen mode.',
66
- 'Menu is always hidden.',
67
- 'Menu is displayed as a compact button in the sidebar.'
68
+ nls.localizeByDefault('Menu is only hidden in full screen mode.'),
69
+ nls.localizeByDefault('Menu is always visible even in full screen mode.'),
70
+ nls.localizeByDefault('Menu is always hidden.'),
71
+ nls.localizeByDefault('Menu is displayed as a compact button in the sidebar. This value is ignored when `#window.titleBarStyle#` is `native`.')
68
72
  ],
69
73
  default: 'classic',
70
74
  scope: 'application',
71
- markdownDescription: `Control the visibility of the menu bar.
72
- A setting of 'compact' will move the menu into the sidebar.`,
75
+ // eslint-disable-next-line max-len
76
+ markdownDescription: nls.localizeByDefault("Control the visibility of the menu bar. A setting of 'toggle' means that the menu bar is hidden and a single press of the Alt key will show it. By default, the menu bar will be visible, unless the window is full screen."),
73
77
  included: !isOSX
74
78
  },
75
79
  'workbench.list.openMode': {
@@ -79,50 +83,58 @@ export const corePreferenceSchema: PreferenceSchema = {
79
83
  'doubleClick'
80
84
  ],
81
85
  default: 'singleClick',
82
- description: 'Controls how to open items in trees using the mouse.'
86
+ // eslint-disable-next-line max-len
87
+ description: nls.localizeByDefault('Controls how to open items in trees and lists using the mouse (if supported). For parents with children in trees, this setting will control if a single click expands the parent or a double click. Note that some trees and lists might choose to ignore this setting if it is not applicable. ')
83
88
  },
84
89
  'workbench.editor.highlightModifiedTabs': {
85
90
  'type': 'boolean',
86
- 'description': 'Controls whether a top border is drawn on modified (dirty) editor tabs or not.',
91
+ // eslint-disable-next-line max-len
92
+ 'description': nls.localizeByDefault('Controls whether a top border is drawn on modified (dirty) editor tabs or not. This value is ignored when `#workbench.editor.showTabs#` is disabled.'),
87
93
  'default': false
88
94
  },
89
95
  'workbench.editor.closeOnFileDelete': {
90
96
  'type': 'boolean',
91
97
  // eslint-disable-next-line max-len
92
- 'description': 'Controls whether editors showing a file that was opened during the session should close automatically when getting deleted or renamed by some other process. Disabling this will keep the editor open on such an event. Note that deleting from within the application will always close the editor and that dirty files will never close to preserve your data.',
98
+ 'description': nls.localizeByDefault('Controls whether editors showing a file that was opened during the session should close automatically when getting deleted or renamed by some other process. Disabling this will keep the editor open on such an event. Note that deleting from within the application will always close the editor and that dirty files will never close to preserve your data.'),
93
99
  'default': false
94
100
  },
95
101
  'workbench.commandPalette.history': {
96
102
  type: 'number',
97
103
  default: 50,
98
104
  minimum: 0,
99
- description: 'Controls the number of recently used commands to keep in history for the command palette. Set to 0 to disable command history.'
105
+ // eslint-disable-next-line max-len
106
+ description: nls.localizeByDefault('Controls the number of recently used commands to keep in history for the command palette. Set to 0 to disable command history.')
100
107
  },
101
108
  'workbench.colorTheme': {
102
109
  type: 'string',
103
110
  default: FrontendApplicationConfigProvider.get().defaultTheme,
104
- description: 'Specifies the color theme used in the workbench.'
111
+ description: nls.localizeByDefault('Specifies the color theme used in the workbench.')
105
112
  },
106
113
  'workbench.iconTheme': {
107
114
  type: ['string', 'null'],
108
115
  default: FrontendApplicationConfigProvider.get().defaultIconTheme,
109
- description: "Specifies the icon theme used in the workbench or 'null' to not show any file icons."
116
+ description: nls.localizeByDefault("Specifies the file icon theme used in the workbench or 'null' to not show any file icons.")
110
117
  },
111
118
  'workbench.silentNotifications': {
112
119
  type: 'boolean',
113
120
  default: false,
114
- description: 'Controls whether to suppress notification popups.'
121
+ description: nls.localize('theia/core/silentNotifications', 'Controls whether to suppress notification popups.')
115
122
  },
116
123
  'workbench.statusBar.visible': {
117
124
  type: 'boolean',
118
125
  default: true,
119
- description: 'Controls the visibility of the status bar at the bottom of the workbench.'
126
+ description: nls.localizeByDefault('Controls the visibility of the status bar at the bottom of the workbench.')
120
127
  },
121
128
  'workbench.tree.renderIndentGuides': {
122
129
  type: 'string',
123
130
  enum: ['onHover', 'none', 'always'],
124
131
  default: 'onHover',
125
- description: 'Controls whether the tree should render indent guides.'
132
+ description: nls.localizeByDefault('Controls whether the tree should render indent guides.')
133
+ },
134
+ 'workbench.hover.delay': {
135
+ type: 'number',
136
+ default: isOSX ? 1500 : 500,
137
+ description: nls.localizeByDefault('Controls the delay in milliseconds after which the hover is shown.')
126
138
  },
127
139
  }
128
140
  };
@@ -142,6 +154,7 @@ export interface CoreConfiguration {
142
154
  'workbench.silentNotifications': boolean;
143
155
  'workbench.statusBar.visible': boolean;
144
156
  'workbench.tree.renderIndentGuides': 'onHover' | 'none' | 'always';
157
+ 'workbench.hover.delay': number;
145
158
  }
146
159
 
147
160
  export const CorePreferenceContribution = Symbol('CorePreferenceContribution');
@@ -15,7 +15,7 @@
15
15
  ********************************************************************************/
16
16
 
17
17
  import { injectable, inject } from 'inversify';
18
- import { Disposable, MaybePromise, CancellationTokenSource } from '../common';
18
+ import { Disposable, MaybePromise, CancellationTokenSource, nls } from '../common';
19
19
  import { Key } from './keyboard/keys';
20
20
  import { Widget, BaseWidget, Message, addKeyListener, codiconArray } from './widgets';
21
21
  import { FrontendApplicationContribution } from './frontend-application';
@@ -66,6 +66,13 @@ export namespace DialogError {
66
66
  }
67
67
  }
68
68
 
69
+ export namespace Dialog {
70
+ export const YES = nls.localizeByDefault('Yes');
71
+ export const NO = nls.localizeByDefault('No');
72
+ export const OK = nls.localizeByDefault('OK');
73
+ export const CANCEL = nls.localizeByDefault('Cancel');
74
+ }
75
+
69
76
  @injectable()
70
77
  export class DialogOverlayService implements FrontendApplicationContribution {
71
78
 
@@ -191,14 +198,14 @@ export abstract class AbstractDialog<T> extends BaseWidget {
191
198
  this.update();
192
199
  }
193
200
 
194
- protected appendCloseButton(text: string = 'Cancel'): HTMLButtonElement {
201
+ protected appendCloseButton(text: string = Dialog.CANCEL): HTMLButtonElement {
195
202
  this.closeButton = this.createButton(text);
196
203
  this.controlPanel.appendChild(this.closeButton);
197
204
  this.closeButton.classList.add('secondary');
198
205
  return this.closeButton;
199
206
  }
200
207
 
201
- protected appendAcceptButton(text: string = 'OK'): HTMLButtonElement {
208
+ protected appendAcceptButton(text: string = Dialog.OK): HTMLButtonElement {
202
209
  this.acceptButton = this.createButton(text);
203
210
  this.controlPanel.appendChild(this.acceptButton);
204
211
  this.acceptButton.classList.add('main');
@@ -118,6 +118,7 @@ import {
118
118
  DefaultBreadcrumbRenderer,
119
119
  } from './breadcrumbs';
120
120
  import { RendererHost } from './widgets';
121
+ import { TooltipService, TooltipServiceImpl } from './tooltip-service';
121
122
 
122
123
  export { bindResourceProvider, bindMessageService, bindPreferenceService };
123
124
 
@@ -164,11 +165,12 @@ export const frontendApplicationModule = new ContainerModule((bind, unbind, isBo
164
165
 
165
166
  bind(DockPanelRendererFactory).toFactory(context => () => context.container.get(DockPanelRenderer));
166
167
  bind(DockPanelRenderer).toSelf();
167
- bind(TabBarRendererFactory).toFactory(context => () => {
168
- const contextMenuRenderer = context.container.get<ContextMenuRenderer>(ContextMenuRenderer);
169
- const decoratorService = context.container.get<TabBarDecoratorService>(TabBarDecoratorService);
170
- const iconThemeService = context.container.get<IconThemeService>(IconThemeService);
171
- return new TabBarRenderer(contextMenuRenderer, decoratorService, iconThemeService);
168
+ bind(TabBarRendererFactory).toFactory(({ container }) => () => {
169
+ const contextMenuRenderer = container.get(ContextMenuRenderer);
170
+ const tabBarDecoratorService = container.get(TabBarDecoratorService);
171
+ const iconThemeService = container.get(IconThemeService);
172
+ const selectionService = container.get(SelectionService);
173
+ return new TabBarRenderer(contextMenuRenderer, tabBarDecoratorService, iconThemeService, selectionService);
172
174
  });
173
175
 
174
176
  bindContributionProvider(bind, TabBarDecorator);
@@ -186,6 +188,9 @@ export const frontendApplicationModule = new ContainerModule((bind, unbind, isBo
186
188
  bind(CommandOpenHandler).toSelf().inSingletonScope();
187
189
  bind(OpenHandler).toService(CommandOpenHandler);
188
190
 
191
+ bind(TooltipServiceImpl).toSelf().inSingletonScope();
192
+ bind(TooltipService).toService(TooltipServiceImpl);
193
+
189
194
  bindContributionProvider(bind, ApplicationShellLayoutMigration);
190
195
  bind<ApplicationShellLayoutMigration>(ApplicationShellLayoutMigration).toConstantValue({
191
196
  layoutVersion: 2.0,
@@ -25,6 +25,7 @@ import { FrontendApplicationStateService } from './frontend-application-state';
25
25
  import { preventNavigation, parseCssTime, animationFrame } from './browser';
26
26
  import { CorePreferences } from './core-preferences';
27
27
  import { WindowService } from './window/window-service';
28
+ import { TooltipService } from './tooltip-service';
28
29
 
29
30
  /**
30
31
  * Clients can implement to get a callback for contributing widgets to a shell on start.
@@ -100,6 +101,9 @@ export class FrontendApplication {
100
101
  @inject(WindowService)
101
102
  protected readonly windowsService: WindowService;
102
103
 
104
+ @inject(TooltipService)
105
+ protected readonly tooltipService: TooltipService;
106
+
103
107
  constructor(
104
108
  @inject(CommandRegistry) protected readonly commands: CommandRegistry,
105
109
  @inject(MenuModelRegistry) protected readonly menus: MenuModelRegistry,
@@ -130,6 +134,7 @@ export class FrontendApplication {
130
134
 
131
135
  const host = await this.getHost();
132
136
  this.attachShell(host);
137
+ this.attachTooltip(host);
133
138
  await animationFrame();
134
139
  this.stateService.state = 'attached_shell';
135
140
 
@@ -221,6 +226,13 @@ export class FrontendApplication {
221
226
  Widget.attach(this.shell, host, ref);
222
227
  }
223
228
 
229
+ /**
230
+ * Attach the tooltip container to the host element.
231
+ */
232
+ protected attachTooltip(host: HTMLElement): void {
233
+ this.tooltipService.attachTo(host);
234
+ }
235
+
224
236
  /**
225
237
  * If a startup indicator is present, it is first hidden with the `theia-hidden` CSS class and then
226
238
  * removed after a while. The delay until removal is taken from the CSS transition duration.
@@ -231,6 +243,7 @@ export class FrontendApplication {
231
243
  return new Promise(resolve => {
232
244
  window.requestAnimationFrame(() => {
233
245
  startupElem.classList.add('theia-hidden');
246
+ console.log(`Finished loading frontend application after ${(performance.now() / 1000).toFixed(3)} seconds`);
234
247
  const preloadStyle = window.getComputedStyle(startupElem);
235
248
  const transitionDuration = parseCssTime(preloadStyle.transitionDuration, 0);
236
249
  window.setTimeout(() => {
@@ -40,3 +40,4 @@ export * from './diff-uris';
40
40
  export * from './core-preferences';
41
41
  export * from './view-container';
42
42
  export * from './breadcrumbs';
43
+ export * from './tooltip-service';
@@ -19,16 +19,18 @@ import { isOSX } from '../../common/os';
19
19
  import { CommandContribution, CommandRegistry, Command } from '../../common/command';
20
20
  import { BrowserKeyboardLayoutProvider, KeyboardLayoutData } from './browser-keyboard-layout-provider';
21
21
  import { QuickPickValue, QuickInputService, QuickPickItem } from '../quick-input';
22
+ import { nls } from '../../common/nls';
22
23
 
23
24
  export namespace KeyboardCommands {
24
25
 
25
26
  const KEYBOARD_CATEGORY = 'Keyboard';
27
+ const KEYBOARD_CATEGORY_KEY = nls.getDefaultKey(KEYBOARD_CATEGORY);
26
28
 
27
- export const CHOOSE_KEYBOARD_LAYOUT: Command = {
29
+ export const CHOOSE_KEYBOARD_LAYOUT = Command.toLocalizedCommand({
28
30
  id: 'core.keyboard.choose',
29
31
  category: KEYBOARD_CATEGORY,
30
32
  label: 'Choose Keyboard Layout',
31
- };
33
+ }, 'theia/core/keyboard/choose', KEYBOARD_CATEGORY_KEY);
32
34
 
33
35
  }
34
36
 
@@ -50,9 +52,9 @@ export class BrowserKeyboardFrontendContribution implements CommandContribution
50
52
  protected async chooseLayout(): Promise<KeyboardLayoutData | undefined> {
51
53
  const current = this.layoutProvider.currentLayoutData;
52
54
  const autodetect: QuickPickValue<'autodetect'> = {
53
- label: 'Auto-detect',
54
- description: this.layoutProvider.currentLayoutSource !== 'user-choice' ? `(current: ${current.name})` : undefined,
55
- detail: 'Try to detect the keyboard layout from browser information and pressed keys.',
55
+ label: nls.localizeByDefault('Auto-detect'),
56
+ description: this.layoutProvider.currentLayoutSource !== 'user-choice' ? nls.localize('theia/core/keyboard/current', '(current: {0})', current.name) : undefined,
57
+ detail: nls.localize('theia/core/keyboard/tryDetect', 'Try to detect the keyboard layout from browser information and pressed keys.'),
56
58
  value: 'autodetect'
57
59
  };
58
60
  const pcLayouts = this.layoutProvider.allLayoutData
@@ -64,20 +66,22 @@ export class BrowserKeyboardFrontendContribution implements CommandContribution
64
66
  .sort((a, b) => compare(a.name, b.name))
65
67
  .map(layout => this.toQuickPickValue(layout, current === layout));
66
68
  let layouts: Array<QuickPickValue<KeyboardLayoutData | 'autodetect'> | QuickPickItem>;
69
+ const macKeyboards = nls.localize('theia/core/keyboard/mac', 'Mac Keyboards');
70
+ const pcKeyboards = nls.localize('theia/core/keyboard/pc', 'PC Keyboards');
67
71
  if (isOSX) {
68
72
  layouts = [
69
73
  autodetect,
70
- { type: 'separator', label: 'Mac Keyboards' }, ...macLayouts,
71
- { type: 'separator', label: 'PC Keyboards' }, ...pcLayouts
74
+ { type: 'separator', label: macKeyboards }, ...macLayouts,
75
+ { type: 'separator', label: pcKeyboards }, ...pcLayouts
72
76
  ];
73
77
  } else {
74
78
  layouts = [
75
79
  autodetect,
76
- { type: 'separator', label: 'PC Keyboards' }, ...pcLayouts,
77
- { type: 'separator', label: 'Mac Keyboards' }, ...macLayouts
80
+ { type: 'separator', label: pcKeyboards }, ...pcLayouts,
81
+ { type: 'separator', label: macKeyboards }, ...macLayouts
78
82
  ];
79
83
  }
80
- const selectedItem = await this.quickInputService?.showQuickPick(layouts, { placeholder: 'Choose a keyboard layout' });
84
+ const selectedItem = await this.quickInputService?.showQuickPick(layouts, { placeholder: nls.localize('theia/core/keyboard/chooseLayout', 'Choose a keyboard layout') });
81
85
  if (selectedItem && ('value' in selectedItem)) {
82
86
  return this.layoutProvider.setLayoutData(selectedItem.value);
83
87
  }
@@ -86,7 +90,8 @@ export class BrowserKeyboardFrontendContribution implements CommandContribution
86
90
  protected toQuickPickValue(layout: KeyboardLayoutData, isCurrent: boolean): QuickPickValue<KeyboardLayoutData> {
87
91
  return {
88
92
  label: layout.name,
89
- description: `${layout.hardware === 'mac' ? 'Mac' : 'PC'} (${layout.language})${isCurrent ? ' - current layout' : ''}`,
93
+ description:
94
+ `${layout.hardware === 'mac' ? 'Mac' : 'PC'} (${layout.language})${isCurrent ? nls.localize('theia/core/keyboard/currentLayout', ' - current layout') : ''}`,
90
95
  value: layout
91
96
  };
92
97
  }
@@ -14,6 +14,10 @@
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
16
 
17
+ import { enableJSDOM } from '../test/jsdom';
18
+
19
+ let disableJSDOM = enableJSDOM();
20
+
17
21
  import { Container, injectable } from 'inversify';
18
22
  import type { IMacKeyboardLayoutInfo } from 'native-keymap';
19
23
  import * as chai from 'chai';
@@ -26,11 +30,15 @@ import { WindowService } from '../window/window-service';
26
30
  import { BrowserKeyboardLayoutProvider } from './browser-keyboard-layout-provider';
27
31
  import { Key } from './keys';
28
32
 
33
+ disableJSDOM();
34
+
29
35
  describe('browser keyboard layout provider', function (): void {
30
36
 
31
37
  let stubOSX: sinon.SinonStub;
32
38
  let stubWindows: sinon.SinonStub;
33
- let stubNavigator: sinon.SinonStub;
39
+
40
+ before(() => disableJSDOM = enableJSDOM());
41
+ after(() => disableJSDOM());
34
42
 
35
43
  const setup = (system: 'mac' | 'win' | 'linux') => {
36
44
  switch (system) {
@@ -47,7 +55,6 @@ describe('browser keyboard layout provider', function (): void {
47
55
  stubWindows = sinon.stub(os, 'isWindows').value(false);
48
56
  }
49
57
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
50
- stubNavigator = sinon.stub(global, 'navigator' as any).value({});
51
58
  const container = new Container();
52
59
  container.bind(BrowserKeyboardLayoutProvider).toSelf();
53
60
  container.bind(ILogger).to(MockLogger);
@@ -61,7 +68,6 @@ describe('browser keyboard layout provider', function (): void {
61
68
  afterEach(() => {
62
69
  stubOSX.restore();
63
70
  stubWindows.restore();
64
- stubNavigator.restore();
65
71
  });
66
72
 
67
73
  it('detects German Mac layout', async () => {
@@ -83,7 +89,7 @@ describe('browser keyboard layout provider', function (): void {
83
89
  currentLayout = l;
84
90
  });
85
91
 
86
- chai.expect((currentLayout.info as IMacKeyboardLayoutInfo).id).to.equal('com.apple.keylayout.US');
92
+ chai.expect((currentLayout.info as IMacKeyboardLayoutInfo).id).to.equal('com.apple.keylayout.German');
87
93
  service.validateKey({ code: Key.SEMICOLON.code, character: 'm' });
88
94
  chai.expect((currentLayout.info as IMacKeyboardLayoutInfo).id).to.equal('com.apple.keylayout.French');
89
95
  });