Skip to content

Commit

Permalink
[Java.Interop.Tools.JavaSource] Remove block and inline @cref values
Browse files Browse the repository at this point in the history
Context: dotnet#843
Context: xamarin/android-api-docs#23

A handful of "broken" Javadoc to C# Doc conversions have been disabled
for now.  This will hopefully help reduce the number of new warnings
introduced by xamarin/android-api-docs#23, and
allow us to get an initial major documentation update landed in the
short term.  Longer term, we will revisit and fix these Javadoc
conversion issues.

Additionally, `Javadoc.cs` has been removed from tools/generator as it
appeared to be an unused partial duplicate of `JavadocInfo.cs`.
  • Loading branch information
pjcollins committed May 19, 2021
1 parent 412e974 commit c961fd0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 87 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,14 @@ internal void CreateRules (SourceJavadocToXmldocGrammar grammar)
if (!grammar.ShouldImport (ImportJavadoc.ExceptionTag)) {
return;
}
// TODO: convert `nonSpaceTerm` into a proper CREF
/* TODO: convert `nonSpaceTerm` into a proper CREF
var e = new XElement ("exception",
new XAttribute ("cref", string.Join ("", AstNodeToXmlContent (parseNode.ChildNodes [1]))),
AstNodeToXmlContent (parseNode.ChildNodes [2]));
FinishParse (context, parseNode).Exceptions.Add (e);
parseNode.AstNode = e;
*/
FinishParse (context, parseNode);
};

ParamDeclaration.Rule = "@param" + nonSpaceTerm + BlockValues;
Expand Down Expand Up @@ -135,11 +137,15 @@ internal void CreateRules (SourceJavadocToXmldocGrammar grammar)
if (!grammar.ShouldImport (ImportJavadoc.SeeTag)) {
return;
}
// TODO: @see supports multiple forms; see: https://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.html#see
/* TODO: @see supports multiple forms; see: https://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.html#see
// Also need to convert to appropriate CREF value, ignore for now
var e = new XElement ("seealso",
new XAttribute ("cref", string.Join ("", AstNodeToXmlContent (parseNode.ChildNodes [1]))));
FinishParse (context, parseNode).Extra.Add (e);
parseNode.AstNode = e;
*/
FinishParse (context, parseNode);

};

SinceDeclaration.Rule = "@since" + BlockValues;
Expand All @@ -157,12 +163,14 @@ internal void CreateRules (SourceJavadocToXmldocGrammar grammar)
if (!grammar.ShouldImport (ImportJavadoc.ExceptionTag)) {
return;
}
// TODO: convert `nonSpaceTerm` into a proper CREF
/* TODO: convert `nonSpaceTerm` into a proper CREF
var e = new XElement ("exception",
new XAttribute ("cref", string.Join ("", AstNodeToXmlContent (parseNode.ChildNodes [1]))),
AstNodeToXmlContent (parseNode.ChildNodes [2]));
FinishParse (context, parseNode).Exceptions.Add (e);
parseNode.AstNode = e;
*/
FinishParse (context, parseNode);
};

// Ignore serialization informatino
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,17 @@ internal void CreateRules (SourceJavadocToXmldocGrammar grammar)
LinkDeclaration.Rule = grammar.ToTerm ("{@link") + InlineValue + "}";
LinkDeclaration.AstConfig.NodeCreator = (context, parseNode) => {
// TODO: *everything*; {@link target label}, but target can contain spaces!
// Also need to convert to appropriate CREF value
// Also need to convert to appropriate CREF value, use code text for now.
var target = parseNode.ChildNodes [1].AstNode;
var x = new XElement ("c");
parseNode.AstNode = new XElement ("c", new XElement ("see", new XAttribute ("cref", target)));
parseNode.AstNode = new XElement ("c", target);
};

LinkplainDeclaration.Rule = grammar.ToTerm ("{@linkplain") + InlineValue + "}";
LinkplainDeclaration.AstConfig.NodeCreator = (context, parseNode) => {
// TODO: *everything*; {@link target label}, but target can contain spaces!
// Also need to convert to appropriate CREF value
// Also need to convert to appropriate CREF value, use code text for now.
var target = parseNode.ChildNodes [1].AstNode;
parseNode.AstNode = new XElement ("see", new XAttribute ("cref", target));
parseNode.AstNode = new XElement ("c", target);
};

LiteralDeclaration.Rule = grammar.ToTerm ("{@literal") + InlineValue + "}";
Expand Down

This file was deleted.

0 comments on commit c961fd0

Please sign in to comment.