Skip to content

fix(graindoc): Add all function parameters to the table, even if missing documentation#2293

Open
marcusroberts wants to merge 5 commits intomainfrom
marcus/issue_2281
Open

fix(graindoc): Add all function parameters to the table, even if missing documentation#2293
marcusroberts wants to merge 5 commits intomainfrom
marcus/issue_2281

Conversation

@marcusroberts
Copy link
Member

@marcusroberts marcusroberts commented May 22, 2025

Partially Fixes #2281

Add all function parameters to the documentation table in the order they are defined.

Add an empty documentation field for any that are missing user supplied documentation in the comment above.

(New and Updated tests to follow)

@marcusroberts marcusroberts marked this pull request as draft May 22, 2025 20:41
@marcusroberts marcusroberts marked this pull request as ready for review June 2, 2025 19:25
@marcusroberts marcusroberts requested a review from peblair as a code owner June 2, 2025 19:25
@marcusroberts
Copy link
Member Author

Take care when merging #2292 which makes changes to Graindoc.

Copy link
Member

@spotandjake spotandjake left a comment

Choose a reason for hiding this comment

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

Looks like the stdlib needs to be regened npm run stdlib doc, I think we still want to maintain the errors from before to ensure docs are well structured, and alert people when they mistype params.

@spotandjake
Copy link
Member

We should be good to fully close #2281, the implementation now adds any missing items to the table and gives a warning that they are missing.

| ToStringUnsafe(string)
| ArrayIndexNonInteger(string);
| ArrayIndexNonInteger(string)
| ParameterDocumentationMissing(string);
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we want to add this as a warning to the compiler proper. We should start a set of Graindoc warnings.

Copy link
Member

Choose a reason for hiding this comment

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

As a noted in discord until #2343, I don't think there's an easy way todo this while using the same handler and printing logic we use in the compiler. I think it's ideal we use the same printing logic so any printing improvements there get reflected back in the grain doc warnings.

Maybe for #2342 the warning handler could be a functor that takes the error types and printing handler allowing us to use it in all of our tooling.

Copy link
Member

@spotandjake spotandjake Jan 14, 2026

Choose a reason for hiding this comment

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

As a noted in discord until #2343, I don't think there's an easy way todo this while using the same handler and printing logic we use in the compiler. I think it's ideal we use the same printing logic so any printing improvements there get reflected back in the grain doc warnings.

Maybe for #2342 the warning handler could be a functor that takes the error types and printing handler allowing us to use it in all of our tooling.

Unless you have a better idea I think we should keep the error handling here for now and move with #2342, we can renumber our errors then which shouldn't be a problem as we don't reference the numbers anywhere currently.

@spotandjake spotandjake self-assigned this Feb 4, 2026
@spotandjake spotandjake added the graindoc Issues related to Graindoc label Feb 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

graindoc Issues related to Graindoc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Graindoc: Consider warning or adding undocumented params to the param table.

3 participants