fix(hover): resolve GROUP(TypeName)/QUEUE(TypeName)/RECORD(TypeName) … - #383
Open
geircodes wants to merge 1 commit into
Open
fix(hover): resolve GROUP(TypeName)/QUEUE(TypeName)/RECORD(TypeName) …#383geircodes wants to merge 1 commit into
geircodes wants to merge 1 commit into
Conversation
…in extractClassName
ClassMemberResolver.extractClassName() already unwrapped LIKE(TypeName)
to get a navigable type name, but had no equivalent case for a class
property declared as GROUP(TypeName)/QUEUE(TypeName)/RECORD(TypeName).
Those fell through to the generic comma/paren split, which strips down
to the bare keyword ("GROUP"), and since GROUP/QUEUE/RECORD are in
CLARION_PRIMITIVES the type was rejected as "not navigable".
This breaks ChainedPropertyResolver one segment past any GROUP-typed
class property: SELF.Settings.Address (where Settings is declared as
GROUP(ConnectionSettingsType) END) resolves hover fine on SELF and on
Settings, but hovering Address silently returns nothing, even though
the field is indexed correctly and locatable via a plain symbol search.
Add a GROUP|QUEUE|RECORD (TypeName) case mirroring the existing LIKE()
handling, so the chain keeps walking into the referenced type's fields.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ClassMemberResolver.extractClassName()decides whether an intermediate segment in a chained dot-access expression (e.g.SELF.Order.MainKey) is "navigable" — i.e. whether the resolver should keep walking into that segment's declared type to find the next member. It already special-casedLIKE(TypeName), unwrapping the parens to get the referenced type name, but had no equivalent case for a class property declared asGROUP(TypeName),QUEUE(TypeName), orRECORD(TypeName)(e.g.Settings GROUP(ConnectionSettingsType) END).Without that case, the type string fell through to the generic
name.split(/[,(]/)[0]split, which strips everything down to the bare keyword (GROUP) — and sinceGROUP/QUEUE/RECORDare themselves listed inCLARION_PRIMITIVES, the type was rejected as "not navigable" and the chain walk aborted right there.Impact: any chained hover/member access one level past a
GROUP/QUEUE/RECORD-typed class property silently returns no hover, even though the target field is indexed correctly. Concretely:SELF.Settings.Address(whereSettingsisGROUP(ConnectionSettingsType) END) resolves hover fine onSELFand onSettings, but hoveringAddressreturns nothing — despite the field being locatable via a plain symbol search without issue. Confirmed the same failure is independent of whether the referenced group type itself is declared with, TYPE— the bug is purely in parsing the usage site's type string, not the type declaration.Fix: add a
GROUP|QUEUE|RECORD(TypeName)case mirroring the existingLIKE(TypeName)handling, placed before the generic comma/paren split, so the chain keeps walking into the referenced type's fields.Test plan
npx tsc -b— clean compileextractClassNamecases added:GROUP(TypeName),GROUP(TypeName) ENDverbatim-scanned-line shape,QUEUE(TypeName),RECORD(TypeName), trailing-attribute form, and a guard that bareGROUPalone still returnsnull)GROUP(TypeName)-typed class property — hover on the chained field access returned nothing before the fix, correctly resolves to the field's declaration after rebuilding and redeploying the LSP into a live Clarion IDE session🤖 Generated with Claude Code