Skip to content

[WIP][CodeCompletion] Only filter solutions based on number of fixes #39392

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
wants to merge 1 commit into from

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Sep 22, 2021

The current score filtering rule for filtering code completion solutions based on their score are as follows:

  • Inside a component step, perform score filtering just like for normal type checking. That is, only keep the solutions with the lowest scores
  • After finding solutions, we keep all solutions that have no fixes associated with them. If solutions do have fixes, we only keep those with the lowest score

This scoring behavior is fragile because of several reasons:

  • If the expression containing the code completion token is moved to a component step, we only receive the best solution and thus miss code completion suggestions. These implementation details shouldn’t affect code completion behavior.
  • Modifying the expression the completion happens in to contain a fix in all solutions (e.g. by having a function argument whose type doesn’t match), causes us to only consider the best solution. I code completion behavior should be stable against these kinds of changes.

I propose that in the entire pipeline, we only filter solutions based on the number of fixes and ignore all other score kinds.

The main thing to make sure, is that this doesn’t affect performance like it did in #35535.

rdar://83435965

@ahoppen
Copy link
Member Author

ahoppen commented Sep 22, 2021

@swift-ci Please SourceKit stress test

@ahoppen ahoppen force-pushed the pr/scoring-improvements branch from 6fd7953 to 43887ef Compare February 10, 2022 20:25
@ahoppen
Copy link
Member Author

ahoppen commented Feb 10, 2022

@swift-ci Please SourceKit stress test

@ahoppen
Copy link
Member Author

ahoppen commented Feb 10, 2022

@swift-ci Please smoke test

@shahmishal
Copy link
Member

@swift-ci Please SourceKit stress test

@ahoppen
Copy link
Member Author

ahoppen commented Mar 2, 2022

Closing because this has the same performance problems as the original PR. We need more targeted fixes to avoid filtering out relevant solutions during code completion.

@ahoppen ahoppen closed this Mar 2, 2022
@ahoppen ahoppen deleted the pr/scoring-improvements branch April 5, 2022 14:52
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