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

GH-1323, GH-1324: Cron Expressions completion proposals and inlay hints #1357

Merged
merged 2 commits into from
Sep 26, 2024

Conversation

vudayani
Copy link
Collaborator

No description provided.

@vudayani vudayani changed the title GH-1323, GH-1324: Cron Expressions completion proposals and inlay hints #1323, #1324: Cron Expressions completion proposals and inlay hints Sep 24, 2024
@vudayani vudayani changed the title #1323, #1324: Cron Expressions completion proposals and inlay hints spring-projectsGH-1323, spring-projectsGH-1324: Cron Expressions completion proposals and inlay hints Sep 24, 2024
@vudayani vudayani changed the title spring-projectsGH-1323, spring-projectsGH-1324: Cron Expressions completion proposals and inlay hints [GH-1323](https://github.com/spring-projects/sts4/issues/1323), GH-1324: Cron Expressions completion proposals and inlay hints Sep 24, 2024
@vudayani vudayani changed the title [GH-1323](https://github.com/spring-projects/sts4/issues/1323), GH-1324: Cron Expressions completion proposals and inlay hints GH-1323, GH-1324: Cron Expressions completion proposals and inlay hints Sep 24, 2024

Set<String> alreadyMentionedValues = alreadyMentionedValues(node);

AnnotationAttributeCompletionProvider completionProvider = this.completionProviders.get(attributeName);
if (completionProvider != null) {
List<String> candidates = completionProvider.getCompletionCandidates(project);

List<String> filteredCandidates = candidates.stream()
if (completionProvider instanceof CronExpressionCompletionProvider) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... this bit does not look pretty... Some Cron completions specific bit in the generic AnnotationAttributeCompletionProcessor... Any chance we can push this logic down to the CRON completion provider somehow?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest that we just switch the method AnnotationAttributeCompletionProvider.getCompletionCandidates to return labels for the proposals as well and don't add an additional method for that. The AnnotationAttributeCompletionProcessor would then not need to distinguish between provider with and without labels and assume instead that the labels are coming from the providers.

Then, we need to adapt all the various provider implementations to return labels as well, but that should't be a big deal.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vudayani Do you want to do those changes in the PR directly or do you want me to do those changes in main first, and then you adapt the PR to that?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@martinlippert I can do the changes in this PR if it can wait until tomorrow.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, sounds good. Looking forward to the updated PR then.

@martinlippert martinlippert merged commit 4a63ffd into spring-projects:main Sep 26, 2024
1 check passed
@martinlippert martinlippert added this to the 4.26.0.RELEASE milestone Sep 26, 2024
@martinlippert martinlippert added for: eclipse something that is specific for Eclipse for: vscode something that is specific for VSCode theme: code completion theme: validation type: enhancement labels Sep 26, 2024
@martinlippert
Copy link
Member

Looks great, thanks so much for the updated PR. Merged now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: eclipse something that is specific for Eclipse for: vscode something that is specific for VSCode theme: code completion theme: validation type: enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants