export type LspDiagnostic = { range: { start: { line: number; character: number }; end: { line: number; character: number }; }; severity?: number; code?: string | number; source?: string; message: string; }; export type LspPosition = { line: number; character: number }; export type LspRange = { start: LspPosition; end: LspPosition }; export type LspTextEdit = { range: LspRange; newText: string; }; export type LspWorkspaceEdit = { changes?: Record; documentChanges?: Array< | { textDocument?: { uri: string; version?: number | null }; edits: LspTextEdit[] } | { kind: "create" | "rename" | "delete"; [key: string]: unknown } >; }; export type LspCodeAction = { title: string; kind?: string; diagnostics?: LspDiagnostic[]; edit?: LspWorkspaceEdit; command?: unknown; isPreferred?: boolean; disabled?: { reason: string }; data?: unknown; }; export type CategorizedRubyLspError = { code: string; message: string; root?: string; command?: string[]; cwd?: string; stderrSummary?: string; suggestions: string[]; retryable: boolean; fallbackUsed?: boolean; }; export type RubyRootInfo = { root: string; markers: string[]; kind: "plain-ruby" | "rails-app" | "rails-engine" | "monorepo"; rails: { detected: boolean; engine?: boolean; markers: string[]; routesCommand?: string[]; }; }; export type DoctorResult = { cwd: string; root?: string; roots?: RubyRootInfo[]; command: string[]; commandPlan?: { command: string[]; cwd: string; strategy: "bundler" | "global"; reason: string; candidates: string[][]; }; environment?: { rubyVersion?: string; bundlerVersion?: string; rubyLspVersion?: string; }; status: "ready" | "stopped" | "unavailable" | "error"; running: boolean; initialized: boolean; project: { hasGemfile: boolean; hasRubyFiles: boolean; kind?: RubyRootInfo["kind"]; rails: { detected: boolean; engine?: boolean; markers: string[]; routesCommand?: string[]; }; note?: string; }; capabilities?: { documentFormattingProvider: boolean; renameProvider: boolean; prepareProvider: boolean; codeActionProvider: boolean; }; error?: string; errorInfo?: CategorizedRubyLspError; stderr?: string[]; recommendations?: string[]; };