-
-
Notifications
You must be signed in to change notification settings - Fork 396
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
base: master
Are you sure you want to change the base?
Conversation
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 |
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. |
bd44c2b
to
9b812d1
Compare
Also move them around to please eslint
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.
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:)