Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Property Editor] Debounce calls to the Analysis Server for editableArguments#9017

Merged
elliette merged 5 commits intoflutter:masterfrom
elliette:issue-9004
Mar 13, 2025
Merged

[Property Editor] Debounce calls to the Analysis Server for editableArguments#9017
elliette merged 5 commits intoflutter:masterfrom
elliette:issue-9004

Conversation

@elliette
Copy link
Member

@elliette elliette commented Mar 10, 2025

Fixes #9004

Because IntelliJ does not support document versions, the ActiveLocationChanged event will always include a null text document version identifier.

Because of this, this PR:

  • Only ignores identical ActiveLocationChanged events if the text document version is not null
  • Adds debouncing to limit the number of requests sent to the Analysis Server

Currently VS Code debounces the ActiveLocationChanged events with a duration of 200 ms. In DevTools, I've added further debouncing for the requests to the Analysis Server with a duration of 600 ms.

With this change, when I type a line of code with a length of 42 characters in VS Code, we're sending 8 requests to the Analysis Server. Before, with just the VS Code debouncing, we were sending 12. (Note: We can further increase the debounce duration if necessary, FYI @bwilkerson)

Finally, I renamed the existing DebounceTimer class to PeriodicDebouncer to make clear the difference between that debouncer and the one I've added.

@elliette elliette requested review from a team, bkonyi and kenzieschmoll as code owners March 10, 2025 22:55
@elliette elliette merged commit 51c6bfd into flutter:master Mar 13, 2025
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Property Editor] Do not ignore identical ActiveLocationChanged events

2 participants