Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[editor] Error when doing an undo with Ctrl/Cmd+Z in a JSON editor #1514

Open
kittaakos opened this issue Mar 15, 2018 · 8 comments
Open

[editor] Error when doing an undo with Ctrl/Cmd+Z in a JSON editor #1514

kittaakos opened this issue Mar 15, 2018 · 8 comments
Labels
bug bugs found in the application editor issues related to the editor monaco issues related to monaco

Comments

@kittaakos
Copy link
Contributor

This happens on the branch GH-1479. My WS root is theia. Open the lerna.json in the WS root, edit it, undo it with Ctrl/Cmd+Z:

16:47:20.070 editor.main.js:31 Uncaught (in promise) TypeError: this._state.then is not a function
    at n.Class.derive._creator.then (editor.main.js:31)
then @ editor.main.js:31
Promise.then (async)
step @ monaco-outline-contribution.ts:6
(anonymous) @ monaco-outline-contribution.ts:6
__awaiter @ monaco-outline-contribution.ts:6
(anonymous) @ monaco-outline-contribution.ts:89
o @ editor.main.js:31
t._emitEvents @ editor.main.js:31
e._emitCollected @ editor.main.js:31
e.endDeferredEmit @ editor.main.js:31
t.undo @ editor.main.js:31
t.trigger @ editor.main.js:31
execute @ monaco-command.ts:137
MonacoCommandRegistry.execute @ monaco-command-registry.ts:60
execute @ monaco-command-registry.ts:50
KeybindingRegistry.tryKeybindingExecution @ keybinding.ts:372
KeybindingRegistry.run @ keybinding.ts:406
(anonymous) @ frontend-application.ts:98

Interestingly, this happens only, when you are trying to undo at least two characters long modification. The undo succeeds, by the way.

@kittaakos kittaakos added bug bugs found in the application editor issues related to the editor keybindings issues related to keybindings labels Mar 15, 2018
@kittaakos kittaakos self-assigned this Mar 20, 2018
@kittaakos
Copy link
Contributor Author

It seems to happen only if we are undoing some (2-* characters) deletion.

@kittaakos kittaakos added monaco issues related to monaco and removed keybindings issues related to keybindings labels Mar 21, 2018
@kittaakos
Copy link
Contributor Author

It also happens in the CSS editor, but for instance, not in a JS editor.

@kittaakos
Copy link
Contributor Author

It does not happen in the HTML editor. (Unlike the CSS and the JSON editor, the HTML one does not provide code completion and CA though.)

@kittaakos
Copy link
Contributor Author

I hit another error when I was trying to figure out the cause of the original issue:

Error: Canceled
    at Object.enter (winjs.base.raw.js:824)
    at Promise_ctor._run (winjs.base.raw.js:1068)
    at Promise_ctor.cancel (winjs.base.raw.js:964)
    at Object.enter (winjs.base.raw.js:782)
    at _Base.Class.derive._creator._run (winjs.base.raw.js:1068)
    at _Base.Class.derive._creator.cancel (winjs.base.raw.js:964)
    at _Base.Class.derive._creator._cancelAction (winjs.base.raw.js:1311)
    at Object.enter (winjs.base.raw.js:805)
    at _Base.Class.derive._creator._run (winjs.base.raw.js:1068)
    at _Base.Class.derive._creator.cancel (winjs.base.raw.js:964)

I am not sure if that is a real issue or the expected way to handle cancelations, but it would be nice not to show this in the console.

@kittaakos
Copy link
Contributor Author

I have tried to reproduce this issue outside of Theia by cloning the examples from here, I have set the monaco-editor version to 0.10.1 and the languages to json, just like in Theia. The error does not happen.

@kittaakos
Copy link
Contributor Author

I can confirm, it happens when autoSave is off. We need to revisit this issue once the monaco-editor and monaco-languages have been updated.

@kittaakos
Copy link
Contributor Author

Ref: #1539.

@kittaakos kittaakos removed their assignment Mar 26, 2018
@akosyakov
Copy link
Member

@kittaakos Can you reproduce it against #7481?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs found in the application editor issues related to the editor monaco issues related to monaco
Projects
None yet
Development

No branches or pull requests

2 participants