-
Notifications
You must be signed in to change notification settings - Fork 30k
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
On Type Rename for #88424 #92597
On Type Rename for #88424 #92597
Conversation
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.
Looks good! I just left a few comments.
@@ -3316,7 +3316,7 @@ export const enum EditorOption { | |||
autoClosingQuotes, | |||
autoIndent, | |||
automaticLayout, | |||
autoRename, | |||
renameOnType, |
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 like to keep these sorted alphabetically, please move it down a bit.
autoRename: register(new EditorBooleanOption( | ||
EditorOption.autoRename, 'autoRename', false, | ||
{ description: nls.localize('autoRename', "Controls whether the editor auto renames on type.") } | ||
renameOnType: register(new EditorBooleanOption( |
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.
also here, please move it down a bit.
@@ -243,10 +283,6 @@ export class OnTypeRenameAction extends EditorAction { | |||
kbExpr: EditorContextKeys.editorTextFocus, | |||
primary: KeyMod.CtrlCmd | KeyCode.F2, |
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 think Ctrl+F2/Cmd+F2 are already taken, so perhaps no keybindings is necessary here.
@octref There is still the problem of the Ctrl+F2 conflict, and some tests that need to be skipped. 👍 Otherwise, please merge. I suggest other work in HTML to adopt this feature should IMHO be done in another PR. |
@IllusionMH I pushed 01e01b1 |
This fixes #88424.
editor.renameOnType
languages.registerOnTypeRenameProvider
onTypeRenameProvider
for HTMLProposed API:
I think most of the cases work fine. There are 2 failing tests but I'm not sure why they happen, since the behavior in the editor is correct but the test still fails.
The two cases that's failing in the editor are:
<div|></div>
div
) and then undo for<div|></div>
The cause seems to be that setting
EditorOperationType
doesn't work for paste/delete-word.But other than that, this seems to work fine. I'm planning to put it in insiders and turn it on for people who have enabled
html.mirrorCursorOnType
.