Skip to content

STS 4.8.0 template proposals invalid #579

Closed

Description

@moonknight37

When I use the latest stable version of STS, I tried to use 'Alt + /' to get template proposals, then the IDE displayed 'Computing proposals(0%)...' and no template proposals display.

Activity

  1. kdvolder commented on Oct 13, 2020

    @kdvolder
    Member

    In my STS installation 'ALT+/' key seems to be bound to 'word completions' (in keybindings preferences). I am a bit at a loss on exactly what I need to do to try to reproduce this issue. Can you provide a bit more details please? E.g. ideally give some steps we can take from opening a new/fresh workspace to setup the conditions needed to produce the problem.

    Problems with completions are often sensitive to editor / project context. So it would be nice to include a sample project and instructions were you place the cursor in the editor before trying request completions. i.e. what (type of) file to place cursor in, and at what position, in case it matters (and it usually does).

  2. martinlippert commented on Oct 23, 2020

    @martinlippert
    Member

    Any news on this @moonknight37 ?

  3. esanchma commented on Nov 23, 2020

    @esanchma

    I am having the same issue, I use Control+space in an expression and this is what I see:
    imagen

  4. martinlippert commented on Nov 24, 2020

    @martinlippert
    Member

    @esanchma What happens if you disable the Spring Boot language server in the preferences? (Preferences -> Language Servers, then de-activate the Spring Boot language server for the Java source file type)

    If that solves the issue, it would be good if you could help us a bit with some further analysis of the issue. First step would be to activate the language server again. Does the issue happens every time you activate content-assist in a Java file? In any project? Can you create a sample project that reproduces the issue and a few steps to reproduce that?

    One additional step could be to identify the process of the Spring Boot language server (on a terminal window) using jps. You will easily see the process for the language server. And then do a jstack <pid> with the process ID of the language server process while the content-assist proposals are being computed (and attach the output here). Maybe that leads us into the right direction where the problem might be.

  5. esanchma commented on Dec 15, 2020

    @esanchma

    It happens intermitently. I started a new workspace and it stopped happening for a while. I got to make a thread dump with JvisualVM while its happening, with content assist on focus.

    I could record a JFR of it if that makes sense to you.

    Spring-boot-language-server-stuck.tdump.txt

  6. martinlippert commented on Dec 19, 2020

    @martinlippert
    Member

    @esanchma Thanks a lot for the thread dump, that is extremely helpful.

    If possible, it would be very interesting to see a thread dump from the Eclipse IDE process itself at the same time (together with the thread dump from the language server). In case you come across the same issue and could capture both, that would be extremely interesting. The thread dump from the language server that you attached already points into a certain direction, but seeing the state of the Eclipse IDE process at the same time would be super interesting for this case.

    Many many thanks for your help with this!!!

  7. added this to the milestone on Dec 30, 2020
  8. martinlippert commented on Jan 13, 2021

    @martinlippert
    Member

    I think I figured out what is causing this issue and I am working on a solution. Unfortunately, this is not super easy to improve and solve, so it will take a while. But I am on it.

    Technical details:
    The completion request arrives at the language server, which is trying to take a copy of the internal text document buffer to work with. This "taking a copy" goes through the global event loop, which is busy at that time. Therefore the completion request has to wait for that lock to become available.

    The reason why the event loop (AsyncRunner) is busy could be manifold. In one case it is still working on a document change notification, updating the live hover information, and waiting for some JDT type information (which could take a long time, depending on JDT doing something long-running in the IDE like a build or updating the index). Another case that I saw is an update notification reaction taking a long time because the AST parsing was slow (e.g. for a very large Java file).

    One part of the solution is to re-work the way the language server deals with the internal event loop. It still has to process the events in the order they arrive, but they should not really wait for each other in every case. The underlying mechanics how the language server deals with text documents could be improved here as well to avoid locking.

    Another area that might need some work here is the reaction to a change notification. Most of the following internal reactions should happen async (on a snapshot of the text document, as most of them do anyway). Especially the call chains that involve additional communication to outside systems (like the JDT type information requests) need to run in an async way, independent of the event loop runner.

    The case of a large Java file and the AST parser taking a long time to create the AST is a different case that is harder to solve. A completion request will most likely need an AST in order to identify possible completion proposals. If that takes too long, what should happen?

    Another area that is involved here could be the cancellation of requests from the client.

  9. martinlippert commented on Feb 10, 2021

    @martinlippert
    Member

    I committed a number of changes that should help to address this issue. Would be awesome if you could give this a try and report back how things are going. You can download the latest CI build from here: http://dist.springsource.com/snapshot/STS4/nightly-distributions.html

  10. modified the milestones: , 4.10.0.RELEASE on Feb 18, 2021
  11. BrenoVitoi commented on Feb 24, 2021

    @BrenoVitoi

    Window >>> Preferences >>> Java >>> Editor >>> Content Assistent >>> Advanced >>> Java Proposals

    https://www.youtube.com/watch?v=l8pIEnUiYb8

  12. martinlippert commented on Mar 5, 2021

    @martinlippert
    Member

    I think this is fixed now and should not happen again. Therefore marking this as fixed for the upcoming 4.10.0.RELEASE. If you come across this issue again, please commend and we can re-open (or file new issue). In that case, please capture a thread dump while content-assist hangs from both the IDE process as well as the Spring Boot language server process.

  13. ganesh1382 commented on Apr 21, 2023

    @ganesh1382

    sts 4 also won't give html template proposal, but its work in sts 3.9.10

  14. martinlippert commented on May 3, 2023

    @martinlippert
    Member

    @ganesh1382 Sorry for being late replying to your comment here. I think the missing HTML template proposals are related to the Spring Tools now shipping with the Wild Web Developer tools instead of the regular HTML tooling of the Eclipse Web Tools project. So I would suggest to file this issue against the Wild Web Developer project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions