-
Notifications
You must be signed in to change notification settings - Fork 31
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
Autocompletion is stuck after some completions #444
Comments
The error markers goes away if I format the code, but autocompletion is still hanging. |
|
Can you explain what I exactly should enable (how?) and where to find the logs then? This happens often in such cases so I think I need to enable it in general in my eclipse instance. |
Preferences > Language Servers > Logs, and click on "Log to file" column for LemMinX line. |
I enabled logging, restarted and tried to autocomplete but this time autocomplete was stuck immediately |
Now I closed all editors first, deleted the logfile, restarted eclipse, open only the editor and wait some time for it to settle, tried several ways to activate autocompletion but still no luck... autocompletion hangs forever |
@vrubezhny Do you have any clue? Could it be that projects are being worked in the background of lemminx-maven and the hang is "normal"? If so, would it be possible to skip lemminx-maven contribution to completion while it's not ready and add some progress reporting to give feedback to users and make them more patient? |
If that's the case, it would be really really good if lemminx-maven would allow to work in "local mode" that means working on the current file only, I won't mind if e.g. items from the parent are not detected immoderately, but this currently makes the editor behave more like a plain text editor with some colors, for a user POV it is completely annoying that even the simplest thing do not work, e.g in this case adding an execution has nothing to do with any other projects. |
By the way, I'm not sure if it is already the case, but it would be good to have an option to delete the logifle after restart so one always starts with a fresh logfile. |
Next try:
|
Next Try:
Logfile |
As lemminx-maven completion is complex and process can take some times, the process must be canceled as soon as completion on client side is canceled:
|
I don't believe it's a matter of cancellation here, it's more a matter of not preventing available completion items from being sent because server is waiting for something long. Same problem would happen in VSCode. |
It would be good to split the completion into different participants, on the screenshot one can see that there is currently only one, then there won't be any special logic needed and proposals will arise when they are available (sooner or later). |
@laeubi Could you please detail which version of M2E Core Editor Lemminx is installed? I can confirm the problem. The LS log is:
yes, no response from the LS The problem is not reproducible when running Lemminx-Maven in VSCode XML. |
But actually such problem occurs for a long time, so its nothing "new" here ... |
I suspect this is either an issue in LSP4E or Lemminx, as Lemminx-Maven does't generate element proposals. however the Lemminx-Maven content assist participant is still invoked - it shouldn't return any completion items in this case, but this still worth to be investigated. BTW, I cannot reproduce the issue while debugging Lemminx/Lemminx-Maven... |
@laeubi another thing you could try is to run |
If you rename your file pom.xml with mypom.xml and you try to open completion after project
do you see some completion items? If yes it means LemMinx is working correctly. |
The source code is public available, just import everything and try to edit a random pom.xml, I almost ever get strange errors, missing completions or broken XML files (e.g. C&P some text try to insert it short after and get some other text inserted...) so I'm really a bit curious that no one else should be able to reproduce this. :-\ |
@laeubi By the way, does it really hang for you or you can press @angelozerr For me, with this project Lemminx-Maven throws an exception like
|
The IDE does not hand, the autocompletion hangs as it always shows "computing proposals" forever as in the above screenshot, one can the ESC that but will never get proposals then anymore on other places. |
@vrubezhny If you want to prevent the not found plugin you can do |
@laeubi If you turned on the Lemminx log to file, could you, please, find the logs at |
It seems there is no |
@angelozerr this one is probably a bug that is to be fixed in wwd.xml?
|
Sorry, I probably misinformed you... that;s about other log... try adding
to your Eclipse's @angelozerr Do you remember how to turn on the production of |
I enabled that option, should this then print more info to |
It should be fixed, I suggest that you open the XML preferences UI and you change something to apply in your preferences the correct value which should be alaways by default.
No sorry. |
You mean that without lemmin-maven you have some trouble with completion? |
@laeubi Sorry for asking, but may I ask you to update to at least the latest released versions of WWD, M2E-Core and LSP4E, so we'd talk at least about the same versions of the products:
Or even better to the latest snapshot versions:
And to the latest release of LSP4E: There were a few significant fixes made since M2E Core Editor Lemminx v. 2.0.1 was released, so I think it is worth to update anyway. |
Thats's understandable, but also why I think there should be a way to gather things incremental (or at least with different proposal processors) as then a user will get the fastest ones immediately, I'm not familiar with LSP but won't it be possible to include a "group" or something like that in the request so that Eclipse can do two request, one for "xml only" and one for "maven only"?
I mean that if I do something other (e.g. open the parent, or open an XML) sometimes the autocompletion works for a short time and then stops working again.
I'll do that now. |
What I have done now:
|
@laeubi |
I believed that @vrubezhny said that with vscode, lemminx maven was faster. If it that, I suppose that it is because of cancel support. The cancel support provides the capability to stop a long process ASAP and free new thread in the thread pooling. We have seen significant performance in our MicroProfile LS with vscode when we support cancel support. @vrubezhny a thing too that we learn with the developmenet of MicroProfile LS when you need to call a CompletaleFuture which load some data (ex : loading some data project once time which takes time) in completion: don't call this CompletableFuture.thenApply but call CompletableFuture.getNow(null) which will returns null is the load is not ready, in this case you skip the completion process to avoid blocing completion. This CompletableFuture should be stored in a cache, so the next time completion is triggered it should look from the cache and retry again CompletableFuture#getNow again and when getNow is not null you can do the thenApply. |
@laeubi I created a PR at https://github.com/eclipse/lemminx-maven/pull/468/files which loads Maven component on background. It means that XML completion based on XSD, XML syntax validation, XML validation based on XSD will be available without waiting the initialiation of Maven components. |
Make Maven Projects to be loaded/cached lazily when collecting the Workspace Artifacts when gathering completions n order to make content assist faster and more responsive Issue: eclipse-lemminx#444
Make Maven Projects to be loaded/cached lazily when collecting the Workspace Artifacts when gathering completions n order to make content assist faster and more responsive Issue: eclipse-lemminx#444
Make Maven Projects to be loaded/cached lazily when collecting the Workspace Artifacts when gathering completions n order to make content assist faster and more responsive Issue: eclipse-lemminx#444
Make Maven Projects to be loaded/cached lazily when collecting the Workspace Artifacts when gathering completions n order to make content assist faster and more responsive Issue: eclipse-lemminx#444
Make Maven Projects to be loaded/cached lazily when collecting the Workspace Artifacts when gathering completions n order to make content assist faster and more responsive Issue: eclipse-lemminx#444
Make Maven Projects to be loaded/cached lazily when collecting the Workspace Artifacts when gathering completions n order to make content assist faster and more responsive Issue: eclipse-lemminx#444
Make Maven Projects to be loaded/cached lazily when collecting the Workspace Artifacts when gathering completions n order to make content assist faster and more responsive Issue: eclipse-lemminx#444
Make Maven Projects to be loaded/cached lazily when collecting the Workspace Artifacts when gathering completions n order to make content assist faster and more responsive Issue: eclipse-lemminx#444
Make Maven Projects to be loaded/cached lazily when collecting the Workspace Artifacts when gathering completions n order to make content assist faster and more responsive Issue: eclipse-lemminx#444
Make Maven Projects to be loaded/cached lazily when collecting the Workspace Artifacts when gathering completions n order to make content assist faster and more responsive Issue: eclipse-lemminx#444
Make Maven Projects to be loaded/cached lazily when collecting the Workspace Artifacts when gathering completions n order to make content assist faster and more responsive Issue: #444
With @vrubezhny we have spend so many times to improve performance. So now the maven initialisationand the load of local respository (used for compleition,hover and definition) is done in background and should not block the basic features of LemMinx (ex : completion based on XSD maven). The nice thing is that you track those those initialization which can take some times by seeing the progress monitor, see #473 Please not there are a stop button. If you click on it, it stop the progress bar but it doesn't stop the process of the task. I reported the issue at eclipse-lsp4e/lsp4e#742 |
With our performance I have not seen the issue with My "naive" explanation is that if language server doesn't give an LSP response (or takes so many time), the completion future from LSP client doesn't cancel it and the Thread is never free. After several completion, there are no free Thread and the language server becomes unusable (no validation, no hover, no highlight, etc) |
This seem to happen if one use autocompletion "faster" than language-server can process, what I did:
</configuration>
in a new line<executions>
<execution>
resulting XML:
error markers:
The text was updated successfully, but these errors were encountered: