-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
rework monaco commands to align with VS Code #7539
Conversation
40ef2e1
to
42ea5bd
Compare
Monaco editor commands incorrectly execute with the outer editor context, instead of the embedded one. Steps to reproduce:
|
You did not do any changes in the input, only focused it? I think it is the same in VS Code. |
commands.registerCommand({ id: 'actions.find' }, { | ||
execute: () => commands.executeCommand('actions.find') | ||
}); | ||
commands.registerCommand({ id: 'undo' }, { | ||
execute: () => commands.executeCommand('undo') | ||
}); | ||
commands.registerCommand({ id: 'redo' }, { | ||
execute: () => commands.executeCommand('redo') | ||
}); | ||
commands.registerCommand({ id: 'editor.action.startFindReplaceAction' }, { | ||
execute: () => commands.executeCommand('editor.action.startFindReplaceAction') | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How can I verify this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should be able to call these commands via CommandService
. I think we did it already by using undo/redo/select and find.
The issue with this code that it tries to override commands contributed by the monaco extension. In the good case it does nothing, just a warning in logs that such command already registered (what is happening on master i believe), in the worse it registers before monaco and causes infinity recursion.
This comment has been minimized.
This comment has been minimized.
@kittaakos in VS Code git input is a Monaco editor, try with the search in workspace input |
You're right. The behavior isn't nice in VS Code editor, but Theia works as VS Code. I had to use the SIW |
42ea5bd
to
021fca5
Compare
You are right about I've adjuster handlers and added js-docs to exposed |
2a1d9a0
to
49e9334
Compare
@kittaakos I've answered/addressed all your comments. Dirty editor tests should be good now too. Code was assuming that we always load editor model to open from the disk or already processed all disk changes. But tests revealed that there are cases when we did not receive all events yet but already trying to open an editor. I've added a guard that if a model looks invalid then sync with the disk before throwing an invalid model exception. I've also updated |
@akosyakov, can you please rebase from the |
Signed-off-by: Anton Kosyakov <[email protected]>
This reverts commit 40b1d45.
Signed-off-by: Anton Kosyakov <[email protected]>
49e9334
to
692f9a6
Compare
@kittaakos done, trying it as well as soon as the local build is through |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have verified it once more with the electron example; it works as expected! Very slick fix 👍
git pull (I'm on master) Still same error. Using theia/plugins/vscodevim.vim-1.13.1.vsix with size 1952450. Do I have to do some 'clean' or using different vscode-vim plugin from other registry? |
Found something at startup for CTRL+F: |
@tavoda sounds like it was old version. This PR removes double registration: #7539 (comment) |
Once more: EVERYTHING OK, CTRL + F is working 😎 thank you |
Hmmm too soon, now basic movements like hjkl is not working, instead of movement it looks like in insert mode and <ESC> doesn't help. However CTRL+F is working 😢 |
@tavoda thanks for checking, please open an issue 🙏 |
What it does
theia/packages/monaco/src/browser/monaco-command.ts
Lines 80 to 187 in 42ea5bd
How to test
Review checklist
Reminder for reviewers