Gert-dev / php-ide-serenata

Atom IDE package that integrates the Serenata server to provide PHP code assistance
https://serenata.gitlab.io/
Other
275 stars 22 forks source link

Autocompletion does not work in 5.0.1 on Mac #485

Closed cdaguerre closed 3 years ago

cdaguerre commented 4 years ago

Autocomplete functionality seems broken on Mac since 5.0.0 I tried removing and reinstalling the package, removing the project definition, database, re-indexing, restarting Atom multiple times, but it doesn't help. Goto-definition works fine, but there are no suggestions when I start typing a class name and no error message in console (although all levels are displayed). I'd love to contribute a fix but I have no idea where to look...

cdaguerre commented 4 years ago

Commentling this line fixes it: https://github.com/Gert-dev/php-ide-serenata/blob/cfedee2ae7b02551a7276798727c26572b769707/lib/SerenataClient.js#L372

madrussa commented 4 years ago

Confirmed not working for me as well, Atom 1.40.1, Serenata 5.0.1. I also done the same things as re-indexing etc...

Might be a while until we see a fix as the issue @Gert-dev found, which appears to be why the prefix was applied, is still outstanding with Atom since May 2018. (https://github.com/atom/atom-languageclient/issues/218).

@cdaguerre Thanks for the temporary fix, works for me too! I will suffer the illogical ordering/priority whilst a real solution can be found.

Gert-dev commented 4 years ago

This is indeed unfortunate. The line request.prefix is already a workaround for another issue, already linked by @madrussa.

The gist is that, the server currently returns filtered and sorted results (as you would expect), but without this line, the client (Atom via the used atom-languageclient library) does another round of fuzzy matching on top of that.

This additional round of filtering was sometimes dropping valid results returned by the server and messed up the sorting order of the returned results. Faking that the prefix is empty skips that additional filtering and sorting in the atom-languageclient library, which is why I added it.

As mentioned in the linked issue, the autocomplete-plus API of old supports disabling this automatic filtering (filterSuggestions), but atom-languageclient does not obey this setting.

If you want to contribute, I think it would be best to contribute a fix to atom-languageclient that reads out this filterSuggestions option and skips the filtering if it is set and true.

The only question is when it will be merged, as the project doesn't seem particularly active anymore - neither does Atom itself, for that matter :slightly_frowning_face:.

Jamie-Vandenbalck commented 3 years ago

@Gert-dev Is there already a solution or workaround for this known problem?

machitgarha commented 3 years ago

@Gert-dev It seems this issue should be closed as well.