CodinGame / monaco-vscode-api

VSCode public API plugged on the monaco editor
MIT License
205 stars 29 forks source link

"Reopen Editor With..." does not work for custom editors #421

Closed CompuIves closed 1 month ago

CompuIves commented 2 months ago

To reproduce:

  1. In the demo, open test.customeditor
  2. Open the command palette
  3. Select "Reopen editor with..."

It will throw an error, saying unsupported, because it's trying to call a function on a mock EditorGroup:

image

It looks like the custom editors contributed using the registerCustomEditor API have EmptyEditorGroup as its editor group. It used to work before, but I don't know exactly when it stopped working. I suspect somewhere before version 3.2.x.

CompuIves commented 1 month ago

Hmm, with the latest version in the demo I still see the same issue. The error of EmptyEditorGroup is gone, but nothing happens when selecting "Reopen Editor With..." on a custom editor. I think it's because the group is null in this case, because I also see a new kind of editor from the history service:

Screenshot 2024-05-08 at 13 12 57

Which corresponds to this code (line 182):

image
CompuIves commented 1 month ago

Nevermind! It does work here, I forgot to pass the editor group. That said, it's interesting to see that the demo didn't work yet 🤔

CGNonofr commented 1 month ago

I don't know how it can work in your case, since it requires the input toUntyped method to be implemented to work

github-actions[bot] commented 1 month ago

:tada: This issue has been resolved in version 5.1.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: