Skip to content

[P0] Replace line-oriented method signature parsing with a structured X++ method model #3

Description

@jackyclever

CLI/Core scope

Provide reliable method facts for CoC analysis, references, call reasoning, and scaffolding.

Migrated from Aether #5; this capability belongs in d365fo-cli/Core.

Parser/AST evaluation is tracked in d365fo-cli #2.

Current problem

Line-oriented signature extraction and modifier splitting can misread leading comments, multiline declarations/attributes, default expressions, modifier permutations, and other valid X++ shapes.

Acceptance criteria

  • Define a structured method contract: visibility, modifiers, static/instance, return type, name, ordered parameters, parameter types/names/default expressions, relevant attributes, source span, and diagnostics.
  • Parse leading doc/line/block comments and multiline declarations correctly.
  • Handle commas/parentheses/brackets inside strings and default expressions.
  • Cover display, edit, internal, modifier permutations, constructors, and delegates.
  • Preserve raw source separately from parsed facts.
  • Unsupported or malformed syntax returns a structured diagnostic instead of guessed facts.
  • Add golden tests for valid, multiline, commented, defaulted, ambiguous, and malformed cases.
  • Evaluate the Microsoft XLNT/BP parser path in [P2] Evaluate Microsoft XLNT/BP parser infrastructure for X++ AST coverage #2 before committing to a custom parser.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions