@@ -3,10 +3,7 @@ import { ContainerModule } from '@theia/core/shared/inversify';
3
3
import { WidgetFactory } from '@theia/core/lib/browser/widget-manager' ;
4
4
import { CommandContribution } from '@theia/core/lib/common/command' ;
5
5
import { 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' ;
10
7
import { WebSocketConnectionProvider } from '@theia/core/lib/browser/messaging/ws-connection-provider' ;
11
8
import {
12
9
FrontendApplicationContribution ,
@@ -84,10 +81,7 @@ import { BoardsAutoInstaller } from './boards/boards-auto-installer';
84
81
import { ShellLayoutRestorer } from './theia/core/shell-layout-restorer' ;
85
82
import { ListItemRenderer } from './widgets/component-list/list-item-renderer' ;
86
83
import { 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
+
91
85
import {
92
86
ArduinoDaemonPath ,
93
87
ArduinoDaemon ,
@@ -137,7 +131,6 @@ import { Settings } from './contributions/settings';
137
131
import { WorkspaceCommandContribution } from './theia/workspace/workspace-commands' ;
138
132
import { WorkspaceDeleteHandler as TheiaWorkspaceDeleteHandler } from '@theia/workspace/lib/browser/workspace-delete-handler' ;
139
133
import { WorkspaceDeleteHandler } from './theia/workspace/workspace-delete-handler' ;
140
- import { TabBarToolbar } from './theia/core/tab-bar-toolbar' ;
141
134
import { EditorWidgetFactory as TheiaEditorWidgetFactory } from '@theia/editor/lib/browser/editor-widget-factory' ;
142
135
import { EditorWidgetFactory } from './theia/editor/editor-widget-factory' ;
143
136
import { BurnBootloader } from './contributions/burn-bootloader' ;
@@ -181,8 +174,6 @@ import { EditorCommandContribution } from './theia/editor/editor-command';
181
174
import { NavigatorTabBarDecorator as TheiaNavigatorTabBarDecorator } from '@theia/navigator/lib/browser/navigator-tab-bar-decorator' ;
182
175
import { NavigatorTabBarDecorator } from './theia/navigator/navigator-tab-bar-decorator' ;
183
176
import { 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' ;
186
177
import { Sketchbook } from './contributions/sketchbook' ;
187
178
import { DebugFrontendApplicationContribution } from './theia/debug/debug-frontend-application-contribution' ;
188
179
import { DebugFrontendApplicationContribution as TheiaDebugFrontendApplicationContribution } from '@theia/debug/lib/browser/debug-frontend-application-contribution' ;
@@ -241,7 +232,6 @@ import { UploadFirmware } from './contributions/upload-firmware';
241
232
import {
242
233
UploadFirmwareDialog ,
243
234
UploadFirmwareDialogProps ,
244
- UploadFirmwareDialogWidget ,
245
235
} from './dialogs/firmware-uploader/firmware-uploader-dialog' ;
246
236
247
237
import { UploadCertificate } from './contributions/upload-certificate' ;
@@ -271,7 +261,6 @@ import { IDEUpdaterClientImpl } from './ide-updater/ide-updater-client-impl';
271
261
import {
272
262
IDEUpdaterDialog ,
273
263
IDEUpdaterDialogProps ,
274
- IDEUpdaterDialogWidget ,
275
264
} from './dialogs/ide-updater/ide-updater-dialog' ;
276
265
import { ElectronIpcConnectionProvider } from '@theia/core/lib/electron-browser/messaging/electron-ipc-connection-provider' ;
277
266
import { MonitorModel } from './monitor-model' ;
@@ -313,10 +302,6 @@ import { SelectedBoard } from './contributions/selected-board';
313
302
import { CheckForIDEUpdates } from './contributions/check-for-ide-updates' ;
314
303
import { OpenBoardsConfig } from './contributions/open-boards-config' ;
315
304
import { 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' ;
320
305
import { EditorMenuContribution } from './theia/editor/editor-file' ;
321
306
import { EditorMenuContribution as TheiaEditorMenuContribution } from '@theia/editor/lib/browser/editor-menu' ;
322
307
import { PreferencesEditorWidget as TheiaPreferencesEditorWidget } from '@theia/preferences/lib/browser/views/preference-editor-widget' ;
@@ -337,32 +322,16 @@ import { InterfaceScale } from './contributions/interface-scale';
337
322
import { OpenHandler } from '@theia/core/lib/browser/opener-service' ;
338
323
import { NewCloudSketch } from './contributions/new-cloud-sketch' ;
339
324
import { 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
- }
325
+ import { WindowTitleUpdater } from './theia/core/window-title-updater' ;
326
+ import { WindowTitleUpdater as TheiaWindowTitleUpdater } from '@theia/core/lib/browser/window/window-title-updater' ;
327
+ import { ThemeService } from './theia/core/theming' ;
328
+ import { ThemeService as TheiaThemeService } from '@theia/core/lib/browser/theming' ;
329
+ import { MonacoThemingService } from './theia/monaco/monaco-theming-service' ;
330
+ import { MonacoThemingService as TheiaMonacoThemingService } from '@theia/monaco/lib/browser/monaco-theming-service' ;
331
+ import { TypeHierarchyServiceProvider } from './theia/typehierarchy/type-hierarchy-service' ;
332
+ import { TypeHierarchyServiceProvider as TheiaTypeHierarchyServiceProvider } from '@theia/typehierarchy/lib/browser/typehierarchy-service' ;
333
+ import { TypeHierarchyContribution } from './theia/typehierarchy/type-hierarchy-contribution' ;
334
+ import { TypeHierarchyContribution as TheiaTypeHierarchyContribution } from '@theia/typehierarchy/lib/browser/typehierarchy-contribution' ;
366
335
367
336
export default new ContainerModule ( ( bind , unbind , isBound , rebind ) => {
368
337
// Commands and toolbar items
@@ -587,14 +556,6 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
587
556
. to ( WorkspaceDeleteHandler )
588
557
. inSingletonScope ( ) ;
589
558
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
- ) ;
598
559
bind ( OutputChannelManager ) . toSelf ( ) . inSingletonScope ( ) ;
599
560
rebind ( TheiaOutputChannelManager ) . toService ( OutputChannelManager ) ;
600
561
bind ( OutputChannelRegistryMainImpl ) . toSelf ( ) . inTransientScope ( ) ;
@@ -838,9 +799,6 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
838
799
bind ( AboutDialog ) . toSelf ( ) . inSingletonScope ( ) ;
839
800
rebind ( TheiaAboutDialog ) . toService ( AboutDialog ) ;
840
801
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 ) ;
844
802
// To remove the `Run` menu item from the application menu.
845
803
bind ( DebugFrontendApplicationContribution ) . toSelf ( ) . inSingletonScope ( ) ;
846
804
rebind ( TheiaDebugFrontendApplicationContribution ) . toService (
@@ -854,10 +812,6 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
854
812
bind ( WidgetManager ) . toSelf ( ) . inSingletonScope ( ) ;
855
813
rebind ( TheiaWidgetManager ) . toService ( WidgetManager ) ;
856
814
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
-
861
815
// Debounced update for the tab-bar toolbar when typing in the editor.
862
816
bind ( DockPanelRenderer ) . toSelf ( ) ;
863
817
rebind ( TheiaDockPanelRenderer ) . toService ( DockPanelRenderer ) ;
@@ -942,12 +896,11 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
942
896
bind ( LocalCacheFsProvider ) . toSelf ( ) . inSingletonScope ( ) ;
943
897
bind ( FileServiceContribution ) . toService ( LocalCacheFsProvider ) ;
944
898
bind ( CloudSketchbookCompositeWidget ) . toSelf ( ) ;
945
- bind < WidgetFactory > ( WidgetFactory ) . toDynamicValue ( ( ctx ) => ( {
899
+ bind ( WidgetFactory ) . toDynamicValue ( ( ctx ) => ( {
946
900
id : 'cloud-sketchbook-composite-widget' ,
947
901
createWidget : ( ) => ctx . container . get ( CloudSketchbookCompositeWidget ) ,
948
902
} ) ) ;
949
903
950
- bind ( UploadFirmwareDialogWidget ) . toSelf ( ) . inSingletonScope ( ) ;
951
904
bind ( UploadFirmwareDialog ) . toSelf ( ) . inSingletonScope ( ) ;
952
905
bind ( UploadFirmwareDialogProps ) . toConstantValue ( {
953
906
title : 'UploadFirmware' ,
@@ -958,7 +911,6 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
958
911
title : 'UploadCertificate' ,
959
912
} ) ;
960
913
961
- bind ( IDEUpdaterDialogWidget ) . toSelf ( ) . inSingletonScope ( ) ;
962
914
bind ( IDEUpdaterDialog ) . toSelf ( ) . inSingletonScope ( ) ;
963
915
bind ( IDEUpdaterDialogProps ) . toConstantValue ( {
964
916
title : 'IDEUpdater' ,
@@ -991,4 +943,23 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
991
943
rebind ( TheiaHostedPluginSupport ) . toService ( HostedPluginSupport ) ;
992
944
bind ( HostedPluginEvents ) . toSelf ( ) . inSingletonScope ( ) ;
993
945
bind ( FrontendApplicationContribution ) . toService ( HostedPluginEvents ) ;
946
+
947
+ // custom window titles
948
+ bind ( WindowTitleUpdater ) . toSelf ( ) . inSingletonScope ( ) ;
949
+ rebind ( TheiaWindowTitleUpdater ) . toService ( WindowTitleUpdater ) ;
950
+
951
+ // register Arduino themes
952
+ bind ( ThemeService ) . toSelf ( ) . inSingletonScope ( ) ;
953
+ rebind ( TheiaThemeService ) . toService ( ThemeService ) ;
954
+ bind ( MonacoThemingService ) . toSelf ( ) . inSingletonScope ( ) ;
955
+ rebind ( TheiaMonacoThemingService ) . toService ( MonacoThemingService ) ;
956
+
957
+ // disable type-hierarchy support
958
+ // https://github.com/eclipse-theia/theia/commit/16c88a584bac37f5cf3cc5eb92ffdaa541bda5be
959
+ bind ( TypeHierarchyServiceProvider ) . toSelf ( ) . inSingletonScope ( ) ;
960
+ rebind ( TheiaTypeHierarchyServiceProvider ) . toService (
961
+ TypeHierarchyServiceProvider
962
+ ) ;
963
+ bind ( TypeHierarchyContribution ) . toSelf ( ) . inSingletonScope ( ) ;
964
+ rebind ( TheiaTypeHierarchyContribution ) . toService ( TypeHierarchyContribution ) ;
994
965
} ) ;
0 commit comments