While reviewing some stats, I noticed inlayHints being called way more frequently than other requests that I thought would be made approximately on every key stroke.
So I opened an empty Dart file and slowly typed "// qwerty" (with around 2-3s between each keypress).
In the LSP logs, I see that inlayHint is called twice for each change (it's the first request after the edit, and then also happens again later). The same is true for documentSymbols, but that's called twice consecutively.
duplicate_request_log.txt
For convenience, here are the didChange, inlayHint, and documentSymbol requests highlighted in a screenshot:
In all cases, the duplicate inlayHint/documentSymbol requests appear to be the same. I think VS Code should be cache these in some way to not re-fetch data that cannot have changed. There are events like onDidChangeInlayHints if an extension/server does need to trigger a refresh.
While reviewing some stats, I noticed inlayHints being called way more frequently than other requests that I thought would be made approximately on every key stroke.
So I opened an empty Dart file and slowly typed "// qwerty" (with around 2-3s between each keypress).
In the LSP logs, I see that inlayHint is called twice for each change (it's the first request after the edit, and then also happens again later). The same is true for documentSymbols, but that's called twice consecutively.
duplicate_request_log.txt
For convenience, here are the didChange, inlayHint, and documentSymbol requests highlighted in a screenshot:
In all cases, the duplicate inlayHint/documentSymbol requests appear to be the same. I think VS Code should be cache these in some way to not re-fetch data that cannot have changed. There are events like
onDidChangeInlayHintsif an extension/server does need to trigger a refresh.