Skip to content

Support automatic class renaming when files are renamed or moved in VS Code #563

Description

@stan-at-work

Description

When developing in Progress ABL, classes are typically stored in files whose names match the class names. However, renaming a file or moving it to another package/folder in VS Code does not update the corresponding class declaration.

This often leaves the class name out of sync with the file name and requires manual changes, which is tedious and error-prone.

For example:

Before:

// Customer.cls
CLASS MyApp.Models.Customer:
END CLASS.

After renaming the file to Client.cls, the class declaration remains:

CLASS MyApp.Models.Customer:
END CLASS.

The developer must manually change it to:

CLASS MyApp.Models.Client:
END CLASS.

Likewise, moving the file to another package/folder requires manually updating the namespace.

Proposal

Add support for file rename and move refactorings similar to what is available in Dart.

Rename file

Renaming:

Customer.cls

to:

Client.cls

should automatically change:

CLASS MyApp.Models.Customer:

to:

CLASS MyApp.Models.Client:

Move file

Moving:

src/models/Customer.cls

to:

src/entities/Customer.cls

should automatically update:

CLASS MyApp.Models.Customer:

to:

CLASS MyApp.Entities.Customer:

Motivation

  • Keeps class names synchronized with file names.
  • Eliminates manual updates after renames or moves.
  • Reduces mistakes caused by mismatched namespaces and class names.
  • Makes large refactors much easier.
  • Aligns with the experience developers have in modern languages and IDEs.

This may seem stupid but for refactoring this can help allot.

Thank you for considering this.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions