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

Modified content assist preferences for editor are not loaded on IDE startup #1518

Closed
chrisipa opened this issue Mar 18, 2025 · 10 comments
Closed

Comments

@chrisipa
Copy link

I have lately updated my Spring Tools Suite IDE to the latest version (4.29.0.RELEASE). After that I have noticed that the proposals for the content assist in the editor have changed quite a bit.

I'm getting a lot of unwanted entries which are related to the Language Server Proposals:

Image

I have tried to deactivate this option in the preferences section for the editor (Java -> Editor -> Content Assist Advanced):

Image

When I press Apply & Close then the preferences are saved and I get the correct proposals for my use case:

Image

But whenever I restart my IDE, the default preferences for the content assist are loaded. Then I always have to go to the preferences section for editor again and click on Apply & Close and the proposals are back to normal.

That's why I think there's a bug at the IDE startup which prevents the user modified content assist preferences to be loaded correctly.

I have seen that the content assist functionality was modified with this release:

https://github.com/spring-projects/sts4/releases/tag/4.24.0.RELEASE

So maybe this bug was introduced with the changes that have been made there.

Can you please fix this bug, as it is very annoying to always manually change the content assist preferences after every IDE restart.

Thank you very much.

@martinlippert
Copy link
Member

This is a duplicate of #1505. You can disable this specific bean completion proposals specifically as described as a workaround in the mentioned issue. The fix for this will be released as part of a patch release 4.29.1, most likely tomorrow.

@martinlippert
Copy link
Member

For the duplicates showing up in the completion proposal list, I created #1519

@chrisipa
Copy link
Author

Hi Martin, thanks a lot for the clarification. Then I'm eagerly waiting for the 4.29.1 release :-)

@chrisipa
Copy link
Author

Hi @martinlippert, I did the update to 4.29.1 today, but it did not fix my issue. Can you please reopen this ticket?

@BoykoAlex BoykoAlex reopened this Mar 19, 2025
@BoykoAlex
Copy link
Contributor

@chrisipa Any chance you can trim down your project to something you can share with us please? I don't normally get the duplicates... Were you able to reproduce this with some sample spring apps such as petclinic or any of the getting started guides projects?

@martinlippert
Copy link
Member

@chrisipa You are really describing three different issues here and the question is which one you still observe.

  • that the default content-assist shows duplicated bean names?
  • that the default content-assist shows completions with bean names where it should not (in your example roleStrategy should be proposed first, not ecpprofile etc.)
  • the fact that when you disable the Language Server Proposals, this setting seems to be reset when you restart the IDE?

Can you shed some light on this?

As a side note: #1505 contains a simple way to disable the bean completion mechanism (there is a specific preference for this, so that you don't need to disable all Language Server Proposals from the content-assist preferences.

@chrisipa
Copy link
Author

chrisipa commented Mar 21, 2025

Hi @BoykoAlex,

I'm sadly not able to provide my project as it is closed source. But my problem is really not the duplicates in the Spring Bean Inject Proposal list. I want to completely get rid of all these proposals.

@martinlippert: I did some more testing and it seems that this Spring preference

Image

is overriding the content assist preferences on application startup:

Image

I think this should not be the case, especially because the Language Server Proposals should be a super set of the Spring Bean Inject Proposals.

I also think that the preference Inject Bean completion proposals in Java editor should be disabled by default. In my opinion the current default behaviour will probably confuse a lot of STS users, because they get a lot of unwanted proposals for the content assist.

What do you think?

Thanks for your help.

@martinlippert
Copy link
Member

The Language Server Proposals in the Java -> Editor -> Content-Assist -> Advanced section enables/disables all the content-assist proposals that the Spring Boot language server will contribute to the Java editor from the perspective of the Java editor. The specific setting about the bean completion proposals is directly enabling/disabling this specific functionality in the Spring language server (because we wanted to provide a way to enable/disable this experimental specific content-assist feature.

So if the bean completion proposal do not work for you, you can disable that specific piece of the puzzle, while keeping all the other Spring content-assist features around (e.g. property keys in @Value and @ConditionalOnProperty annotations, auto-completions for bean names in @DependsOnor @ConditionalOnBean, and many more).

When you disable the Language Server Proposals, you will disable all of them entirely.

In addition to that: in case you updated to the latest Spring Tools for Eclipse 4.29.1 and the bean completions still show up more often than they should, get in your way, or show duplicate proposals, please continue to report that, but having a small sample project or sample code snippets would help us a lot to reproduce and fix this.

@chrisipa
Copy link
Author

Hi @martinlippert,

I have now deactivated this option to get rid of the unwanted content assist proposals:

Image

That's why this issue is basically solved for me.

PS: Please rethink your decision to activate this option by default. I think this really confuses a lot of users.

@martinlippert
Copy link
Member

PS: Please rethink your decision to activate this option by default. I think this really confuses a lot of users.

I absolutely agree, this is the reason why we immediately shipped a patch release 4.29.1 to address this and to not confuse users here. It should not show the bean completion proposals as the highest priority ones anymore when working on Java source code - even if you keep the preference enabled.

Did you upgrade to 4.29.1 and still see the issue when you enable the preference again?

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

No branches or pull requests

3 participants