Skip to content

inlayHints and documentSymbols are requested twice on every key press + inlayHints are called again on every show #311971

@DanTup

Description

@DanTup

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:

Image

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions