{"record":{"id":"382cec9b55e5c280","repo":"PRQL/prql","slug":"currently-highlight-only-works-with-a-single-sou","errorCode":null,"errorMessage":"Currently `highlight` only works with a single source, but found multiple sources","messagePattern":"Currently `highlight` only works with a single source, but found multiple sources","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"prqlc/prqlc/src/cli/mod.rs","lineNumber":483,"sourceCode":"                    Format::Yaml => serde_yaml::to_string(&fc)?.into_bytes(),\n                }\n            }\n            Command::Experimental(ExperimentalCommand::GenerateDocs { format, .. }) => {\n                let module_ref = prql_to_pl_tree(sources)?;\n\n                match format {\n                    DocsFormat::Html => {\n                        docs_generator::generate_html_docs(module_ref.stmts).into_bytes()\n                    }\n                    DocsFormat::Markdown => {\n                        docs_generator::generate_markdown_docs(module_ref.stmts).into_bytes()\n                    }\n                }\n            }\n            Command::Experimental(ExperimentalCommand::Highlight(_)) => {\n                let s = sources.sources.values().exactly_one().or_else(|_| {\n                    // TODO: allow multiple sources\n                    bail!(\"Currently `highlight` only works with a single source, but found multiple sources\")\n                })?;\n                let tokens = prql_to_tokens(s)?;\n\n                maybe_strip_colors(&highlight::highlight(&tokens)).into_bytes()\n            }\n            Command::Compile {\n                signature_comment,\n                format,\n                target,\n                debug_log,\n                ..\n            } => {\n                if debug_log.is_some() {\n                    debug::log_start();\n                }\n\n                let opts = Options::default()\n                    .with_target(Target::from_str(target).map_err(prqlc::ErrorMessages::from)?)","sourceCodeStart":465,"sourceCodeEnd":501,"githubUrl":"https://github.com/PRQL/prql/blob/e164e249b99485890036eb60f57c37520379b240/prqlc/prqlc/src/cli/mod.rs#L465-L501","documentation":"The experimental `prqlc highlight` command tokenizes one PRQL source to emit syntax highlighting. Like lex and annotate, it demands exactly one source and bails when several are supplied (the TODO notes multi-source support is planned).","triggerScenarios":"Running `prqlc experimental highlight` (or highlight) with multiple input files or includes so sources.sources has more than one entry.","commonSituations":"Editor integrations piping a project rather than the open buffer; scripts passing includes along with the main file for colorized output.","solutions":["Highlight one file at a time: prqlc highlight <single-file>.prql","Drop --include flags; merge into one file if a combined view is needed","If integrating with an editor, feed only the active buffer's contents via stdin"],"exampleFix":"# before\nprqlc highlight main.prql helpers.prql\n# after\nprqlc highlight main.prql","handlingStrategy":"validation","validationCode":"# Only one source for highlight\nprqlc highlight main.prql  # no extra args, no --include","typeGuard":null,"tryCatchPattern":"prqlc highlight \"$file\" || echo \"highlight failed for $file; run per file\"","preventionTips":["Feed a single buffer/file in editor integrations","Loop over files for batch highlighting","Avoid --include with highlight/lex/annotate"],"tags":["cli","prql","highlighting"],"backgroundTag":"unsupported-operation","analyzedSha":"e164e249b99485890036eb60f57c37520379b240","analyzedAt":"2026-09-09T12:18:38.727Z","contentChangedAt":"2026-09-09T12:18:38.727Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}