It appears the regex for matching the variable in /// This function uses [variable]. is a bit too restrictive. If I add a character like , or : directly after the ] (for example /// + [arg1]: Use to do ...), then it is no longer recognized (I rely on the analyzer to tell me if I reference out of scope things in my comments).
I can reproduce this. Modify line 13 from test/rules/comment_references.dart:
/// Writes [y]: yay. #LINT
void write(int x) {}
and no lint is raised :(
I suspect that this is because of an attempt to support [id]: http://example.com/ style link labels.
The underlying difficulty is that doc comments are an extended form of markdown in which square brackets are used both for standard markdown links and for scope-based links.
Most helpful comment
I suspect that this is because of an attempt to support
[id]: http://example.com/style link labels.The underlying difficulty is that doc comments are an extended form of markdown in which square brackets are used both for standard markdown links and for scope-based links.