-
Notifications
You must be signed in to change notification settings - Fork 812
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
CodeLens and documentation symbols should also be notifications #358
Comments
For example, it's not clear when codelens are expected to be updated (on change only, on save, on something else...). And the spec doesn't, and probably couldn't, clarify nor enforce that. A notification-based workflow would solve this issue. |
Turning this into notification from the server to the client would solve this but would be a major change. Instead I propose that we had a change notification from the server to the client to tell the client to re fetch the code lens information. This will allow the client to make use of its viewport information to only resolve those code lenses that are currently visible. |
+1 |
@aeschli and I had a long discussion about pull verus push triggered by microsoft/vscode-languageserver-protocol-foldingprovider#4 and I want to repeat the outcome here:
To make a pull model work nicely and performant for the server we should enforce client capabilities (at least for new features). For example if a client never asks for folder it should set its capability to false so the server never spends cycles to compute folding which for example could be done as a side affect of reconciling an AST. May be this rule makes sense: single file information is better provided by pull, project global information might be better provided by push. |
For the pull model, would it make sense to use |
I don't think that this is necessary since the protocol defines that all outstanding changes must be sync over before a |
Client could subscribe for particular notifications on interesting files. So, for example, it can subscribe for errors in all files and folding info in the current file. Dart's protocol has a protocol-level subscription mechanism for that.
"content changed" notification to the pull model seems somewhat analogous to the "subscriptions" service for push model. |
Another approach would be etags like in the Web. |
3.16 will have support to retrigger all code lens computations. |
I'm trying to implement codelens in Eclipse IDE, and I have the impression that codelens shouldn't be a request, but a notification. Indeed, they're expected to be always shown and synchronized and apply on the whole file without a user specific action , and it's not natural from inside the IDE to re-invoke the codelens request whenever something change. It can additionally be a source of bugs because we cannot have guarantee that the last didChange message was properly saved and handled before that.
Like diagnostics, codelens and documentSymbols would probably better be notifications.
The text was updated successfully, but these errors were encountered: