8000 Improved suggestions for classes, variables and resources by kamil-orwat-vmltech · Pull Request #86 · wttech/acm · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Improved suggestions for classes, variables and resources #86

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 3 commits into from
May 6, 2025

Conversation

kamil-orwat-vmltech
Copy link
Collaborator

No description provided.

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 improves the suggestions provided by the completions providers for classes, variables, and resources.

  • Introduces more detailed labeling by breaking down suggestions into distinct components (e.g. extracting the trailing segment of a fully qualified name) for class and variable completions.
  • Adjusts resource completions to format labels consistently as objects containing both label and description.
  • Removes obsolete commented-out code related to sortText functionality.
Comments suppressed due to low confidence (2)

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

  • [nitpick] Consider extracting the logic for retrieving the trailing segment of the fully qualified name into a helper function, as the same extraction logic is repeated in both class and variable suggestion blocks.
label: suggestion.it ? suggestion.it.split('.').at(-1) : suggestion.l.split('.').at(-1)

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

  • [nitpick] Consider consolidating the path splitting logic into a shared helper function for enhanced clarity and maintainability in the resource completion provider.
label: suggestion.it ? suggestion.it.split("/").at(-1) : suggestion.l.split("/").at(-1)

@krystian-panek-vmltech krystian-panek-vmltech marked this pull request as ready for review May 6, 2025 13:24
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 pull request improves code completion suggestions by enhancing the handling of classes, variables, and resources. Key changes include:

  • Updating the API types to include a new Suggestion type and SuggestionKind enum.
  • Introducing a new composeLabel function for generating completion labels based on suggestion kind.
  • Minor formatting updates in the Java configuration file to improve readability.

Reviewed Changes

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

File Description
ui.frontend/src/utils/monaco/groovy/completions/aem-code.ts Added composeLabel function and updated completions mapping to improve label formatting.
ui.frontend/src/utils/api.types.ts Updated suggestions structure and introduced SuggestionKind enum to better classify suggestion types.
core/src/main/java/com/vml/es/aem/acm/core/code/CodeRepository.java Updated description formatting for clarity in annotations.

const isPartialMatch = lastSegment.includes(word);
const score = (isExactMatch ? '0' : isPartialMatch ? '1' : '2');
return score + "_" + label;
function composeLabel(suggestion: Suggestion) {
Copy link
Preview
Copilot AI May 6, 2025

Choose a reason for hiding this comment

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

The composeLabel function does not include a default case in its switch statement, which might lead to undefined behavior if an unrecognized suggestion kind is provided. Consider adding a default case to handle unexpected SuggestionKind values.

Copilot uses AI. Check for mistakes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

there won't be any 👍

@kamil-orwat-vmltech kamil-orwat-vmltech merged commit 199add6 into main May 6, 2025
1 check passed
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.

2 participants
0