Skip to content

Renaming a copied module refactors references to the orignal module #299

@harmboschloo

Description

@harmboschloo

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

Metadata

Metadata

Assignees

No one assigned

    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