-
Notifications
You must be signed in to change notification settings - Fork 17.3k
Autocomplete Next #4364
Comments
Just to add some research, I have been using HaxeIDE/atom-autocomplete-plus-async in my park9140/atom-typescript-tools. It is a fork of autocomplete-plus with async support, and seems to work well. |
I'm the author of https://atom.io/packages/rsense and https://atom.io/packages/racer, and I've also implemented rsense completions for sublime text and worked on it for emacs and vim. I have found the autocomplete plus provider api to be quite nice to work with, except for the fact that it is not async. This has required some hackery and global state manipulation , and means that it occasionally acts buggy since fetching completions from external sources is essentially an asynchronous act. Sublime Text has an ok completions API, though its thoroughly undocumented or at least was when I last checked. The nice thing there is that the API is built into the editor and you don't have to tell the user to install some other thing besides your plugin. Emacs and Vim have both been more difficult. |
@nathansobo has an interesting PR including some modernization of It seems like a prudent short-term course of action might be to:
This then presents an opportunity for the autocomplete package to take one of two paths:
There has been some discussion of modernization of the AutocompleteView, to HTMLElement or React. @abe33 is investigating further, at the direction of @nathansobo. |
I would advocate for a promise-based API, the provider just have to return a promise to use the async API, if it want to stay synchronous, it just have to return an array instead. No changes needed for providers that already works in a synchronous fashion.
Agreed, but there's some use cases that should be considered early, like icons in the results (for statically typed languages IDE it's rather common to have the type and the visibility of a property/method as an icon), or for displaying colors as I did in the
I would like to see an option to limit the scope of a provider to a specific list of scopes. This would lessen the burden on providers authors and limit the performance hit of having all the providers running at the same time. A provider could just provides a default list (empty lists matches all scopes), that could be modified later by the user from a setting (maybe a dynamically created setting for each registered providers) so that every providers can be managed from a single page. Also I would like to see a unified way to compute suggestion scores, with fuzzy filtering being part of the basic autocomplete package (as a helper method so that provider doesn't have to implement that on their own).
|
Thanks to everyone so far. Keep them coming.
I'd rather think long term though. I'm not sure if updating autocomplete-plus is the best course of action. I would hate to change the API, get people to update their providers, then do something for the long term like rewrite autocomplete, and require people to update or recreate their providers again. |
I don't see how this solves anything. If a provider is synchronous and it On Tue, Dec 2, 2014 at 11:18 AM, Ben Ogle notifications@github.com wrote:
|
@mark-hahn it's a matter of progressive elaboration. The API needs to support asynchronous suggestions. That does solve problems associated with external / daemon-based processes that provide suggestions (e.g. That doesn't preclude further enhancing the way providers are called to move them off to a separate process. That wouldn't / shouldn't change the API itself. |
Because many providers work by calling out to a tool that runs in an external process, |
I have been working with the autocomplete-plus-async package and one of the primary issues that seems to pop up with async is that we get race conditions between the debounced change event, and the request for autocomplete. This presents as showing and working with an autocomplete list that is in the process of being replaced, and depending on how fast you are tab completing you can end up selecting a completion that is not what you expect. I also would like to spend some on the plugin architecture. Many of us have put a lot of work into plugin architecture for the AtomLinter project, and we seem to have a pretty solid methodology there. There is significant amount of registration and management of the related dependent plugins that could be rolled into a common library for use in all of these type of projects. |
I'm not saying don't think long term 😄. Just simply suggesting that in the short term there are some achievable quick wins that would move the ball forward while giving you the option of further evolving from the base
I think implicit in the suggestions I'm making is that existing providers would not have to make changes in the short term until the long term API changes occur. But we can switch to async while being backwards compatible - just requires that we enhance the provider to include a function that is async ( When I first started contributing to the discuss thread, I was of the opinion we should throw everything away and start fresh. I've since evolved my thinking to prefer enhancing The reasons why I changed my opinion include:
|
Code-completion is so much more than auto-completion. It can be achieved with auto-completion but we need to make sure that auto-completion is flexible enough. Some thoughts:
In the immediate future just a solid name / symbol completion would be awesome but the above are some next-level thoughts following the title of this issue. |
@mehcode Regarding In the case of my package ( Context is language specific, and so determining context is deemed to be in the realm of the autocomplete I think your
|
@joefitzgerald I know its fairly language / provider specific. I'm just trying to get people thinking about the end-goal rather than an API. Its easier to design the API when we can all envision the end-goal. |
@mehcode, I like the defer suggestion, however, It would be nice if we had a more integrated way of determining where the deferral happens. I've been using atom scopes to detect when to do certain actions like displaying parameter completions for functions. Could we perhaps have the api, for what provider to use, and when to activate, be dependent on the scope of the context. So ideally the include case in the c++ language would have something like |
@benogle We've (@yongkangchen, @park9140) been making significant changes to autocomplete-plus to modernize it in-line with the changes to autocomplete. Updates:
At that point, I think I will create a PR to upstream autocomplete-plus to autocomplete, and plan the deprecation of autocomplete-plus. @benogle can you provide an update from your end? |
I want to be clear that I am not sure this is the best approach. We have not started looking into this in any depth yet. We will likely not get to it until Jan. |
At that time you will have a PR to review then. I understand you don't want to waste anyone's time. But for any kind of convergence and migration path for autocomplete-plus to exist, that's what needs to happen so you have something to consider. |
@benogle We now have 4 people who are very actively contributing to autocomplete. It would be helpful if you consider this a possibility and work with us to guide the effort in a directionally correct way. We've already taken hints from you and others and used that as the basis for prioritization. The better you can (conceptually / functionally) describe your ambitions for autocomplete, the more we can align the resulting autocomplete-plus > autocomplete PR to that. |
We definitely appreciate the enthusiasm, but none of us have time right now to dig into this, so we cant provide legit guidance yet.
Our ambitions right now are to use / create something that can be used for a long time. But we dont have any details beyond that at this time. My biggest worry overall is that we'll make people upgrade / write providers or related autocomplete interactions twice. Updating packages sucks, and we just want to minimize that moving forward. |
@benogle I think your concern about upgrading providers and the work involved in switching APIs might assume there's more providers in the wild than there are. There aren't many, and the active ones are almost entirely represented by people in this thread, asking to move this forward:
Additionally, there are users of atom-autocomplete-plus-async: https://github.com/search?q=atom-autocomplete-plus-async&type=Code&utf8=%E2%9C%93 who need to move regardless because of core API deprecations. Step 1 is to bring them into the fold of autocomplete-plus by adding async support. We've established a gitter room here: https://gitter.im/atom-community for further discussion and collaboration, so we'll use that to rally the provider authors when breaking changes are introduced, providing temporary backwards compatibility where possible. |
We are looking forward to it! |
@benogle A quick update on the provider landscape: I've significantly updated https://github.com/atom-community/autocomplete-plus/wiki/Suggestion-Provider-List with the providers / forks of autocomplete I could find. It was necessary to go hunting for additional providers, because the providers which directly depend on Question: do we need to call |
Are there any updates on the direction for autocomplete going forward? (ie. is Atom going to adopt autocomplete-plus now?) |
It is definitely in progress, we shipped two new autocomplete-plus providers this week, autocomplete-html and autocomplete-css I would guess it would start to ship with Atom in the next couple weeks or so |
... And we're more than happy to facilitate transition of the repo from https://github.com/atom-community to https://github.com/atom, as well as autocomplete-snippets and autocomplete-paths - if desired. edit: or upstream it to https://github.com/atom/autocomplete. |
Tara Rum Pum, Bump |
This is happening. I cant commit to a specific date, but autocomplete-plus will be the main deal soonish. |
👍 |
Markup closing would be a great core feature for the autocompleter: https://github.com/mrhanlon/less-than-slash |
That wouldn't be a core feature but it sounds like a great provider. Would be cool if the current package converted to become an autocomplete-plus provider. |
@joefitzgerald Ah, I'll suggest there. Maybe wrong word choice, meant: would be nice if "Atom just behaved this way by default" rather than it belongs in this package specifically. This seemed like the right place among the |
A wish would be 'inline-autocomplete', i.e. an UI-less mode where a keypress will rotate among the alternatives (similar to how it works in Textmate). To be clear, this should be an opt-in mode, not mandatory. This package supports this, but it's not as nicely integrated with Atom as the regular autocomplete package, and since this is a core feature of an editor I'd much prefer using an official package. |
-1 for inline-autocomplete. Auto-Complete-Plus provides a label attribute that serves this purpose grealy. |
@steelbrain I'm thinking of an optional, opt-in, mode. You wouldn't be forced to use it. |
I think this should be a separate package. For the people who want this behavior, they can disable the default, and install an |
Just throwing in my +1 on an AutoComplete system that can stand-up against PHP Storm's. For example, working in a Laravel app, if I start typing:
it gives me options on what class to import and even tells me when I have imported classes that are not in use in the current doc, which is fantastic. This is the ONLY feature that is keeping me from moving to Atom full-time -- right now it's just for frontend work. https://www.jetbrains.com/phpstorm/help/class-name-code-completion.html |
@zslabs out of the box, it wont provide PHP intelligence. We will be bundling autocomplete-plus in the near future. You can install it today and get a much better experience over the built-in autocomplete. You may get some mileage out of @steelbrain's atom hack package. Also, I do know facebook will be soon releasing nuclide soon, which will include hack tooling, likely with autocomplete providers for PHP. |
A note to everyone following this issue: there is a plan for bundling autocomplete-plus with core outlined in https://github.com/atom-community/autocomplete-plus/issues/351 I'm locking this issue. Please comment or question on the autocomplete-plus issue! |
We're not quite ready to tackle a new autocomplete yet, but I wanted to start the conversation as there are several folks interested in working on autocomplete: @mark-hahn, @lee-dohm, @joefitzgerald, @abe33.
Once we finish with API related things, I was planning on:
autocomplete-plus
codeThen I would come up with a plan of attack for the new version. In my mind, we have a couple options:
autocomplete
with an APIautocomplete-plus
with some modifications and API changesI am not sure what the best way forward is right now. I do feel, though, that the hard part is not the UI that pops up the completion box, it's having great language support, and a nice API for adding completions.
It would be great if you guys could help me / us work through the research phase. Off the top of my head, I'm thinking these would be a big help:
autocomplete-plus
API. Maybe suggestions on improvements.Resources
Providers
Autocomplete+ providers
https://github.com/atom-community/autocomplete-plus/wiki/Autocomplete-Providers
The text was updated successfully, but these errors were encountered: