@@ -3,10 +3,7 @@ import { ContainerModule } from '@theia/core/shared/inversify';
33import { WidgetFactory } from '@theia/core/lib/browser/widget-manager' ;
44import { CommandContribution } from '@theia/core/lib/common/command' ;
55import { bindViewContribution } from '@theia/core/lib/browser/shell/view-contribution' ;
6- import {
7- TabBarToolbarContribution ,
8- TabBarToolbarFactory ,
9- } from '@theia/core/lib/browser/shell/tab-bar-toolbar' ;
6+ import { TabBarToolbarContribution } from '@theia/core/lib/browser/shell/tab-bar-toolbar' ;
107import { WebSocketConnectionProvider } from '@theia/core/lib/browser/messaging/ws-connection-provider' ;
118import {
129 FrontendApplicationContribution ,
@@ -84,10 +81,7 @@ import { BoardsAutoInstaller } from './boards/boards-auto-installer';
8481import { ShellLayoutRestorer } from './theia/core/shell-layout-restorer' ;
8582import { ListItemRenderer } from './widgets/component-list/list-item-renderer' ;
8683import { ColorContribution } from '@theia/core/lib/browser/color-application-contribution' ;
87- import {
88- MonacoThemeJson ,
89- MonacoThemingService ,
90- } from '@theia/monaco/lib/browser/monaco-theming-service' ;
84+
9185import {
9286 ArduinoDaemonPath ,
9387 ArduinoDaemon ,
@@ -137,7 +131,7 @@ import { Settings } from './contributions/settings';
137131import { WorkspaceCommandContribution } from './theia/workspace/workspace-commands' ;
138132import { WorkspaceDeleteHandler as TheiaWorkspaceDeleteHandler } from '@theia/workspace/lib/browser/workspace-delete-handler' ;
139133import { WorkspaceDeleteHandler } from './theia/workspace/workspace-delete-handler' ;
140- import { TabBarToolbar } from './theia/core/tab-bar-toolbar' ;
134+ // import { TabBarToolbar } from './theia/core/tab-bar-toolbar';
141135import { EditorWidgetFactory as TheiaEditorWidgetFactory } from '@theia/editor/lib/browser/editor-widget-factory' ;
142136import { EditorWidgetFactory } from './theia/editor/editor-widget-factory' ;
143137import { BurnBootloader } from './contributions/burn-bootloader' ;
@@ -181,8 +175,6 @@ import { EditorCommandContribution } from './theia/editor/editor-command';
181175import { NavigatorTabBarDecorator as TheiaNavigatorTabBarDecorator } from '@theia/navigator/lib/browser/navigator-tab-bar-decorator' ;
182176import { NavigatorTabBarDecorator } from './theia/navigator/navigator-tab-bar-decorator' ;
183177import { 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' ;
186178import { Sketchbook } from './contributions/sketchbook' ;
187179import { DebugFrontendApplicationContribution } from './theia/debug/debug-frontend-application-contribution' ;
188180import { DebugFrontendApplicationContribution as TheiaDebugFrontendApplicationContribution } from '@theia/debug/lib/browser/debug-frontend-application-contribution' ;
@@ -313,10 +305,6 @@ import { SelectedBoard } from './contributions/selected-board';
313305import { CheckForIDEUpdates } from './contributions/check-for-ide-updates' ;
314306import { OpenBoardsConfig } from './contributions/open-boards-config' ;
315307import { 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' ;
320308import { EditorMenuContribution } from './theia/editor/editor-file' ;
321309import { EditorMenuContribution as TheiaEditorMenuContribution } from '@theia/editor/lib/browser/editor-menu' ;
322310import { PreferencesEditorWidget as TheiaPreferencesEditorWidget } from '@theia/preferences/lib/browser/views/preference-editor-widget' ;
@@ -337,32 +325,12 @@ import { InterfaceScale } from './contributions/interface-scale';
337325import { OpenHandler } from '@theia/core/lib/browser/opener-service' ;
338326import { NewCloudSketch } from './contributions/new-cloud-sketch' ;
339327import { 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- }
328+ import { WindowTitleUpdater } from './theia/core/window-title-updater' ;
329+ import { WindowTitleUpdater as TheiaWindowTitleUpdater } from '@theia/core/lib/browser/window/window-title-updater' ;
330+ import { ThemeService } from './theia/core/theming' ;
331+ import { ThemeService as TheiaThemeService } from '@theia/core/lib/browser/theming' ;
332+ import { MonacoThemingService } from './theia/monaco/monaco-theming-service' ;
333+ import { MonacoThemingService as TheiaMonacoThemingService } from '@theia/monaco/lib/browser/monaco-theming-service' ;
366334
367335export default new ContainerModule ( ( bind , unbind , isBound , rebind ) => {
368336 // Commands and toolbar items
@@ -587,14 +555,14 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
587555 . to ( WorkspaceDeleteHandler )
588556 . inSingletonScope ( ) ;
589557 rebind ( TheiaEditorWidgetFactory ) . to ( EditorWidgetFactory ) . inSingletonScope ( ) ;
590- rebind ( TabBarToolbarFactory ) . toFactory (
591- ( { container : parentContainer } ) =>
592- ( ) => {
593- const container = parentContainer . createChild ( ) ;
594- container . bind ( TabBarToolbar ) . toSelf ( ) . inSingletonScope ( ) ;
595- return container . get ( TabBarToolbar ) ;
596- }
597- ) ;
558+ // rebind(TabBarToolbarFactory).toFactory(
559+ // ({ container: parentContainer }) =>
560+ // () => {
561+ // const container = parentContainer.createChild();
562+ // container.bind(TabBarToolbar).toSelf().inSingletonScope();
563+ // return container.get(TabBarToolbar);
564+ // }
565+ // );
598566 bind ( OutputChannelManager ) . toSelf ( ) . inSingletonScope ( ) ;
599567 rebind ( TheiaOutputChannelManager ) . toService ( OutputChannelManager ) ;
600568 bind ( OutputChannelRegistryMainImpl ) . toSelf ( ) . inTransientScope ( ) ;
@@ -838,9 +806,6 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
838806 bind ( AboutDialog ) . toSelf ( ) . inSingletonScope ( ) ;
839807 rebind ( TheiaAboutDialog ) . toService ( AboutDialog ) ;
840808
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 ) ;
844809 // To remove the `Run` menu item from the application menu.
845810 bind ( DebugFrontendApplicationContribution ) . toSelf ( ) . inSingletonScope ( ) ;
846811 rebind ( TheiaDebugFrontendApplicationContribution ) . toService (
@@ -854,10 +819,6 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
854819 bind ( WidgetManager ) . toSelf ( ) . inSingletonScope ( ) ;
855820 rebind ( TheiaWidgetManager ) . toService ( WidgetManager ) ;
856821
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-
861822 // Debounced update for the tab-bar toolbar when typing in the editor.
862823 bind ( DockPanelRenderer ) . toSelf ( ) ;
863824 rebind ( TheiaDockPanelRenderer ) . toService ( DockPanelRenderer ) ;
@@ -942,7 +903,7 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
942903 bind ( LocalCacheFsProvider ) . toSelf ( ) . inSingletonScope ( ) ;
943904 bind ( FileServiceContribution ) . toService ( LocalCacheFsProvider ) ;
944905 bind ( CloudSketchbookCompositeWidget ) . toSelf ( ) ;
945- bind < WidgetFactory > ( WidgetFactory ) . toDynamicValue ( ( ctx ) => ( {
906+ bind ( WidgetFactory ) . toDynamicValue ( ( ctx ) => ( {
946907 id : 'cloud-sketchbook-composite-widget' ,
947908 createWidget : ( ) => ctx . container . get ( CloudSketchbookCompositeWidget ) ,
948909 } ) ) ;
@@ -991,4 +952,14 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
991952 rebind ( TheiaHostedPluginSupport ) . toService ( HostedPluginSupport ) ;
992953 bind ( HostedPluginEvents ) . toSelf ( ) . inSingletonScope ( ) ;
993954 bind ( FrontendApplicationContribution ) . toService ( HostedPluginEvents ) ;
955+
956+ // custom window titles
957+ bind ( WindowTitleUpdater ) . toSelf ( ) . inSingletonScope ( ) ;
958+ rebind ( TheiaWindowTitleUpdater ) . toService ( WindowTitleUpdater ) ;
959+
960+ // register Arduino themes
961+ bind ( ThemeService ) . toSelf ( ) . inSingletonScope ( ) ;
962+ rebind ( TheiaThemeService ) . toService ( ThemeService ) ;
963+ bind ( MonacoThemingService ) . toSelf ( ) . inSingletonScope ( ) ;
964+ rebind ( TheiaMonacoThemingService ) . toService ( MonacoThemingService ) ;
994965} ) ;
0 commit comments