Skip to content

Conversation

@wenytang-ms
Copy link
Contributor

@wenytang-ms wenytang-ms commented Nov 10, 2025

Add following content

  • Class JavaDoc: Description + Examples + Deprecated warning
  • Method JavaDoc: Description + Params + Returns + Throws + Deprecated flag
  • Field JavaDoc: Description + Deprecated flag
  • Remove HTML tags in the description, javadoc and so on.

@wenytang-ms
Copy link
Contributor Author

wenytang-ms commented Nov 10, 2025

before:

Class: com.acme.user.UserService
Signature: public class UserService
JavaDoc:
\```java
UserService userService = new UserService();
Result<User> result = userService.findById("123");
if (result.isSuccess()) {
User user = result.getData();
log.info("Found user: {}", user.getId());
\```
Methods:
- // Find user by ID, cache first.
      public Result<User> findById(String id)
- // Deactivate user idempotently.
      public Result<Void> deactivate(String id)
- // Find user by email.
      public Result<User> findByEmail(String email)

after:

Class: com.acme.user.UserService
Signature: public class UserService
JavaDoc:
Description:
User domain service for managing user operations. This service provides methods for user lookup and management operations with caching support and idempotent operations.<strong>Typical usage example:</strong>
\```java
UserService userService = new UserService();
Result<User> result = userService.findById("123");
if (result.isSuccess()) {
User user = result.getData();
log.info("Found user: {}", user.getId());
}
\```
Methods:
  - // Find user by ID, cache first.
This method performs a cached lookup for the user with the specified ID.
If the user is not found in cache, it will be retrieved from the data source.
@param id the unique identifier of the user to find
@return a {@link Result} containing the user if found, or an error result
@throws IllegalArgumentException if id is null or empty
      public Result<User> findById(String id)
  - // Deactivate user idempotently.
This operation is safe to call multiple times with the same user ID.
Subsequent calls will have no effect if the user is already deactivated.
@param id the unique identifier of the user to deactivate
@return a {@link Result} indicating the success or failure of the operation
@throws IllegalArgumentException if id is null or empty
      public Result<Void> deactivate(String id)
  - // Find user by email.
Searches for a user with the specified email address.
@param email the email address of the user to find
@return a {@link Result} containing the user if found, or an error result
@throws IllegalArgumentException if email is null or empty
      public Result<User> findByEmail(String email)

@wenytang-ms wenytang-ms requested a review from Copilot November 10, 2025 06:46
Copy link
Contributor

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 refactors JavaDoc extraction functionality to provide richer context for LLM integration. The changes enhance how class, method, and field documentation is extracted and formatted, making it more suitable for AI code completion.

  • Enhanced JavaDoc extraction to include class descriptions, deprecation warnings, and structured parameter/return information
  • Refactored method implementations to eliminate code duplication (removed extractJavaDocSummaryFromElement and created specialized implementations)
  • Improved code organization with new helper methods for text processing and sentence boundary detection

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI commented Nov 10, 2025

@wenytang-ms I've opened a new pull request, #933, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Contributor

Copilot AI commented Nov 10, 2025

@wenytang-ms I've opened a new pull request, #934, to work on those changes. Once the pull request is ready, I'll request review from you.

chagong
chagong previously approved these changes Nov 10, 2025
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.

3 participants