Glsp diagram is not rendered

I added a button to my glsp view to switch views (you already answered me)
but after developing the switch button and binding what was injected, the view isn’t rendered. I have no errors.

by the way, I haven’t tested my work yet, so please your feedback is appreciated concerning the developing.


export class ButtonOverlay extends AbstractUIExtension {
  protected readonly actionDispatcher: IActionDispatcher;

  protected readonly openerService: OpenerService;

  static readonly ID = "button-overlay";

  protected initializeContents(containerElement: HTMLElement): void {
          "Switch to table view",
          SwitchViewAction.create('my-view-uri', {})
  protected createButton(
    id: string,
    label: string,
    codiconId: string,
    action: SwitchViewAction
  ): HTMLElement {
    const baseDiv = document.getElementById(this.options.baseDiv);
    if (baseDiv) {
      const button = document.createElement("div");
      const insertedDiv = baseDiv.insertBefore(button, baseDiv.firstChild); = id;
      const icon = this.createIcon(codiconId);
      insertedDiv.onclick = () => {
        const uri = new URI(action.uri);
        open(this.openerService, uri, action.openerOptions);
        insertedDiv.insertAdjacentText("beforeend", label);
      return button;
    return document.createElement("div");

  protected createIcon(codiconId: string): HTMLElement {
    const icon = document.createElement("i");
    icon.classList.add(...codiconCSSClasses(codiconId), "overlay-icon");
    return icon;
export interface SwitchViewAction {
  readonly kind: string;
  readonly uri: string;
  readonly openerOptions?: object;

export class SwitchViewAction implements SwitchViewAction {
  static readonly KIND = "switchView";

  constructor(readonly uri: string, readonly openerOptions?: object) { }

  // get kind() {
  //   return SwitchViewAction.KIND;
  // }

  static create(uri: string, openerOptions?: object): SwitchViewAction {
    return new SwitchViewAction(uri, openerOptions);

and inside di.config.ts:


This doesn’t seem correct. What are you trying to accomplish with this line?

For future references: this question has been answered in glsp diagram is not rendered · Discussion #854 · eclipse-glsp/glsp · GitHub