Skip to content

editor.renameOnType causes unwanted renaming outside of HTML tags #110983

Closed

Description

Version: 1.52.0-insider (user setup)
Commit: a36c68b
Date: 2020-11-19T05:37:52.577Z
Electron: 9.3.3
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Windows_NT x64 10.0.19042
WSL2
Remote-WSL: 0.51.3

Steps to Reproduce:

  1. Enable "editor.renameOnType": true in settings.
  2. Create a Typescript file with the contents below:
function foo(object: Record<string, any>): void {
  const bar = '';
  if (bar === '') {
    bar.toLowerCase();
  }
  
}
  1. Put the cursor on line 6 and type bar.
  2. Wait momentarily for the renameOnType handler to select all occurrences of bar.
  3. Backspace bar on line 6.

Expected:
Only bar on line 6 is deleted, as it is not an HTML tag.

Issue:
All instances of bar are deleted.

See:
typed-array-buffer-schema-WSL-Ubuntu_-test ts-2020-11-19-17-09-52

Does this issue occur when all extensions are disabled?: Yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions