More correct checking for undocumented declarations
This commit is contained in:
parent
900bb9f996
commit
314b0ef3df
|
@ -93,7 +93,7 @@ class UndocumentedDeclarationCheck : BaseAnalyzer
|
||||||
|
|
||||||
override void visit(const VariableDeclaration variable)
|
override void visit(const VariableDeclaration variable)
|
||||||
{
|
{
|
||||||
if (!currentIsInteresting() || variable.comment !is null)
|
if (!currentIsInteresting() || variable.comment.ptr !is null)
|
||||||
return;
|
return;
|
||||||
if (variable.autoDeclaration !is null)
|
if (variable.autoDeclaration !is null)
|
||||||
{
|
{
|
||||||
|
@ -104,6 +104,7 @@ class UndocumentedDeclarationCheck : BaseAnalyzer
|
||||||
}
|
}
|
||||||
foreach (dec; variable.declarators)
|
foreach (dec; variable.declarators)
|
||||||
{
|
{
|
||||||
|
if (dec.comment.ptr is null)
|
||||||
addMessage(dec.name.line, dec.name.column, dec.name.text);
|
addMessage(dec.name.line, dec.name.column, dec.name.text);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -140,7 +141,7 @@ private:
|
||||||
import std.traits : hasMember;
|
import std.traits : hasMember;
|
||||||
if (currentIsInteresting())
|
if (currentIsInteresting())
|
||||||
{
|
{
|
||||||
if (declaration.comment is null)
|
if (declaration.comment.ptr is null)
|
||||||
{
|
{
|
||||||
static if (hasMember!(T, "name"))
|
static if (hasMember!(T, "name"))
|
||||||
{
|
{
|
||||||
|
|
|
@ -1116,7 +1116,7 @@ class XMLPrinter : ASTVisitor
|
||||||
|
|
||||||
private void writeDdoc(string comment)
|
private void writeDdoc(string comment)
|
||||||
{
|
{
|
||||||
if (comment is null) return;
|
if (comment.ptr is null) return;
|
||||||
output.writeln("<ddoc>", xmlEscape(comment), "</ddoc>");
|
output.writeln("<ddoc>", xmlEscape(comment), "</ddoc>");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue