-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
There was a problem hiding this 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)
There was a problem hiding this 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) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 👍
No description provided.