-
Notifications
You must be signed in to change notification settings - Fork 321
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
LSP triggers build request on every keypress #3131
Comments
Can you provide more context -client without a build services won’t see complete picture |
-client: VScode |
i fear without build none of the services would properly work. did you experiment with overriding/adjusting the behaviour? |
As far as I understand, we have to execute the build operation for each key press because the contextual/ semantic meaning of the source is going to be changed each time we update the source. Since you mentioned that the issue is happening in one of the files, couldn't the problem is with the content in that particular file? |
I tried to disable the build on didChange, but always get an error that indicates that the document isn't updated. This is the error I got when I tried to trigger the codeCompeteionafter appending a few newlines on the document: Stacktrace: I was looking into a way to update the document content without triggering the build, but as you've mentioned it seems not doable without the build. |
Actually, the fact that our DSL relies heavily on references is the problem, if the touched/edited model element is referenced from multiple files then the server will have to build and validate the edited file plus the referencing files. |
i dont know if there is a easy way to trick around this do you @szarnekow @tivervac |
Isn't this what you want, though? If a file is updated, any of the files referencing it needs to consider whether this impacts them as well. Note that a build doesn't start on every keystroke, but whenever the model changes and a given reconciler time is surpassed. If the user thus types fast enough, no build will be triggered until he's done typing. I suppose you could try to
|
I appreciate your suggestions, but I didn't get what you exactly meant by batching the requests, I assume you're referring to the didChange request. |
@awadammar Yes, you could aggregate the changes and only really let them trigger the build every once in a while. You'd thus have fewer builds. To increase the reconciler delay, have a look at |
Thank you @tivervac |
please note: this is about lsp not xtext.eclipse.ui |
Slow performing LSP that triggers a build request on each keypress on one of the dsl files, The problem relies on the
didChange
method which triggers a build request after each keypress.Additionally, almost all the server capabilities (i.e. content assist) are blocked until the build request is fulfilled.
IMO build requests have to be triggered only on didOpen and didSave. Still, I don't know how it's bad only to update stateful files that keep a state like
WorkspaceManager#openDocuments
without triggering a build request on didChange.The text was updated successfully, but these errors were encountered: