Skip to content

slint-sc: don't suggest qualified names that are outside the subset - #12954

Merged
tronical merged 1 commit into
masterfrom
simon/slint-sc-image
Aug 20, 2026
Merged

slint-sc: don't suggest qualified names that are outside the subset#12954
tronical merged 1 commit into
masterfrom
simon/slint-sc-image

Conversation

@tronical

Copy link
Copy Markdown
Member

The "Did you mean 'Colors.red'?" hint added for unresolved identifiers suggested named colors and builtin enum values in Slint SC mode, where the qualified forms don't resolve either. This also broke the slint-sc syntax tests, which match the full diagnostic message.

Build the suggestions from the same lookup objects that gate the subset, instead of checking named_colors() and the type register directly: enum_or_color_suggestions now takes the LookupCtx and asks BuiltinNamespaceLookup and the enum lookup, so a name is only suggested when its qualified form resolves. User-declared enums are in the subset, so their values are still suggested.

@tronical
tronical requested a review from ogoffart August 19, 2026 15:13
@tronical
tronical force-pushed the simon/slint-sc-image branch from c785b4c to a224e65 Compare August 19, 2026 15:16
The "Did you mean 'Colors.red'?" hint added for unresolved identifiers
suggested named colors and builtin enum values in Slint SC mode, where
the qualified forms don't resolve either. This also broke the slint-sc
syntax tests, which match the full diagnostic message.

Build the suggestions from the same lookup objects that gate the
subset, instead of checking named_colors() and the type register
directly: enum_or_color_suggestions now takes the LookupCtx and asks
BuiltinNamespaceLookup and the enum lookup, so a name is only
suggested when its qualified form resolves. User-declared enums are in
the subset, so their values are still suggested.
@tronical
tronical merged commit 018288d into master Aug 20, 2026
133 of 145 checks passed
@tronical
tronical deleted the simon/slint-sc-image branch August 20, 2026 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants