Skip to content

Conversation

@NathanSnail
Copy link

Adds missing documentation for general (non local function) exports, needs ./tools/locale.lua and ./tools/build-doc.lua run.

…tor in the ast so just wrap the args and name in the diagnostic for missing-export-doc
…cified preventing comment diagnostics on methods for missing-export-doc
@NathanSnail NathanSnail marked this pull request as draft December 2, 2025 16:08
@gemini-code-assist
Copy link

Summary of Changes

Hello @NathanSnail, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the diagnostic capabilities of the system by introducing a new check for missing documentation on exported functions, methods, and fields. It ensures that all public interfaces are adequately documented with comments, parameter, and return type annotations, thereby improving code clarity and maintainability.

Highlights

  • New Diagnostic for Exported Documentation: Introduces a new diagnostic check to identify missing documentation for general (non-local) exported functions, methods, and fields.
  • Expanded Diagnostic Messages: Adds specific error messages for missing comments, parameters, and return annotations for exported methods and fields in the script.lua locale file.
  • Refactored Documentation Helper: The missing-doc-helper.lua file has been updated to include a more flexible checkFunctionNamed and a new checkMethod function, allowing for broader application of documentation checks.
  • Dedicated Diagnostic Implementation: A new file missing-export-doc.lua is added to implement the logic for detecting and reporting missing documentation for various forms of exported functions and methods.
  • Comprehensive Test Coverage: New test cases are added in test/diagnostics/missing-export-doc.lua to validate the new diagnostic across different scenarios of exported functions and methods.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces new diagnostics to check for missing documentation on exported functions, methods, and fields. The changes include adding new diagnostic messages, refactoring the missing-doc-helper to be more generic, implementing the new missing-export-doc checker, and adding comprehensive tests.

The implementation is well-structured and the tests cover the relevant cases. I have one suggestion to improve consistency in the naming of diagnostic messages. Overall, this is a great addition to improve code quality.

Comment on lines 133 to 144
DIAG_MISSING_EXPORTED_METHOD_DOC_RETURN =
'Missing @return annotation at index `{}` in exported method `{}`.'
DIAG_MISSING_EXPORTED_METHOD_DOC_COMMENT =
'Missing comment for exported method `{}`.'
DIAG_MISSING_EXPORTED_METHOD_DOC_PARAM =
'Missing @param annotation for parameter `{}` in exported method `{}`.'
DIAG_MISSING_EXPORTED_FIELD_DOC_RETURN =
'Missing @return annotation at index `{}` in exported field `{}`.'
DIAG_MISSING_EXPORTED_FIELD_DOC_COMMENT =
'Missing comment for exported field `{}`.'
DIAG_MISSING_EXPORTED_FIELD_DOC_PARAM =
'Missing @param annotation for parameter `{}` in exported field `{}`.'

Choose a reason for hiding this comment

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

medium

For consistency with other diagnostic groups like DIAG_MISSING_GLOBAL_DOC_* and DIAG_MISSING_LOCAL_EXPORT_DOC_*, it would be better to order these new diagnostic messages as COMMENT, PARAM, then RETURN.

DIAG_MISSING_EXPORTED_METHOD_DOC_COMMENT  =
'Missing comment for exported method `{}`.'
DIAG_MISSING_EXPORTED_METHOD_DOC_PARAM    =
'Missing @param annotation for parameter `{}` in exported method `{}`.'
DIAG_MISSING_EXPORTED_METHOD_DOC_RETURN   =
'Missing @return annotation at index `{}` in exported method `{}`.'
DIAG_MISSING_EXPORTED_FIELD_DOC_COMMENT  =
'Missing comment for exported field `{}`.'
DIAG_MISSING_EXPORTED_FIELD_DOC_PARAM    =
'Missing @param annotation for parameter `{}` in exported field `{}`.'
DIAG_MISSING_EXPORTED_FIELD_DOC_RETURN   =
'Missing @return annotation at index `{}` in exported field `{}`.'

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.

1 participant