-
Enhancement
-
Resolution: Fixed
-
P3
-
18
-
None
-
b06
Various subtypes of DocTree are wrappers around a somewhat open-ended String. It would help to be able to report diagnostics at positions within that string.
The following shows candidate subtypes:
open/src/jdk.compiler/share/classes/com/sun/source/doctree/CommentTree.java: String getBody();
open/src/jdk.compiler/share/classes/com/sun/source/doctree/DocTypeTree.java: String getText();
open/src/jdk.compiler/share/classes/com/sun/source/doctree/ReferenceTree.java: String getSignature();
open/src/jdk.compiler/share/classes/com/sun/source/doctree/TextTree.java: String getBody();
There is an existing method on Reporter as follows:
void print(Diagnostic.Kind kind, FileObject file, int start, int pos, int end, String message);
The proposal is to add an overload which takes a DocTreePath instead of a FileObject, in order to identify a DocTree within a doc comment that is the target of the diagnostic.
The following shows candidate subtypes:
open/src/jdk.compiler/share/classes/com/sun/source/doctree/CommentTree.java: String getBody();
open/src/jdk.compiler/share/classes/com/sun/source/doctree/DocTypeTree.java: String getText();
open/src/jdk.compiler/share/classes/com/sun/source/doctree/ReferenceTree.java: String getSignature();
open/src/jdk.compiler/share/classes/com/sun/source/doctree/TextTree.java: String getBody();
There is an existing method on Reporter as follows:
void print(Diagnostic.Kind kind, FileObject file, int start, int pos, int end, String message);
The proposal is to add an overload which takes a DocTreePath instead of a FileObject, in order to identify a DocTree within a doc comment that is the target of the diagnostic.
- csr for
-
JDK-8268726 new Reporter method to report a diagnostic within a DocTree node
-
- Closed
-