{"record":{"id":"6ff19fa726c6c66f","repo":"deepseek-ai/deepseek-harness","slug":"lsp-invalid-provider","errorCode":"LSP_INVALID_PROVIDER","errorMessage":"an LSP provider id must be a non-empty string","messagePattern":"an LSP provider id must be a non-empty string","errorType":"validation","errorClass":"LspError","httpStatus":null,"severity":"error","filePath":"packages/lsp/lsp/src/index.ts","lineNumber":95,"sourceCode":"\n/**\n * `ctx.lsp`. Holds the id reservations and the extension→route table; both are populated and cleared\n * together per provider so a route always has a live provider.\n */\nexport class Lsp extends Service implements LspService {\n  private readonly providerIds = new Set<LspProviderId>()\n  private readonly routes = new Map<string, Route>()\n\n  constructor(ctx: Context) {\n    super(ctx, 'lsp')\n  }\n\n  registerProvider(provider: LspProvider): () => void {\n    // Validate and conflict-check everything BEFORE any mutation: an invalid or conflicting\n    // registration must publish nothing (fail-loud, all-or-nothing).\n    const id = provider.id\n    if (id.trim() === '') {\n      throw new LspError('an LSP provider id must be a non-empty string', 'LSP_INVALID_PROVIDER')\n    }\n    if (this.providerIds.has(id)) {\n      throw new LspError(`an LSP provider with id \"${id}\" is already registered`, 'LSP_CONFLICT')\n    }\n\n    const entries = Object.entries(provider.extensionToLanguage)\n    if (entries.length === 0) {\n      throw new LspError(`LSP provider \"${id}\" registers no file extensions`, 'LSP_INVALID_PROVIDER')\n    }\n\n    // Normalize into this provider's route set, catching intra-provider duplicates (e.g. `.TS` and\n    // `.ts`) before checking cross-provider conflicts.\n    const pending = new Map<string, Route>()\n    for (const [rawExt, languageId] of entries) {\n      const ext = normalizeExtension(rawExt)\n      if (!EXTENSION_PATTERN.test(ext)) {\n        throw new LspError(`LSP provider \"${id}\" maps an invalid extension \"${rawExt}\"`, 'LSP_INVALID_PROVIDER')\n      }","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/lsp/lsp/src/index.ts#L77-L113","documentation":"Error \"an LSP provider id must be a non-empty string\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/lsp/lsp/src/index.ts:95 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Register the provider with a non-empty string id."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}