Record Class Analysis

java.lang.Object
java.lang.Record
org.clafer.lsp.Analysis
Record Components:
text - the text of the document
positions - the positions in it
parsed - the tree of the document alone, with its comments and parse errors; what was read around the errors
diagnostics - the LSP diagnostics of the model of the document, its imports included
index - the names of the model and what they refer to

public record Analysis(String text, Positions positions, ClaferParser.Result parsed, List<org.eclipse.lsp4j.Diagnostic> diagnostics, org.clafer.lsp.Index index) extends Record
What the server knows of one version of a document: its tree and its diagnostics. A document is analyzed again, completely, on every change.
  • Constructor Details

    • Analysis

      public Analysis(String text, Positions positions, ClaferParser.Result parsed, List<org.eclipse.lsp4j.Diagnostic> diagnostics, org.clafer.lsp.Index index)
      Creates an instance of a Analysis record class.
      Parameters:
      text - the value for the text record component
      positions - the value for the positions record component
      parsed - the value for the parsed record component
      diagnostics - the value for the diagnostics record component
      index - the value for the index record component
  • Method Details

    • of

      public static Analysis of(String uri, String path, String text, Function<String, Optional<String>> open)
      Analyzes a document.
      Parameters:
      uri - the document's URI
      path - the document's file, absolute, or a name if it has no file
      text - the document's text
      open - the text of the open documents, by the path that a model names them with; the files that are not open are read from disk
      Returns:
      the analysis
    • outline

      public List<org.eclipse.lsp4j.DocumentSymbol> outline()
      Returns:
      the outline of the document
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • text

      public String text()
      Returns the value of the text record component.
      Returns:
      the value of the text record component
    • positions

      public Positions positions()
      Returns the value of the positions record component.
      Returns:
      the value of the positions record component
    • parsed

      Returns the value of the parsed record component.
      Returns:
      the value of the parsed record component
    • diagnostics

      public List<org.eclipse.lsp4j.Diagnostic> diagnostics()
      Returns the value of the diagnostics record component.
      Returns:
      the value of the diagnostics record component
    • index

      public org.clafer.lsp.Index index()
      Returns the value of the index record component.
      Returns:
      the value of the index record component