Do not display overshadowed methods in Component Browser#14974
Merged
Conversation
kazcw
reviewed
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()]] : [], |
Contributor
There was a problem hiding this comment.
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)) |
Contributor
There was a problem hiding this comment.
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', () => { |
vitvakatu
approved these changes
Apr 28, 2026
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.
Pull Request Description
Fixes #13852
Important Notes
Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
[ ] Screenshots/screencasts have been attached, if there are any visual changes. For interactive or animated visual changes, a screencast is preferred.Scala,
Java,
TypeScript,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.
[ ] 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.