/**
 * Shared types for the LSP service. Reconstructed from consumer
 * usages (config.ts, LSPServerInstance.ts, LSPServerManager.ts) after
 * the original file was lost.
 */

/**
 * Runtime-observable LSP server lifecycle states. Inferred from the
 * `state === '…'` / assignment branches across LSPServerInstance.
 */
export type LspServerState = 'stopped' | 'starting' | 'running' | 'stopping' | 'error'

/**
 * A plugin-scoped LSP server configuration. `command` + optional
 * `args` + optional `env` are spawned at start time; `name` and
 * `source` identify the plugin of origin.
 */
export interface ScopedLspServerConfig {
  name: string
  source: string
  command: string
  args?: string[]
  env?: Record<string, string>
  restartOnCrash?: boolean
  maxRestarts?: number
  startupTimeout?: number
  shutdownTimeout?: number
  workspaceFolder?: string
  initializationOptions?: Record<string, unknown>
  extensionToLanguage?: Record<string, string>
}
