Skip to content

Should the language specification standardize DartDoc comments? How much? #4513

@eernstg

Description

@eernstg

The language team recently discussed making changes to the language specification material about DartDoc comments (it's just a few paragraphs near the end of the subsection about comments).

It currently specifies the syntax of a DartDoc comment and the scope that references to names in a given DartDoc comment should be resolved in when it occurs immediately before certain kinds of declarations.

The PR #4511 was created in order to remove the scoping related rules, based on the realization that the list of situations is shorter than the set of locations where DartDoc comments may be useful to have, and it seemed more productive to leave these decisions to tool teams, rather than repeatedly adding new locations to the language specification when needed.

For example, nothing was said about formal parameter declarations, and they are very likely to need to have DartDoc comments in the future when declaring constructors (including primary constructors) are added to the language.

This issue is intended to clarify the following question: How much should the language specification specify (and hence standardize) about DartDoc comments? Some models come to mind:

  • Nothing. A comment is a comment according to the language, and tools can do whatever they want.
  • The syntax (/// and /** at first will turn a comment into a DartDoc comment). Nothing is specified about where they can occur or how anything in there will be interpreted or processed. This as what Remove rules about DartDoc comments in the language specification #4511 will do, if landed without radical changes.
  • The syntax, and in special cases the scoping (this is what we have today). It should then be mentioned explicitly in the language specification that other locations may also have DartDoc comments, and their scoping is simply the current scope of the location where it occurs, such that the language specification rules on this topic only need to be extended when another tricky-scope case emerges (if ever).
  • (It is not likely that anyone will recommend that even more specification is added about DartDoc comments in the language specification, so we stop here).

So what do you think?

@bwilkerson, could you add a comment below, and notify the people you had in mind to consult in order to clarify this matter properly?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions