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

Allow to invalidate all providers using a single server -> client request. #1163

Open
dbaeumer opened this issue Dec 8, 2020 · 6 comments
Open
Labels
feature-request Request for new features or functionality new request
Milestone

Comments

@dbaeumer
Copy link
Member

dbaeumer commented Dec 8, 2020

Currently the are separate methods to invalidate semantic tokens and code lens. Would be good to have one request to invalidate them all since a project wide change usually forces an update of all providers.

@dbaeumer dbaeumer added this to the 3.17 milestone Dec 8, 2020
@dbaeumer dbaeumer added the feature-request Request for new features or functionality label Dec 8, 2020
@rwols
Copy link
Contributor

rwols commented Dec 9, 2020

I don't entirely understand the idea. Is the idea now that the server should be responsible for invalidating code lenses / semantic tokens / collected code actions ? Because right now, from what I gather from the spec, the client is responsible for deciding when that stateful information is stale.

@rwols
Copy link
Contributor

rwols commented Dec 9, 2020

Aha, I notice now there's a new proposed request workspace/codeLens/refresh.

@dbaeumer
Copy link
Member Author

dbaeumer commented Dec 9, 2020

There are situation where a client can not detect that (e.g. a project configuration file changes). So in these cases a server needs to ask the client to refresh everything.

@matklad
Copy link
Contributor

matklad commented Jul 26, 2021

Interesting observation: today in practice rust-analyzer fiers both /refresh requests on basically every change (and not just on project-wide configuration changes). That is because VS Code pulls for changes for file X only when file X is modified, but it often happens that modifications to a different file Y actually change highlighting and lenses in X. That feels very suboptimal, but, well, not doing this leads to

updates.mp4

@dbaeumer
Copy link
Member Author

@matklad IMO you should file an issue for this against VS Code. If two files are side by side IMO VS Code should pull for semantic tokens with high frequency for the active file and for a lower frequency on the other files.

@matklad
Copy link
Contributor

matklad commented Aug 10, 2021

Done: microsoft/vscode#130486!

@dbaeumer dbaeumer modified the milestones: 3.17, On Deck Nov 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality new request
Projects
None yet
Development

No branches or pull requests

3 participants