Skip to content
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

internal: partially refactor completions #11397

Merged
merged 7 commits into from
Feb 3, 2022
Merged

Conversation

Veykril
Copy link
Member

@Veykril Veykril commented Feb 2, 2022

Currently our completion infra is split into several modules, each trying to do completions for something specific. This "something" is rather unstructured as it stands now, we have a module for flyimporting path completions, unqualified and qualified path completions, modules for pattern position completions that only try to complete extra things for patterns that aren't done in the path modules, attribute completions that again only try to add builtin attribute completions without adding the normal path completions and a bunch of other special "entity" completions like lifetimes, method call/field access, function param cloning, ... which serve a more specific purpose than the previous listed ones.

As is evident, the former mentioned ones have some decent overlap which requires extra filtering in them so that they don't collide with each other duplicating a bunch of completions(which we had happen in the past at times).

Now this overlap mostly happens with path completions(and keyword completions as well in some sense) which gives me the feeling that having qualified and unqualified path completions be separate from the rest gives us more troubles than benefits in the long run.
So this is an attempt at changing this structure to instead still go by rough entity for special cases, but when it comes to paths we instead do the module split on the "path kinds"/"locations"(think pattern, type, expr position etc) that exist. This goes hand in hand with the test refactoring I have done that moved tests to "location oriented" modules as well as the CompletionContext refactoring that actually already started splitting the context up for path kinds.

This PR moves some path completions out of the qualified and unqualified path modules namely attribute, visibility, use and pattern paths.

@Veykril Veykril force-pushed the compl-refactor branch 2 times, most recently from 372de25 to 07804b3 Compare February 3, 2022 14:48
@Veykril Veykril marked this pull request as ready for review February 3, 2022 14:52
@Veykril
Copy link
Member Author

Veykril commented Feb 3, 2022

bors r+

@bors
Copy link
Contributor

bors bot commented Feb 3, 2022

@bors bors bot merged commit 5a7e11f into rust-lang:master Feb 3, 2022
@Veykril Veykril deleted the compl-refactor branch February 3, 2022 15:09
@Veykril Veykril changed the title internal: Refactor completion module split internal: partially refactor completions May 3, 2022
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.

1 participant