Package-level declarations

Types

Link copied to clipboard
data class BindingPresentation(val variable: String, val value: String)

One variable's value in a successful solution, already formatted as display-ready text.

Link copied to clipboard
data class Diagnostic(val severity: DiagnosticSeverity, val message: String, val range: TextRange? = null, val source: DiagnosticSource = DiagnosticSource("gui"), val code: String? = null)

One toolkit-neutral diagnostic (syntax error, solver warning, ...) shown against a document/page.

Link copied to clipboard
Link copied to clipboard
data class DiagnosticSource(val value: String)

Identifies what produced a Diagnostic (see DiagnosticSources for the well-known ones), so DiagnosticState.replaceSource can replace one source's diagnostics without touching another's.

Link copied to clipboard

Well-known DiagnosticSources used to keep independently-produced diagnostics from clobbering each other.

Link copied to clipboard
object EditorZoom

Shared font-size bounds for a Prolog source editor's zoom controls (Ctrl/Cmd +/-/0, Ctrl/Cmd + wheel), so every toolkit (ide-swing's RSyntaxTextArea, ide-web's Ace) agrees on how far zooming is allowed to go, instead of each reimplementing its own (previously drifted: 8-48 vs. 8-40) clamp.

Link copied to clipboard
data class FeatureDescriptor(val id: FeatureId, val displayName: String, val placement: FeaturePlacement, val requiredCapabilities: Set<String> = emptySet())

Describes one extension-contributed feature tab/panel: where it goes, what it's called, and what solver capabilities a page needs before it's shown.

Link copied to clipboard
data class FeaturePlacement(val region: SemanticRegion, val priority: Int = 0)

Where a FeatureDescriptor should appear (region) and its relative priority among others placed there.

Link copied to clipboard
data class FlagPresentation(val name: String, val value: String, val help: String = "")

One solver flag's current value, already formatted as display-ready text.

Link copied to clipboard
data class LibraryPresentation(val alias: String, val predicates: List<String> = emptyList(), val operators: List<OperatorPresentation> = emptyList(), val functions: List<String> = emptyList(), val help: String = "", val documentation: Map<String, String> = emptyMap())

One loaded library's contents, already formatted as display-ready text/signatures, for the libraries inspector panel.

Link copied to clipboard
data class OperatorPresentation(val name: String, val priority: Int, val specifier: String)

One known operator (name, priority, and fixity specifier like "xfx"/"fy"), toolkit-neutral and ready to display or feed into syntax highlighting.

Link copied to clipboard

Parser/lexer-backed classification shared by every Prolog-editing frontend (Swing, Compose, Web, ...).

Link copied to clipboard

The syntactic role of one token, as classified by a PrologSyntaxAnalyzer for semantic-highlighting.

Link copied to clipboard

A general area of the UI a FeaturePlacement can target.

Link copied to clipboard
data class SemanticToken(val range: TextRange, val category: SemanticCategory, val modifiers: Set<String> = emptySet())

One classified span of source text, ready for a toolkit to render with syntax-highlighting colors.

Link copied to clipboard
sealed interface SolutionPresentation

One outcome of resolving a query, already formatted as display-ready text so a frontend never needs to know about the underlying Term/Solution types.

Link copied to clipboard
data class SolverInspectionSnapshot(val operators: List<OperatorPresentation> = emptyList(), val flags: List<FlagPresentation> = emptyList(), val libraries: List<LibraryPresentation> = emptyList(), val staticKnowledgeBase: String = "", val dynamicKnowledgeBase: String = "")

Everything the inspector panels (operators, flags, libraries, knowledge bases) show about a solver at one point in time, already formatted as display-ready text.

Link copied to clipboard
data class SourceSuggestion(val text: String, val category: String)

A candidate identifier to offer for auto-completion, derived from already-classified SemanticTokens.

Link copied to clipboard
data class SyntaxAnalysis(val source: String, val tokens: List<SemanticToken>, val diagnostics: List<Diagnostic>)

Result of analysing source: its classified tokens and any syntax diagnostics found along the way.

Link copied to clipboard

Toolkit-neutral entry point for turning source text into semantic tokens, so a frontend doesn't need to depend on PrologSyntaxAnalyzer directly.

Link copied to clipboard
data class TextPosition(val offset: Int, val line: Int, val column: Int)

One point in source text, given both as a flat offset and as zero-based line/column for editors that need one or the other.

Link copied to clipboard
data class TextRange(val start: TextPosition, val endExclusive: TextPosition)

A span of source text from start up to (but not including) endExclusive.

Link copied to clipboard
data class WarningPresentation(val message: String, val logicStackTrace: List<String> = emptyList())

One solver warning, already formatted as a display-ready message and stack trace.

Functions

Link copied to clipboard
fun documentationPreview(markdown: String, maxLength: Int = 80): String

A one-line plain-text preview of markdown: its first paragraph that isn't just a code span (stdlib docs open with a ` `usage(?Template)` ` line), stripped of backticks and truncated to maxLength with ….

Link copied to clipboard
fun durationLabel(duration: Duration): String

Human-readable label such as "Timeout: 1 hour 30 minutes", for status displays.

Link copied to clipboard

Formats duration back into the compact input format accepted by parseDurationInput.

Link copied to clipboard
fun markdownToHtml(markdown: String): String

Renders markdown (CommonMark) as an HTML <body> fragment.

Link copied to clipboard

Parses a human-readable duration such as "1h 30m" or "500ms", or "none"/"0" for no limit. Returns null for malformed input, repeated units, or a total exceeding one week.

Link copied to clipboard

Ranks identifiers already present in analysis as completion candidates, most recent first.