Skip to content

Commit

Permalink
fix: theme service binding
Browse files Browse the repository at this point in the history
cleaned up unused symbol

closes #1742

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
  • Loading branch information
Akos Kitta authored and kittaakos committed Dec 7, 2022
1 parent ed8ed15 commit c4172ee
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,8 @@ import { NewCloudSketch } from './contributions/new-cloud-sketch';
import { SketchbookCompositeWidget } from './widgets/sketchbook/sketchbook-composite-widget';
import { WindowTitleUpdater } from './theia/core/window-title-updater';
import { WindowTitleUpdater as TheiaWindowTitleUpdater } from '@theia/core/lib/browser/window/window-title-updater';
import { ThemeService } from './theia/core/theming';
import { ThemeService as TheiaThemeService } from '@theia/core/lib/browser/theming';
import { ThemeServiceWithDB } from './theia/core/theming';
import { ThemeServiceWithDB as TheiaThemeServiceWithDB } from '@theia/monaco/lib/browser/monaco-indexed-db';
import { MonacoThemingService } from './theia/monaco/monaco-theming-service';
import { MonacoThemingService as TheiaMonacoThemingService } from '@theia/monaco/lib/browser/monaco-theming-service';
import { TypeHierarchyServiceProvider } from './theia/typehierarchy/type-hierarchy-service';
Expand Down Expand Up @@ -959,8 +959,8 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
rebind(TheiaWindowTitleUpdater).toService(WindowTitleUpdater);

// register Arduino themes
bind(ThemeService).toSelf().inSingletonScope();
rebind(TheiaThemeService).toService(ThemeService);
bind(ThemeServiceWithDB).toSelf().inSingletonScope();
rebind(TheiaThemeServiceWithDB).toService(ThemeServiceWithDB);
bind(MonacoThemingService).toSelf().inSingletonScope();
rebind(TheiaMonacoThemingService).toService(MonacoThemingService);

Expand Down
4 changes: 2 additions & 2 deletions arduino-ide-extension/src/browser/theia/core/theming.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ThemeService as TheiaThemeService } from '@theia/core/lib/browser/theming';
import type { Theme } from '@theia/core/lib/common/theme';
import { injectable } from '@theia/core/shared/inversify';
import { ThemeServiceWithDB as TheiaThemeServiceWithDB } from '@theia/monaco/lib/browser/monaco-indexed-db';

export namespace ArduinoThemes {
export const Light: Theme = {
Expand All @@ -18,7 +18,7 @@ export namespace ArduinoThemes {
}

@injectable()
export class ThemeService extends TheiaThemeService {
export class ThemeServiceWithDB extends TheiaThemeServiceWithDB {
protected override init(): void {
this.register(ArduinoThemes.Light, ArduinoThemes.Dark);
super.init();
Expand Down
8 changes: 0 additions & 8 deletions arduino-ide-extension/src/browser/utils/window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,3 @@
export function setURL(url: URL, data: any = {}): void {
history.pushState(data, '', url);
}

/**
* If available from the `window` object, then it means, the IDE2 has successfully patched the `MonacoThemingService#init` static method,
* and can wait the custom theme registration.
*/
export const MonacoThemeServiceIsReady = Symbol(
'@arduino-ide#monaco-theme-service-is-ready'
);

0 comments on commit c4172ee

Please sign in to comment.