elm-language-client-vscode icon indicating copy to clipboard operation
elm-language-client-vscode copied to clipboard

Renaming a copied module refactors references to the orignal module

Open harmboschloo opened this issue 3 years ago • 0 comments

Expected Behavior

When I have a module A with import B. And I Copy/Paste module B and then rename the copied module I would expect that the other modules remain untouched.

Current Behavior

When renaming B copy.elm to C.elm the import in module A gets changed from import B to import C.

Possible Solution

It seems the language server still associates the copied module with the original module, which should not be the case. Also it might be good to check if the module name is valid and matches the file name before doing any refactoring.

Steps to Reproduce (for bugs)

  1. Create module A with import B
  2. Create module B
  3. Copy/Paste module B
  4. Rename B copy.elm to C.elm

Context

This issue might be related: #298

Your Environment

  • Version used: 2.4.1
  • Editor name and version (e.g. VSCode 1.36.1): VSCode 1.68.1
  • Environment name and version (e.g. node.js 5.4): node.js 16.15.1
  • Operating System and version: Windows 11 Home

harmboschloo avatar Jul 07 '22 21:07 harmboschloo