Skip to content

Reduces flickering of inline completions & fixes context key. #125654

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

Merged

Conversation

hediet
Copy link
Member

@hediet hediet commented Jun 7, 2021

  • Pending update operations are cleared immediately (and not debounced).
    This prevents a stale cache when the update operation finishes.

  • Context Key is updated when suggest widget becomes inactive.
    This fixes that "tab" does not always work to accept a suggestion.

  • Suggest Widget only becomes inactive after an 100ms timeout.
    This fixes flickering when typing window and then ., which closes the suggest widget but opens it again immediately.

  • Leading whitespace is only ignored when the inline completion is about indentation.
    This fixes an issue when the user types a whitespace after a suggestion that has an empty replace range.

  • Cache is disposed when no command is set.

* Pending update operations are cleared immediately (and not debounced).
* Context Key is updated when suggest widget becomes inactive.
* Suggest Widget only becomes inactive after an 100ms timeout.
* Leading whitespace is only ignored when the inline completion is about indentation.
@hediet hediet requested a review from alexdima June 7, 2021 10:31
@hediet hediet self-assigned this Jun 7, 2021

// This delay fixes an suggest widget issue when typing "." immediately restarts the suggestion session.
private setInactiveDelayed = this._register(new RunOnceScheduler(() => {
if (!this.isSuggestWidgetVisible) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We only reset active if the suggest widget is not visible anymore (i.e. if it became invisible and then visibile again in the meantime).

@alexdima alexdima merged commit 2c4bd4f into release/1.57 Jun 7, 2021
@alexdima alexdima deleted the hediet/reduce-flickering-of-inline-completions branch June 7, 2021 12:12
@dynamicwebpaige
Copy link

(Just stopping in to say thank you for the usability and UI fixes you've authored over the last couple of weeks! 😄✨ )

@hediet
Copy link
Member Author

hediet commented Jun 18, 2021

Thank you! Alex has helped me a lot though 😀
Let me know if you have any ideas on how we can improve inline completions even more!

@github-actions github-actions bot locked and limited conversation to collaborators Jul 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants