Record Class Suggestion
java.lang.Object
java.lang.Record
org.ek9lang.compiler.common.Suggestion
- Record Components:
name- the bare replacement text (e.g."false","stdout")displayText- human-readable inline form for "Did you mean?" rendering — symbols include their source location, keywords are quoted barecost- Levenshtein cost relative to the offending token (lower = closer); parse-token suggestions use0line- nullable line number of the symbol definition for visual rendering of "defined at line N";nullfor keyword / parse-token suggestionssource- classification —Suggestion.Source.KEYWORDorSuggestion.Source.SYMBOL
public record Suggestion(String name, String displayText, int cost, Integer line, Suggestion.Source source)
extends Record
A single ranked suggestion that the compiler can offer the user as a possible
replacement for an offending token.
Produced by QuickFixSuggestionExtractor and consumed by:
ErrorListener.ErrorDetails.toString()— CLI classic-mode "Did you mean?"VisualErrorFormatter— CLI visual-mode multi-span block- Oracle
DiagnosticsExtractor— MCP/IDE structured diagnostics - IDE quick-fix popup + Problems panel + error tooltip
Single source of truth ensures CLI compile output, IDE rendering, and AI tooling all see the same filtered, ranked candidate set.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionSuggestion(String name, String displayText, int cost, Integer line, Suggestion.Source source) Creates an instance of aSuggestionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintcost()Returns the value of thecostrecord component.Returns the value of thedisplayTextrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.line()Returns the value of thelinerecord component.name()Returns the value of thenamerecord component.source()Returns the value of thesourcerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Suggestion
public Suggestion(String name, String displayText, int cost, Integer line, Suggestion.Source source) Creates an instance of aSuggestionrecord class.- Parameters:
name- the value for thenamerecord componentdisplayText- the value for thedisplayTextrecord componentcost- the value for thecostrecord componentline- the value for thelinerecord componentsource- the value for thesourcerecord component
-
-
Method Details
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
name
-
displayText
Returns the value of thedisplayTextrecord component.- Returns:
- the value of the
displayTextrecord component
-
cost
-
line
-
source
-