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

completions for predicate keywords in Spring Data repositories #988

Closed

Conversation

danthe1st
Copy link
Contributor

This PR adds completions for predicate keywords in Spring Data repositories.

For example, it would suggest a completion findByFirstNameAnd when typing findByFirstName.

This is a follow-up to #981.

With this PR, it should now be possible to create most Spring JPA repository methods just with Content assist proposals (and adjusting the return type if wanted).

@danthe1st
Copy link
Contributor Author

danthe1st commented Mar 3, 2023

I am unsure whether to actually use CompletionItemKind.Text for those completions. Would other options like Keyword (and maybe Property for property completions) be more appropriate?

@BoykoAlex
Copy link
Contributor

@danthe1st property completion kind for property is more appropriate. As for the query (method name) maybe text is fine... The completion kind only affects the icon description that is supposed to tell you what about to follow once completion item is applied. Since the result is just text the text completion kind seems ok to me.

@danthe1st
Copy link
Contributor Author

@BoykoAlex
So should I change the property completions in query methods (e.g. findByFirst -> findByFirstName) to use CompletionItemKind.Property?

@BoykoAlex
Copy link
Contributor

Merged with 2e79692

(@danthe1st hmm... the result of the completion is just text, correct? I think in this case it should just remain text)

@BoykoAlex BoykoAlex closed this Mar 3, 2023
@danthe1st danthe1st deleted the jpa-keyword-completion branch March 3, 2023 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants