Skip to content

Do not display overshadowed methods in Component Browser#14974

Merged
mergify[bot] merged 8 commits into
developfrom
wip/farmaazon/overshadowing
Apr 29, 2026
Merged

Do not display overshadowed methods in Component Browser#14974
mergify[bot] merged 8 commits into
developfrom
wip/farmaazon/overshadowing

Conversation

@farmaazon
Copy link
Copy Markdown
Contributor

Pull Request Description

Fixes #13852

Important Notes

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • The documentation has been updated, if necessary.
  • [ ] Screenshots/screencasts have been attached, if there are any visual changes. For interactive or animated visual changes, a screencast is preferred.
  • All code follows the
    Scala,
    Java,
    TypeScript,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • Unit tests have been written where possible.
  • [ ] If meaningful changes were made to logic or tests affecting Enso Cloud integration in the libraries,
    or the Snowflake database integration, a run of the Extra Tests has been scheduled.
    • If applicable, it is suggested to paste a link to a successful run of the Extra Tests.

@jdunkerley jdunkerley added this to the 2026.1 Release milestone Apr 17, 2026
})
readonly conflictingNames = new ReactiveIndex(this, (id, entry) => [[entry.name, id]])
readonly conflictingMethods = new ReactiveIndex(this, (_, entry): [string, string][] =>
entry.kind === SuggestionKind.Method ? [[entry.name, entry.memberOf.key()]] : [],
Copy link
Copy Markdown
Contributor

@kazcw kazcw Apr 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why memberOf rather than selfType? I think the difference doesn't matter for current usage (since we won't perform the lookup for static methods), but it seems more logical to exclude them by using selfType, which will also keep this index a little smaller

)
const ancestorOvershadowed =
matchedAncestor != null && db.conflictingMethods.lookup(entry.name).has(matchedAncestor.key())
if (hiddenTypeMatch != null || (matchedAncestor != null && !ancestorOvershadowed))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could simplify this condition with early exits, e.g. if we have a hiddenTypeMatch we don't need to do the rest of the lookups

expect(filteringWithoutSelfType.filter(entry2, db)).toBeNull()
})

test.only('`Any` or ancestor type methods may be overshadowed', () => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.only

@farmaazon farmaazon requested a review from kazcw April 20, 2026 11:06
@farmaazon farmaazon added the CI: Ready to merge This PR is eligible for automatic merge label Apr 28, 2026
@mergify mergify Bot merged commit d268e87 into develop Apr 29, 2026
61 checks passed
@mergify mergify Bot deleted the wip/farmaazon/overshadowing branch April 29, 2026 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI: Ready to merge This PR is eligible for automatic merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Conflicting suggestions in component browser

4 participants