Skip to content

Refactor: Sort MAP procedures / CLASS method declarations alphabetically (CodeRush-inspired) #283

Description

@msarson

CodeRush had member / using sorters. Clarion analog: sort the procedure prototypes in a MAP (or the method declarations in a CLASS) alphabetically.

Behaviour

Code action on a MAP block (or MODULE within it) / a CLASS declaration → "Sort declarations (A–Z)":

  • Reorder the prototype / method-declaration lines alphabetically by name.
  • Preserve comments attached to each line, and keep grouping (e.g. MODULE(...) blocks sorted internally, not merged).

Infra it reuses

  • DocumentStructure already models MAP / MODULE / CLASS and their member lines with ranges — the reorder operates on known line groups.

Wrinkles to decide

  • Whether to sort across MODULE boundaries (recommend: within each MODULE / CLASS only).
  • Overloads with the same name — keep stable relative order.

Acceptance

  • Members sorted within their group; comments travel with their line; overload order stable; file still compiles.

Effort: ~1 day.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions