8000 Script functions by krystian-panek-vmltech · Pull Request #92 · wttech/acm · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Script functions #92

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

Merged
merged 2 commits into from
May 7, 2025
Merged

Script functions #92

merged 2 commits into from
May 7, 2025

Conversation

krystian-panek-vmltech
Copy link
Collaborator

fixes #79, #90

@krystian-panek-vmltech krystian-panek-vmltech merged commit 9f38dfd into main May 7, 2025
1 check passed
Copy link
Contributor
@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements new Groovy completions for script functions and refactors some existing suggestion handling logic while addressing issues with formatting returned snippet data.

  • Introduces core completions for Groovy script functions (println, print, printf) in a new file.
  • Refactors the AEM code completions to use SuggestionKind constants instead of string literals.
  • Improves snippet content and documentation by trimming extraneous whitespace.

Reviewed Changes

Copilot reviewed 4 out of 8 changed files in this pull request and generated 1 comment.

File Description
ui.frontend/src/utils/monaco/groovy/completions/core.ts Added core Groovy completions for script functions.
ui.frontend/src/utils/monaco/groovy/completions/aem-code.ts Updated completion item kinds to rely on SuggestionKind constants.
ui.frontend/src/utils/monaco/groovy/completions.ts Registered the new core completions in the overall completions registration.
core/src/main/java/com/vml/es/aem/acm/core/snippet/Snippet.java Modified snippet getters to return trimmed values to enhance output formatting.
Files not reviewed (4)
  • ui.content.example/src/main/content/jcr_root/conf/acm/settings/script/manual/example/ACM-1_classes_jms.groovy: Language not supported
  • ui.content.example/src/main/content/jcr_root/conf/acm/settings/script/manual/example/ACM-1_classes_rtjar.groovy: Language not supported
  • ui.content.example/src/main/content/jcr_root/conf/acm/settings/script/manual/example/ACME-200_hello-world.groovy: Language not supported
  • ui.content.example/src/main/content/jcr_root/conf/acm/settings/script/manual/example/ACME-201_arguments.groovy: Language not supported
Comments suppressed due to low confidence (1)

ui.frontend/src/utils/monaco/groovy/completions/aem-code.ts:96

  • [nitpick] Confirm that the SuggestionKind constants are correctly imported and used consistently across the completion providers for clarity and maintainability.
case SuggestionKind.CLASS:

@@ -45,11 +45,11 @@ public String getId() {
}

public String getContent() throws AcmException {
return definition.getContent();
return StringUtils.trim(definition.getContent());
Copy link
Preview
Copilot AI May 7, 2025

Choose a reason for hiding this comment

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

If definition.getContent() could return null, consider using a null-safe approach such as StringUtils.trimToEmpty to avoid potential NullPointerExceptions.

Suggested change
return StringUtils.trim(definition.getContent());
return StringUtils.trimToEmpty(definition.getContent());

Copilot uses AI. Check for mistakes.

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

Successfully merging this pull request may close these issues.

Groovy script method suggestions
1 participant
0