Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8267129

DocSourcePositions: add new getPosition method

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Unresolved
    • P4
    • None
    • 17
    • tools
    • None

    Description

      com.sun.source.util.DocSourcePositions provides methods to determine the start and end positions of any DocTree node, but it does not provide any way to determine the file position of positions within the tree node. This is especially difficult for TextTree nodes, which may span many lines and so be discontinuous in the underlying file.

      We should add a new method along the lines of:

      long getPosition(CompilationUnitTree file, DocCommentTree comment, DocTree tree, int pos);

      While the signature should probably use `DocTree tree`, it may only make sense to define the method for "leaf" nodes, like TextTree, IdentifierTree, etc.

      Attachments

        Issue Links

          Activity

            People

              jjg Jonathan Gibbons
              jjg Jonathan Gibbons
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: