Record Class Analysis
java.lang.Object
java.lang.Record
org.clafer.lsp.Analysis
- Record Components:
text- the text of the documentpositions- the positions in itparsed- the tree of the document alone, with its comments and parse errors; what was read around the errorsdiagnostics- the LSP diagnostics of the model of the document, its imports includedindex- 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 Summary
ConstructorsConstructorDescriptionAnalysis(String text, Positions positions, ClaferParser.Result parsed, List<org.eclipse.lsp4j.Diagnostic> diagnostics, org.clafer.lsp.Index index) Creates an instance of aAnalysisrecord class. -
Method Summary
Modifier and TypeMethodDescriptionList<org.eclipse.lsp4j.Diagnostic> Returns the value of thediagnosticsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.org.clafer.lsp.Indexindex()Returns the value of theindexrecord component.static AnalysisAnalyzes a document.List<org.eclipse.lsp4j.DocumentSymbol> outline()parsed()Returns the value of theparsedrecord component.Returns the value of thepositionsrecord component.text()Returns the value of thetextrecord component.final StringtoString()Returns a string representation of this record class.
-
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 aAnalysisrecord class.- Parameters:
text- the value for thetextrecord componentpositions- the value for thepositionsrecord componentparsed- the value for theparsedrecord componentdiagnostics- the value for thediagnosticsrecord componentindex- the value for theindexrecord 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 URIpath- the document's file, absolute, or a name if it has no filetext- the document's textopen- 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
-
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object). -
text
-
positions
-
parsed
-
diagnostics
Returns the value of thediagnosticsrecord component.- Returns:
- the value of the
diagnosticsrecord component
-
index
-