Package io.deephaven.lang.parse
Class ParsedDocument
java.lang.Object
io.deephaven.lang.parse.ParsedDocument
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
extendEnd
(CompletionItem.Builder item, Position requested, Node node) findEditRange
(DocumentRange replaceRange) findNode
(int p) getDoc()
boolean
isError()
void
void
toString()
withError
(String src, ParseException e) When a parse fails, we do not throw away our last-good document.
-
Constructor Details
-
ParsedDocument
-
-
Method Details
-
findNode
-
getDoc
-
withError
When a parse fails, we do not throw away our last-good document. We do, however, record the failure information, which you should check viaisError()
.- Parameters:
src
- The source with an errore
- 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
-
getLastGoodSource
-
isError
public boolean isError() -
resetFailure
public void resetFailure() -
logErrors
-
toString
-
findEditRange
-
extendEnd
-
getAssignments
-