I want to overwrite saveWorkspaceAs method,but meet a error

when I create a new class A extends WorkspaceFrontendContribution, but It tells me that this.confirmOverwrite is a private method, and can’t access, what should I do?

[original thread by oyo]

You can use index access to work around private methods:

const superMethod = obj['privateMethod'];
obj['privateMethod'] = (arg1, ..., argN) => {
   // do something
  const result = superMethod(arg1, ..., argN);
  // do something
  return result;
}

or send a PR to Theia to change private to protected visibility