{"record":{"id":"fc8941501a444427","repo":"tobi/qmd","slug":"line-line-number-type-must-include-text-fc8941","errorCode":null,"errorMessage":"Line ${line.number} (${type}:) must include text.","messagePattern":"Line (.+?) \\((.+?):\\) must include text\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/cli/qmd.ts","lineNumber":2768,"sourceCode":"    // Parse intent: lines\n    if (intentRe.test(line.trimmed)) {\n      if (intent !== undefined) {\n        throw new Error(`Line ${line.number}: only one intent: line is allowed per query document.`);\n      }\n      const text = line.trimmed.replace(intentRe, '').trim();\n      if (!text) {\n        throw new Error(`Line ${line.number}: intent: must include text.`);\n      }\n      intent = text;\n      continue;\n    }\n\n    const match = line.trimmed.match(prefixRe);\n    if (match) {\n      const type = match[1]!.toLowerCase() as 'lex' | 'vec' | 'hyde';\n      const text = line.trimmed.slice(match[0].length).trim();\n      if (!text) {\n        throw new Error(`Line ${line.number} (${type}:) must include text.`);\n      }\n      if (/\\r|\\n/.test(text)) {\n        throw new Error(`Line ${line.number} (${type}:) contains a newline. Keep each query on a single line.`);\n      }\n      typed.push({ type, query: text, line: line.number });\n      continue;\n    }\n\n    if (rawLines.length === 1) {\n      // Single plain line -> implicit expand\n      return null;\n    }\n\n    throw new Error(`Line ${line.number} is missing a lex:/vec:/hyde:/intent: prefix. Each line in a query document must start with one.`);\n  }\n\n  // intent: alone is not a valid query — must have at least one search\n  if (intent && typed.length === 0) {","sourceCodeStart":2750,"sourceCodeEnd":2786,"githubUrl":"https://github.com/tobi/qmd/blob/dbfd0b4736aeaf761d1a16ca8e424f071df8feb9/src/cli/qmd.ts#L2750-L2786","documentation":"Thrown by the CLI query-document parser when a lex:/vec:/hyde: line has a prefix but no query text. Each typed search line must contain its query on the same line.","triggerScenarios":"Piping 'lex:' or 'vec:   ' as a line within a multi-line query document to `qmd query`.","commonSituations":"Template query documents never filled in; deleting query text while keeping prefixes.","solutions":["Add the query text after the prefix","Remove the empty line if that search is not wanted"],"exampleFix":"# before\nlex:\nvec: setup docs\n# after\nlex: how to install\nvec: setup docs","handlingStrategy":"validation","validationCode":"if (/^\\s*(lex|vec|hyde):\\s*$/im.test(doc)) throw new Error('typed line missing text');","typeGuard":"const noEmptyTyped = (doc: string) => !/^\\s*(lex|vec|hyde):\\s*$/im.test(doc);","tryCatchPattern":null,"preventionTips":["Trim and verify each prefixed line is non-empty before piping to qmd query"],"tags":["query","cli","query-syntax"],"backgroundTag":"query-syntax-validation-failed","analyzedSha":"dbfd0b4736aeaf761d1a16ca8e424f071df8feb9","analyzedAt":"2026-08-28T18:07:46.628Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}