Skip to content
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

Move inlayHints LSP request to "resolve" or range pattern for perf #3394

Closed
kjeremy opened this issue Mar 2, 2020 · 12 comments · Fixed by #11445
Closed

Move inlayHints LSP request to "resolve" or range pattern for perf #3394

kjeremy opened this issue Mar 2, 2020 · 12 comments · Fixed by #11445
Labels
A-ide general IDE features A-inlay-hints inlay/inline hints A-lsp LSP conformance issues and missing features E-unknown It's unclear if the issue is E-hard or E-easy without digging in fun A technically challenging issue with high impact S-actionable Someone could pick this issue up and work on it right now

Comments

@kjeremy
Copy link
Contributor

kjeremy commented Mar 2, 2020

It may make sense to split the inlay hints LSP request into two:

inlayHints which would compute where hints would go.
inlayHints/resolve which would compute the actual hints.

I imagine this would work similar to codeLens/resolve which can dramatically speed up scrolling. We could also follow a viewport model like semantic token ranges.

@matklad matklad added E-unknown It's unclear if the issue is E-hard or E-easy without digging in fun A technically challenging issue with high impact labels Mar 2, 2020
@matklad
Copy link
Member

matklad commented Mar 2, 2020

Yeah, I feel pull-based range model will make the most sense.

@Veetaha
Copy link
Contributor

Veetaha commented Mar 2, 2020

Why don't we make inlayHints push-based instead, i.e. send notifications like we did/do with publishDecorations?

@Veetaha
Copy link
Contributor

Veetaha commented Mar 2, 2020

I imagine inlayHints are decoration themselves ...

@matklad
Copy link
Member

matklad commented Mar 2, 2020

It's an open question what is the best way to synchronize such things: microsoft/vscode-languageserver-node#576 (comment)

The obvious drawback of push-based model is that it doesn't work with viewport optimization

@kjeremy
Copy link
Contributor Author

kjeremy commented Mar 2, 2020

Configuration has also moved to a pull based model (see microsoft/language-server-protocol#676). In general the LSP is evolving in that direction.

@matklad
Copy link
Member

matklad commented Mar 2, 2020

Configuration is communicated in the opposite direction though, so it's not really a good example in this case :)

@kjeremy
Copy link
Contributor Author

kjeremy commented Mar 2, 2020

True!

@Veetaha
Copy link
Contributor

Veetaha commented Mar 2, 2020

Viewport optimization is quite questionable (if you mean sending requests only for hints withing the visible file range?), because the user scrolls the file and moves around quite frequently, it would be a hell to cache all this stuff and at the end of the day this will result into making more small requests instead of issuing one big.

@matklad
Copy link
Member

matklad commented Mar 2, 2020 via email

@matklad
Copy link
Member

matklad commented Mar 2, 2020 via email

@Veetaha
Copy link
Contributor

Veetaha commented Mar 6, 2020

@kjeremy , I've looked a bit into codelens and I don't see how we can apply the resolve pattern to inlay hints. Maybe I don't get the docs (since it is quite sparse), but we have no command or no other thing to resolve for inlays lazily from my viewpoint

@kjeremy
Copy link
Contributor Author

kjeremy commented Sep 17, 2020

@lnicola lnicola added the S-actionable Someone could pick this issue up and work on it right now label Jan 25, 2021
@Veykril Veykril added A-ide general IDE features A-lsp LSP conformance issues and missing features A-inlay-hints inlay/inline hints labels Dec 14, 2021
@bors bors bot closed this as completed in 49646b7 Mar 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ide general IDE features A-inlay-hints inlay/inline hints A-lsp LSP conformance issues and missing features E-unknown It's unclear if the issue is E-hard or E-easy without digging in fun A technically challenging issue with high impact S-actionable Someone could pick this issue up and work on it right now
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants