@@ -84,10 +84,7 @@ import { BoardsAutoInstaller } from './boards/boards-auto-installer';
8484import { ShellLayoutRestorer } from './theia/core/shell-layout-restorer' ;
8585import { ListItemRenderer } from './widgets/component-list/list-item-renderer' ;
8686import { ColorContribution } from '@theia/core/lib/browser/color-application-contribution' ;
87- import {
88- MonacoThemeJson ,
89- MonacoThemingService ,
90- } from '@theia/monaco/lib/browser/monaco-theming-service' ;
87+
9188import {
9289 ArduinoDaemonPath ,
9390 ArduinoDaemon ,
@@ -181,8 +178,6 @@ import { EditorCommandContribution } from './theia/editor/editor-command';
181178import { NavigatorTabBarDecorator as TheiaNavigatorTabBarDecorator } from '@theia/navigator/lib/browser/navigator-tab-bar-decorator' ;
182179import { NavigatorTabBarDecorator } from './theia/navigator/navigator-tab-bar-decorator' ;
183180import { Debug } from './contributions/debug' ;
184- import { DebugSessionManager } from './theia/debug/debug-session-manager' ;
185- import { DebugSessionManager as TheiaDebugSessionManager } from '@theia/debug/lib/browser/debug-session-manager' ;
186181import { Sketchbook } from './contributions/sketchbook' ;
187182import { DebugFrontendApplicationContribution } from './theia/debug/debug-frontend-application-contribution' ;
188183import { DebugFrontendApplicationContribution as TheiaDebugFrontendApplicationContribution } from '@theia/debug/lib/browser/debug-frontend-application-contribution' ;
@@ -313,10 +308,6 @@ import { SelectedBoard } from './contributions/selected-board';
313308import { CheckForIDEUpdates } from './contributions/check-for-ide-updates' ;
314309import { OpenBoardsConfig } from './contributions/open-boards-config' ;
315310import { SketchFilesTracker } from './contributions/sketch-files-tracker' ;
316- import { MonacoThemeServiceIsReady } from './utils/window' ;
317- import { Deferred } from '@theia/core/lib/common/promise-util' ;
318- import { StatusBarImpl } from './theia/core/status-bar' ;
319- import { StatusBarImpl as TheiaStatusBarImpl } from '@theia/core/lib/browser' ;
320311import { EditorMenuContribution } from './theia/editor/editor-file' ;
321312import { EditorMenuContribution as TheiaEditorMenuContribution } from '@theia/editor/lib/browser/editor-menu' ;
322313import { PreferencesEditorWidget as TheiaPreferencesEditorWidget } from '@theia/preferences/lib/browser/views/preference-editor-widget' ;
@@ -337,32 +328,12 @@ import { InterfaceScale } from './contributions/interface-scale';
337328import { OpenHandler } from '@theia/core/lib/browser/opener-service' ;
338329import { NewCloudSketch } from './contributions/new-cloud-sketch' ;
339330import { SketchbookCompositeWidget } from './widgets/sketchbook/sketchbook-composite-widget' ;
340-
341- const registerArduinoThemes = ( ) => {
342- const themes : MonacoThemeJson [ ] = [
343- {
344- id : 'arduino-theme' ,
345- label : 'Light (Arduino)' ,
346- uiTheme : 'vs' ,
347- json : require ( '../../src/browser/data/default.color-theme.json' ) ,
348- } ,
349- {
350- id : 'arduino-theme-dark' ,
351- label : 'Dark (Arduino)' ,
352- uiTheme : 'vs-dark' ,
353- json : require ( '../../src/browser/data/dark.color-theme.json' ) ,
354- } ,
355- ] ;
356- themes . forEach ( ( theme ) => MonacoThemingService . register ( theme ) ) ;
357- } ;
358- // eslint-disable-next-line @typescript-eslint/no-explicit-any
359- const global = window as any ;
360- const ready = global [ MonacoThemeServiceIsReady ] as Deferred ;
361- if ( ready ) {
362- ready . promise . then ( registerArduinoThemes ) ;
363- } else {
364- registerArduinoThemes ( ) ;
365- }
331+ import { WindowTitleUpdater } from './theia/core/window-title-updater' ;
332+ import { WindowTitleUpdater as TheiaWindowTitleUpdater } from '@theia/core/lib/browser/window/window-title-updater' ;
333+ import { ThemeService } from './theia/core/theming' ;
334+ import { ThemeService as TheiaThemeService } from '@theia/core/lib/browser/theming' ;
335+ import { MonacoThemingService } from './theia/monaco/monaco-theming-service' ;
336+ import { MonacoThemingService as TheiaMonacoThemingService } from '@theia/monaco/lib/browser/monaco-theming-service' ;
366337
367338export default new ContainerModule ( ( bind , unbind , isBound , rebind ) => {
368339 // Commands and toolbar items
@@ -838,9 +809,6 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
838809 bind ( AboutDialog ) . toSelf ( ) . inSingletonScope ( ) ;
839810 rebind ( TheiaAboutDialog ) . toService ( AboutDialog ) ;
840811
841- // To avoid running `Save All` when there are no dirty editors before starting the debug session.
842- bind ( DebugSessionManager ) . toSelf ( ) . inSingletonScope ( ) ;
843- rebind ( TheiaDebugSessionManager ) . toService ( DebugSessionManager ) ;
844812 // To remove the `Run` menu item from the application menu.
845813 bind ( DebugFrontendApplicationContribution ) . toSelf ( ) . inSingletonScope ( ) ;
846814 rebind ( TheiaDebugFrontendApplicationContribution ) . toService (
@@ -854,10 +822,6 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
854822 bind ( WidgetManager ) . toSelf ( ) . inSingletonScope ( ) ;
855823 rebind ( TheiaWidgetManager ) . toService ( WidgetManager ) ;
856824
857- // To avoid running a status bar update on every single `keypress` event from the editor.
858- bind ( StatusBarImpl ) . toSelf ( ) . inSingletonScope ( ) ;
859- rebind ( TheiaStatusBarImpl ) . toService ( StatusBarImpl ) ;
860-
861825 // Debounced update for the tab-bar toolbar when typing in the editor.
862826 bind ( DockPanelRenderer ) . toSelf ( ) ;
863827 rebind ( TheiaDockPanelRenderer ) . toService ( DockPanelRenderer ) ;
@@ -942,7 +906,7 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
942906 bind ( LocalCacheFsProvider ) . toSelf ( ) . inSingletonScope ( ) ;
943907 bind ( FileServiceContribution ) . toService ( LocalCacheFsProvider ) ;
944908 bind ( CloudSketchbookCompositeWidget ) . toSelf ( ) ;
945- bind < WidgetFactory > ( WidgetFactory ) . toDynamicValue ( ( ctx ) => ( {
909+ bind ( WidgetFactory ) . toDynamicValue ( ( ctx ) => ( {
946910 id : 'cloud-sketchbook-composite-widget' ,
947911 createWidget : ( ) => ctx . container . get ( CloudSketchbookCompositeWidget ) ,
948912 } ) ) ;
@@ -991,4 +955,14 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
991955 rebind ( TheiaHostedPluginSupport ) . toService ( HostedPluginSupport ) ;
992956 bind ( HostedPluginEvents ) . toSelf ( ) . inSingletonScope ( ) ;
993957 bind ( FrontendApplicationContribution ) . toService ( HostedPluginEvents ) ;
958+
959+ // custom window titles
960+ bind ( WindowTitleUpdater ) . toSelf ( ) . inSingletonScope ( ) ;
961+ rebind ( TheiaWindowTitleUpdater ) . toService ( WindowTitleUpdater ) ;
962+
963+ // register Arduino themes
964+ bind ( ThemeService ) . toSelf ( ) . inSingletonScope ( ) ;
965+ rebind ( TheiaThemeService ) . toService ( ThemeService ) ;
966+ bind ( MonacoThemingService ) . toSelf ( ) . inSingletonScope ( ) ;
967+ rebind ( TheiaMonacoThemingService ) . toService ( MonacoThemingService ) ;
994968} ) ;
0 commit comments