Loading workspace insights... Statistics interval
7 days30 daysLatest CI Pipeline Executions
b960756e fix(aclass): qualified method names + keyword method names
Responses to the 3 Devin findings that arrived after my previous fix
batch. Root cause of both: `parseMethodDecl` / `parseMethodImpl`
consumed only a single identifier token as the method name.
## 🔴 Method name = ABAP keyword (e.g. `to`)
Both `parseMethodImpl` and `parseMethodDecl` used the strict
`nameTok.tokenType.name !== 'Identifier'` check. The word `to` is the
`To` keyword (used in `REF TO`, `OF TABLE`, …), so `METHOD to.` —
present in `zcl_petstore3.clas.locals_imp.abap:152` — silently
dropped the method from the AST.
Fix: both sites now use the existing `isNameLike()` type-guard (same
approach already applied to attribute / parameter / struct-field
names in the previous commit).
## 🟡 Qualified method names (`zif_foo~bar`) truncated
`parseMethodImpl` read only `header.tokens[1]`, so
`METHOD zif_petstore3~add_pet.` landed with `name: 'zif_petstore3'`.
All 19 interface method implementations in the generated
`zcl_petstore3.clas.abap` were affected; the body was fine (offset-
based slicing) but the AST `MethodImpl.name` was wrong, breaking
any consumer that indexes methods by name.
Fix: extracted a `readQualifiedName(toks, start)` helper that walks
`<name>(~|=>)<name>…` chains (reusing the same pattern
`consumeTypeRef` uses for qualified type names), and applied it to
both `parseMethodImpl` and `parseMethodDecl` (the latter also handles
`METHODS zif_foo~bar REDEFINITION.`).
## Tests
- New test: `MethodImpl` of `METHOD zif_petstore3~add_pet.` yields
`name === 'zif_petstore3~add_pet'`.
- New test: `METHODS zif_foo~bar REDEFINITION.` yields `name ===
'zif_foo~bar'` with `isRedefinition === true`.
Verified on the petstore3 corpus: the 20 `MethodImpl` nodes in
`zcl_petstore3.clas.abap` now show `constructor` + 19 fully-qualified
`zif_petstore3~<op>` names.
Live TRL (CB9980002179, us10): deploy → activate → 3/3 AUnit pass.
Tests: aclass 51/51, openai-codegen 159/159, abap-ast 115/115.
Generated with [Devin](https://cli.devin.ai/docs)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>