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

WIP: Kill copypasted code in completions #4617

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

treapster
Copy link
Contributor

Aside from moving copypasted code to the base class, i also had to move updateOptions in TabHistory to please eslint, as well as suppress unused var warnings for overrides. Also, i discovered that our typescript is rather old(3.9.10 while the latest is 4.9.5) and doesn't know the override keyword. What stops us from bumping it to 4-something? It may also help with the case we bumped into here and probably some other things.

As for the patch itself, it's probably not the best solution but it removes some 100+ lines of repetition so i hope we can call it improvement, even though it's still OOP which i heard is not very liked here:)

@treapster treapster changed the title Kill some copypated code in completions Kill some copypasted code in completions Mar 6, 2023
@treapster treapster marked this pull request as draft March 6, 2023 22:12
@treapster treapster changed the title Kill some copypasted code in completions WIP: Kill copypasted code in completions Mar 6, 2023
@treapster
Copy link
Contributor Author

treapster commented Mar 6, 2023

I completely forgot that there are also overrides of CompletionSourceFuse::filter with the same copypasta. And there are too many methods which call each other - filter and handleCommand are doing the same thing and onInput just confuses by unnecessary indirection, and sometimes onInput calls filter, other times it's vice versa.. I'll try to sort it out when i have time

@treapster
Copy link
Contributor Author

Even though more testing is needed, it seems like the main mess is gone, and from the first glance it looks like completions are still working. Will test with more commands in the following days.

Even though it makes them work, the general scoring logic should be
definetely changed and put in one place, because currently is is still
repeated in multiple places.
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.

None yet

1 participant