Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

When a participant is typing, other participants cannot use autocomplete #43

Closed
jasonrudolph opened this issue Sep 11, 2017 · 6 comments
Labels

Comments

@jasonrudolph
Copy link
Contributor

In the demo below, the user on the left types a few characters and triggers autocomplete. Before that user can select an item in the autocomplete list, the user on the right types a character elsewhere in the buffer, which causes the other user's autocomplete selection list to disappear.

demo

This behavior effectively prevents users from using autocomplete if both users are typing at once.

Given just the usefulness of autocomplete in everyday development, it would be great to allow each user to interact with their own autocomplete selections while other users are typing.

@jasonrudolph
Copy link
Contributor Author

Some early findings regarding the cause of the current behavior:

  • The autocomplete-plus package subscribes to events from TextBuffer::onDidChangeText. Those events are handled by AutocompleteManager::showOrHideSuggestionListForBufferChanges. [code]
  • In showOrHideSuggestionListForBufferChanges, if the buffer's text changed somewhere that isn't near the "last cursor," then autocomplete-plus hides the suggestion list. [code]

In other words, because autocomplete-plus is watching for any text changes to the buffer, if User A triggers the autocomplete selection list, and then User B changes the text somewhere else in the buffer, autocomplete-plus hides User A's autocomplete selection list.

@jasonrudolph
Copy link
Contributor Author

As far as I can tell, this behavior in autocomplete-plus originated from the desire to cancel autocompletion when the user enters more than one character with a single keystroke (e.g., pasting).

@leroix
Copy link

leroix commented Sep 11, 2017

Interesting, so we need to make the check in autocomplete-plus more specific? For instance, autocomplete seems to work as expected when multiple cursors are present.

@jasonrudolph
Copy link
Contributor Author

Interesting, so we need to make the check in autocomplete-plus more specific?

@leroix: Probably so. Hopefully we can make it happen.

@nathansobo: I think atom/autocomplete-plus@05d33f8 might meet our needs for this issue. I'm gonna hold off on opening up a PR in atom/autocomplete-plus until we can try out atom/autocomplete-plus@05d33f8 locally together while pairing. If all is well, I'll open a PR to get that change rolled into autocomplete-plus.

@jasonrudolph
Copy link
Contributor Author

I'm gonna hold off on opening up a PR in atom/autocomplete-plus until we can try out atom/autocomplete-plus@05d33f8 locally together while pairing. If all is well, I'll open a PR to get that change rolled into autocomplete-plus.

@as-cii and I tried it out this morning, and everything seemed to work well. I've opened atom/autocomplete-plus#887 to get this change into autocomplete-plus.

@jasonrudolph
Copy link
Contributor Author

I've opened atom/autocomplete-plus#887 to get this change into autocomplete-plus.

I've merged atom/autocomplete-plus#887 and incorporated that change into atom/atom (atom/atom#15652). With that done, I'm gonna close this issue.

If anyone notices any undesirable interactions between autocomplete and real-time collaboration when using the latest dev build of atom/atom, please reopen an issue or open a new one with additional details. 🙇

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants