Skip to content

[Java.Interop.Tools.JavaSource] Replace TODO with To be added #937

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ internal void CreateRules (SourceJavadocToXmldocGrammar grammar)

InheritDocDeclaration.Rule = grammar.ToTerm ("{@inheritDoc}");
InheritDocDeclaration.AstConfig.NodeCreator = (context, parseNode) => {
parseNode.AstNode = new XText ("[TODO: @inheritDoc]");
// TODO: Iterate through parents for corresponding javadoc element.
parseNode.AstNode = new XText ("To be added");
};

LinkDeclaration.Rule = grammar.ToTerm ("{@link") + InlineValue + "}";
Expand Down Expand Up @@ -70,11 +71,13 @@ internal void CreateRules (SourceJavadocToXmldocGrammar grammar)
| grammar.ToTerm ("{@value") + InlineValue + "}";
ValueDeclaration.AstConfig.NodeCreator = (context, parseNode) => {
if (parseNode.ChildNodes.Count > 1) {
// TODO: Need to convert to appropriate CREF value, use code text for now.
var field = parseNode.ChildNodes [1].AstNode.ToString ();
parseNode.AstNode = new XText ($"[TODO: @value for `{field}`]");
parseNode.AstNode = new XElement ("c", field);
}
else {
parseNode.AstNode = new XText ("[TODO: @value]");
// TODO: Display the value of the corresponding static field.
parseNode.AstNode = new XText ("To be added");
}
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void InheritDocDeclaration ()

var r = p.Parse ("{@inheritDoc}");
Assert.IsFalse (r.HasErrors (), DumpMessages (r, p));
Assert.AreEqual ("[TODO: @inheritDoc]", r.Root.AstNode.ToString ());
Assert.AreEqual ("To be added", r.Root.AstNode.ToString ());
}

[Test]
Expand Down Expand Up @@ -82,11 +82,11 @@ public void ValueDeclaration ()

var r = p.Parse ("{@value}");
Assert.IsFalse (r.HasErrors (), DumpMessages (r, p));
Assert.AreEqual ("[TODO: @value]", r.Root.AstNode.ToString ());
Assert.AreEqual ("To be added", r.Root.AstNode.ToString ());

r = p.Parse ("{@value #field}");
Assert.IsFalse (r.HasErrors (), DumpMessages (r, p));
Assert.AreEqual ("[TODO: @value for `#field`]", r.Root.AstNode.ToString ());
Assert.AreEqual ("<c>#field</c>", r.Root.AstNode.ToString ());
}
}
}