Skip to content

Trait Import completion for Notable Traits #16245

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

dfireBird
Copy link
Contributor

cc @Veykril

ImportMap and ImportInfo are changed to record information related to notable_traits. Does the current implementation look okay? If so I can proceed with actual implementation of the completion.

P.S: sorry if I shouldn't ping

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 4, 2024
@dfireBird dfireBird force-pushed the completion_notable_traits branch from 5e409d6 to 022ee7d Compare January 4, 2024 04:48
@Veykril
Copy link
Member

Veykril commented Jan 4, 2024

Yes that looks like roughly what i had in mind

@bors
Copy link
Contributor

bors commented Jan 4, 2024

☔ The latest upstream changes (presumably #16258) made this pull request unmergeable. Please resolve the merge conflicts.

@dfireBird dfireBird force-pushed the completion_notable_traits branch from 022ee7d to 1052813 Compare January 5, 2024 04:18
@dfireBird
Copy link
Contributor Author

Well that was hard to fix the conflicts. Thanks for that now search_dependencies is very easily understandable.

Anyways I had some questions, we are currently storing ItemInNs of TraitId type, but the completion requires us to have ItemInNs of FunctionId type (and a associated item). I have searched for some function that gives all associated items of trait with ItemInNs but I couldn't be able to find any such function. So is that possible to do?

@Veykril
Copy link
Member

Veykril commented Jan 5, 2024

Gonna investigate whether we need to do this actually or not. We might not after all (but we can still make use of the notable trait stuff in another way, for completion priority)

@bors
Copy link
Contributor

bors commented Jan 5, 2024

☔ The latest upstream changes (presumably #16267) made this pull request unmergeable. Please resolve the merge conflicts.

@Veykril
Copy link
Member

Veykril commented Jan 5, 2024

Ye okay after reconsidering we don't need to do this hack, we can just remove the limit in play here. What we can do though is prioritize method ocmpletions that come from notable traits by adding an extra score field to https://github.com/veykril/rust-analyzer/blob/4f75e0f9108192a8d3e115e885cfaf220d1660b8/crates/ide-completion/src/item.rs#L131

Are you interested in doing that instead?

@dfireBird
Copy link
Contributor Author

Oh yes sure I can do that. Just learning more sections in RA :).

So should I close this PR and recreate a new one?!

@Veykril
Copy link
Member

Veykril commented Jan 5, 2024

Yes lets close this, just ask any questions on zulip, I think you've been there before.

@Veykril Veykril closed this Jan 5, 2024
@dfireBird dfireBird deleted the completion_notable_traits branch January 5, 2024 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants