You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Has Spring Data JPA Content Assist been removed from STS 4? In version 3 I was able to use content assist to show what fields were allowed to be part of the name of the method when using Query Methods. Has it been removed / not added to STS4 or is it a bug or disabled by default?
Reacted by Mauro Molinari, Sergio Della Cioppa, faiyaz.mujawar, dan1st and Raghavan alias Saravanan Muthu
Possibly, but I am not totally sure what you are exactly referring to. So, can you give a concrete example of something that used to work and now doesn't anymore? With "concrete", I mean with some code sample and a bit of explanation exactly what you expect to work.
We may consider trying to somehow 'rescue' the feature from the old code-base or re-implement it from scratch, but we need to know what you are actually talking about first. Oh, and thanks for the report, we rely on these reports to determine which parts of the old tooling people are really missing.
Possibly, but I am not totally sure what you are exactly referring to. So, can you give a concrete example of something that used to work and now doesn't anymore? With "concrete", I mean with some code sample and a bit of explanation exactly what you expect to work.
We may consider trying to somehow 'rescue' the feature from the old code-base or re-implement it from scratch, but we need to know what you are actually talking about first. Oh, and thanks for the report, we rely on these reports to determine which parts of the old tooling people are really missing.
I'm attaching screenshots of what code completion looks like in STS 3 vs STS 4 (specifically around JPA Query Methods)
STS 3:
STS 4:
Reacted by Miguel Angel Sanchez Solis, thomasdgithub, Raj Shah and Trần Uyên
Thanks for the reference and the screenshots. That helps to know what is being talked about here.
Now, I'm pretty sure we are not going to re-implement or 'rescue' all of that as it was before because it seems much of it was specific to beans defined by XML.
From the screenshots, am I correct in assuming you are really mostly interested in the content assist and validations in Java context? WE might be able to re-implement that, though I suspect it will have to be done mostly from scratch. (Not saying we won't do it, we might, but it could take some time as its not a trivial feature to re-implement).
This is indeed a feature of the Spring Data support in STS 3.9.x that we didn't re-implement for STS4 yet. This is due to the fact that the Spring support in STS4 is a complete re-write and we focused on specific pieces first (instead of "blindly" re-implementing everything from the old tooling). So this piece didn't make it into the first version of the all-new Spring Tools 4.
We should add this to the backlog in order to bring this content-assist for Spring Data repositories back - maybe in an even better shape than we had before... :-)
Reacted by ismailsalloo, SunTaoRus and Raghavan alias Saravanan Muthu
Thanks for the reference and the screenshots. That helps to know what is being talked about here.
Now, I'm pretty sure we are not going to re-implement or 'rescue' all of that as it was before because it seems much of it was specific to beans defined by XML.
From the screenshots, am I correct in assuming you are really mostly interested in the content assist and validations in Java context? WE might be able to re-implement that, though I suspect it will have to be done mostly from scratch. (Not saying we won't do it, we might, but it could take some time as its not a trivial feature to re-implement).
Yes, we mainly work within the Java context nowadays. Can't remember when last I defined a bean via XML :-)
This is indeed a feature of the Spring Data support in STS 3.9.x that we didn't re-implement for STS4 yet. This is due to the fact that the Spring support in STS4 is a complete re-write and we focused on specific pieces first (instead of "blindly" re-implementing everything from the old tooling). So this piece didn't make it into the first version of the all-new Spring Tools 4.
We should add this to the backlog in order to bring this content-assist for Spring Data repositories back - maybe in an even better shape than we had before... :-)
I'm pretty impressed with STS 4 at the moment. Looking forward to what's in store for the future
@ismailsalloo Anything specific you are looking for with regards to the Spring Data content-assist? Just the Spring Data query method completions? Or something else in addition to that?
@ismailsalloo Anything specific you are looking for with regards to the Spring Data content-assist? Just the Spring Data query method completions? Or something else in addition to that?
I mainly used it for query method completions. It would be cool if syntax within a @query annotation could also be validated.
@ismailsalloo What exactly do you mean with syntax validation within a @query annotation? Can you provide a few examples?
Since we try to stay away from validations to avoid annoying users with false warnings, I would like to understand this in more detail first.
@martinlippert, I understand the annoyance behind false validations. It also gets to me at times.
Basically my idea is not too much different from the query method suggestion. I was thinking of something to the effect where as you start typing your query within the @query annotation, based on your entity structure, STS provides the user with suggestions of what fields you can extract within your query as well as what fields you can use in your search criteria. In addition to that, if you have a number field within your search criteria, the method param that it maps to must be of type number. I know it's pie in the sky, but it would be super awesome to have that functionality in STS.
@ismailsalloo Thanks for the details, this content-assist support for the values in the annotation sounds indeed quite useful and like an awesome feature, thanks a lot for the suggestion. Will put that on the list of things to consider for future versions.
@ismailsalloo Thanks for the details, this content-assist support for the values in the annotation sounds indeed quite useful and like an awesome feature, thanks a lot for the suggestion. Will put that on the list of things to consider for future versions.
@martinlippert thanks for taking out time to respond to my query and possibly having it included in the future :-)
The first step to make some progress here would be to get a workspace up that contains the projects. The easiest way would be, most likely, so import all the projects in the headless-services directory as Maven project into a fresh workspace.
The second step would be to get the existing test running (Run as -> JUnit Test).
By adding the <*> to the content of the editor the test knows where the cursor position is. Then you basically invoke the content-assist on the editor by asking it for all the completions and see if the result is what you would expect.
The infrastructure around this "asking the editor for all the completions" doesn't allow you to specify all the things yet that a completion request to the language server could contain (like a prefix, etc.), so you might want to add that to the infrastructure as you need it.
If you decide to work on this, please make sure you accept the CLA upfront and then submit PRs. Also feel free to submit several small PRs instead of one big. That would make reviewing them easier.
Activity
kdvolder commentedon Oct 9, 2018
Possibly, but I am not totally sure what you are exactly referring to. So, can you give a concrete example of something that used to work and now doesn't anymore? With "concrete", I mean with some code sample and a bit of explanation exactly what you expect to work.
We may consider trying to somehow 'rescue' the feature from the old code-base or re-implement it from scratch, but we need to know what you are actually talking about first. Oh, and thanks for the report, we rely on these reports to determine which parts of the old tooling people are really missing.
thackel commentedon Oct 9, 2018
I can confirm that the Spring-Data JPA Content assist is not working anymore.
When editing JPA Repositories, STS is no longer providing completion for possible fields of the entity.
Here is the original feature ticket for older versions which describe the functionality: https://jira.spring.io/browse/IDE-1249
ismailsalloo commentedon Oct 9, 2018
I'm attaching screenshots of what code completion looks like in STS 3 vs STS 4 (specifically around JPA Query Methods)
STS 3:

STS 4:

ismailsalloo commentedon Oct 9, 2018
This pretty much sums up what's missing :-)
kdvolder commentedon Oct 9, 2018
Thanks for the reference and the screenshots. That helps to know what is being talked about here.
Now, I'm pretty sure we are not going to re-implement or 'rescue' all of that as it was before because it seems much of it was specific to beans defined by XML.
From the screenshots, am I correct in assuming you are really mostly interested in the content assist and validations in Java context? WE might be able to re-implement that, though I suspect it will have to be done mostly from scratch. (Not saying we won't do it, we might, but it could take some time as its not a trivial feature to re-implement).
martinlippert commentedon Oct 9, 2018
This is indeed a feature of the Spring Data support in STS 3.9.x that we didn't re-implement for STS4 yet. This is due to the fact that the Spring support in STS4 is a complete re-write and we focused on specific pieces first (instead of "blindly" re-implementing everything from the old tooling). So this piece didn't make it into the first version of the all-new Spring Tools 4.
We should add this to the backlog in order to bring this content-assist for Spring Data repositories back - maybe in an even better shape than we had before... :-)
ismailsalloo commentedon Oct 9, 2018
Yes, we mainly work within the Java context nowadays. Can't remember when last I defined a bean via XML :-)
ismailsalloo commentedon Oct 9, 2018
I'm pretty impressed with STS 4 at the moment. Looking forward to what's in store for the future
martinlippert commentedon Oct 15, 2018
@ismailsalloo Anything specific you are looking for with regards to the Spring Data content-assist? Just the Spring Data query method completions? Or something else in addition to that?
ismailsalloo commentedon Oct 15, 2018
I mainly used it for query method completions. It would be cool if syntax within a @query annotation could also be validated.
martinlippert commentedon Oct 16, 2018
@ismailsalloo What exactly do you mean with syntax validation within a @query annotation? Can you provide a few examples?
Since we try to stay away from validations to avoid annoying users with false warnings, I would like to understand this in more detail first.
ismailsalloo commentedon Oct 16, 2018
@martinlippert, I understand the annoyance behind false validations. It also gets to me at times.
Basically my idea is not too much different from the query method suggestion. I was thinking of something to the effect where as you start typing your query within the @query annotation, based on your entity structure, STS provides the user with suggestions of what fields you can extract within your query as well as what fields you can use in your search criteria. In addition to that, if you have a number field within your search criteria, the method param that it maps to must be of type number. I know it's pie in the sky, but it would be super awesome to have that functionality in STS.
I hope I'm making sense
martinlippert commentedon Oct 16, 2018
@ismailsalloo Thanks for the details, this content-assist support for the values in the annotation sounds indeed quite useful and like an awesome feature, thanks a lot for the suggestion. Will put that on the list of things to consider for future versions.
ismailsalloo commentedon Oct 16, 2018
@martinlippert thanks for taking out time to respond to my query and possibly having it included in the future :-)
15 remaining items
shahrk commentedon Apr 4, 2021
@martinlippert how should I get started. I'd like to help with this feature. I really think it is essential.
martinlippert commentedon Apr 6, 2021
@shahrk Sounds great, your help on this one would be very welcome.
This is the class that implements the existing, but very limited content-assist for Spring Data repositories:
https://github.com/spring-projects/sts4/blob/master/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/data/DataRepositoryCompletionProcessor.java
Here is a simple test case for that implementation:
https://github.com/spring-projects/sts4/blob/master/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/data/test/DataRepositoryCompletionProcessorTest.java
The first step to make some progress here would be to get a workspace up that contains the projects. The easiest way would be, most likely, so import all the projects in the
headless-servicesdirectory as Maven project into a fresh workspace.The second step would be to get the existing test running (Run as -> JUnit Test).
The unit test case uses this:
https://github.com/spring-projects/sts4/tree/master/headless-services/spring-boot-language-server/src/test/resources/test-projects/test-spring-data-symbols
as a test project to work against.
This line in the test prepares the content of the editor:
https://github.com/spring-projects/sts4/blob/master/headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/java/data/test/DataRepositoryCompletionProcessorTest.java#L55
By adding the
<*>to the content of the editor the test knows where the cursor position is. Then you basically invoke the content-assist on the editor by asking it for all the completions and see if the result is what you would expect.The infrastructure around this "asking the editor for all the completions" doesn't allow you to specify all the things yet that a completion request to the language server could contain (like a prefix, etc.), so you might want to add that to the infrastructure as you need it.
If you decide to work on this, please make sure you accept the CLA upfront and then submit PRs. Also feel free to submit several small PRs instead of one big. That would make reviewing them easier.
Hope that helps to get started with this!
Spring Data JPA Content Assist
danthe1st commentedon Feb 21, 2023
I have created a PR for this. I hope it is useful.
martinlippert commentedon Feb 21, 2023
Absolutely, this is truly awesome. I asked @BoykoAlex to review and provide feedback, so that we can get this into the next release. 😀
Spring Data JPA Content Assist
martinlippert commentedon Feb 24, 2023
I will mark this as closed and fixed for now, due to the contribution from @danthe1st. Many thanks for that again!!!
martinlippert commentedon Feb 24, 2023
Further improvements to the content-assist should be captured in separate issues.