Class ParsedDocument


  • public class ParsedDocument
    extends java.lang.Object
    Represents a parsed document. For now, we will be re-parsing the entire string document every time, but in the future, we would like to be able to update only ranges of changed code.
    • Constructor Detail

      • ParsedDocument

        public ParsedDocument​(ChunkerDocument doc,
                              java.lang.String document)
    • Method Detail

      • findNode

        public Node findNode​(int p)
      • withError

        public ParsedDocument withError​(java.lang.String src,
                                        ParseException e)
        When a parse fails, we do not throw away our last-good document. We do, however, record the failure information, which you should check via isError().
        Parameters:
        src - The source with an error
        e - The parse exception. May make this any exception type.
        Returns:
        this, for chaining. We may need to make copies later, but for now, we'll use it as-is.
      • getSource

        public java.lang.String getSource()
      • getLastGoodSource

        public java.lang.String getLastGoodSource()
      • isError

        public boolean isError()
      • resetFailure

        public void resetFailure()
      • logErrors

        public void logErrors​(io.deephaven.io.logger.Logger log)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • findEditRange

        public io.deephaven.proto.backplane.script.grpc.Position.Builder findEditRange​(io.deephaven.proto.backplane.script.grpc.DocumentRange replaceRange)
      • extendEnd

        public void extendEnd​(io.deephaven.proto.backplane.script.grpc.CompletionItem.Builder item,
                              io.deephaven.proto.backplane.script.grpc.Position requested,
                              Node node)
      • getAssignments

        public java.util.Map<java.lang.String,​java.util.List<ChunkerAssign>> getAssignments()