Skip to content

Commit c961fd0

Browse files
committed
[Java.Interop.Tools.JavaSource] Remove block and inline @cref values
Context: #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`.
1 parent 412e974 commit c961fd0

File tree

3 files changed

+15
-87
lines changed

3 files changed

+15
-87
lines changed

src/Java.Interop.Tools.JavaSource/Java.Interop.Tools.JavaSource/SourceJavadocToXmldocGrammar.BlockTagsBnfTerms.cs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,14 @@ internal void CreateRules (SourceJavadocToXmldocGrammar grammar)
8989
if (!grammar.ShouldImport (ImportJavadoc.ExceptionTag)) {
9090
return;
9191
}
92-
// TODO: convert `nonSpaceTerm` into a proper CREF
92+
/* TODO: convert `nonSpaceTerm` into a proper CREF
9393
var e = new XElement ("exception",
9494
new XAttribute ("cref", string.Join ("", AstNodeToXmlContent (parseNode.ChildNodes [1]))),
9595
AstNodeToXmlContent (parseNode.ChildNodes [2]));
9696
FinishParse (context, parseNode).Exceptions.Add (e);
9797
parseNode.AstNode = e;
98+
*/
99+
FinishParse (context, parseNode);
98100
};
99101

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

145151
SinceDeclaration.Rule = "@since" + BlockValues;
@@ -157,12 +163,14 @@ internal void CreateRules (SourceJavadocToXmldocGrammar grammar)
157163
if (!grammar.ShouldImport (ImportJavadoc.ExceptionTag)) {
158164
return;
159165
}
160-
// TODO: convert `nonSpaceTerm` into a proper CREF
166+
/* TODO: convert `nonSpaceTerm` into a proper CREF
161167
var e = new XElement ("exception",
162168
new XAttribute ("cref", string.Join ("", AstNodeToXmlContent (parseNode.ChildNodes [1]))),
163169
AstNodeToXmlContent (parseNode.ChildNodes [2]));
164170
FinishParse (context, parseNode).Exceptions.Add (e);
165171
parseNode.AstNode = e;
172+
*/
173+
FinishParse (context, parseNode);
166174
};
167175

168176
// Ignore serialization informatino

src/Java.Interop.Tools.JavaSource/Java.Interop.Tools.JavaSource/SourceJavadocToXmldocGrammar.InlineTagsBnfTerms.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,17 @@ internal void CreateRules (SourceJavadocToXmldocGrammar grammar)
4747
LinkDeclaration.Rule = grammar.ToTerm ("{@link") + InlineValue + "}";
4848
LinkDeclaration.AstConfig.NodeCreator = (context, parseNode) => {
4949
// TODO: *everything*; {@link target label}, but target can contain spaces!
50-
// Also need to convert to appropriate CREF value
50+
// Also need to convert to appropriate CREF value, use code text for now.
5151
var target = parseNode.ChildNodes [1].AstNode;
52-
var x = new XElement ("c");
53-
parseNode.AstNode = new XElement ("c", new XElement ("see", new XAttribute ("cref", target)));
52+
parseNode.AstNode = new XElement ("c", target);
5453
};
5554

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

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

tools/generator/Java.Interop.Tools.Generator.ObjectModel/Javadoc.cs

Lines changed: 0 additions & 79 deletions
This file was deleted.

0 commit comments

Comments
 (0)