microsoft/vscode

Rename providers of several extensions conflict and there is no way to know WHAT it being renamed

marinaglancy opened this issue · 3 comments

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

  • VS Code Version: 1.78.2
  • OS Version: Ubuntu 20.04

Steps to Reproduce:

Currently there is a conflict between PHP extension and the extension that I'm working on. I have reported it in PHP extension github here: DEVSENSE/phptools-docs#334 . But even if/when they fix it, the problem can repeat with different unpredictable extensions that user have installed and enabled.

Basically here is the situation:

  • two independent extensions register RenameProvider for the same document selector.
  • my extension defines both prepareRename() and provideRenameEdits() functions, however the "prepareRename()" is not executed because another extension hijacks it.
  • at the same time my callback provideRenameEdits() is being executed and it assumes that the range is what was specified in the prepareRename() but the original range is completely different
  • as a result completely random range is being replaced

The problem is that from the point of view of my extension inside provideRenameEdits() I receive the newName parameter but I do not receive any information about the oldName or the range that user thinks they are replacing.