{"record":{"id":"9066a5d8c4fd9568","repo":"helix-editor/helix","slug":"failed-to-parse-arguments-err","errorCode":null,"errorMessage":"failed to parse arguments: {err}","messagePattern":"failed to parse arguments: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"helix-term/src/commands/typed.rs","lineNumber":1773,"sourceCode":"            ));\n            Ok(call)\n        };\n        cx.jobs.callback(callback);\n    } else {\n        let command = args[0].to_string();\n        let matches: Vec<_> = ls_id_commands\n            .filter(|(_ls_id, c)| *c == &command)\n            .collect();\n\n        match matches.as_slice() {\n            [(ls_id, _command)] => {\n                let arguments = args\n                    .get(1)\n                    .map(|rest| {\n                        serde_json::Deserializer::from_str(rest)\n                            .into_iter()\n                            .collect::<Result<Vec<Value>, _>>()\n                            .map_err(|err| anyhow!(\"failed to parse arguments: {err}\"))\n                    })\n                    .transpose()?\n                    .filter(|args| !args.is_empty());\n\n                cx.editor.execute_lsp_command(\n                    helix_lsp::lsp::Command {\n                        title: command.clone(),\n                        arguments,\n                        command,\n                    },\n                    *ls_id,\n                );\n            }\n            [] => {\n                cx.editor.set_status(format!(\n                    \"`{command}` is not supported for any language server\"\n                ));\n            }","sourceCodeStart":1755,"sourceCodeEnd":1791,"githubUrl":"https://github.com/helix-editor/helix/blob/079a789e8cb08ead67f19e1971a1b7438b37354b/helix-term/src/commands/typed.rs#L1755-L1791","documentation":"`:lsp-workspace-command <command> [args...]` forwards arguments to workspace/executeCommand. Every remaining prompt word is deserialized as a JSON value using a serde_json stream (Deserializer::from_str(..).into_iter()), so each word must itself be valid JSON — a bare string, number, array, or object. A word that fails JSON parsing aborts with 'failed to parse arguments: <err>' before the request is sent.","triggerScenarios":"`:lsp-workspace-command rust-analyzer.reloadWorkspace notjson`; passing an unquoted word ('hello'); an object with unbalanced braces or smart quotes pasted from rendered docs.","commonSituations":"Expecting shell-style bare-string arguments; quoting confusion in the prompt; copy-paste introducing curly quotes; forgetting that strings must be double-quoted.","solutions":["Pass each argument as valid JSON: numbers bare (3), strings double-quoted (\"hello\"), objects/arrays as-is ('{\"k\":1}').","Omit all arguments to open the picker of commands the server actually advertises.","Check the command name too — it must exactly match one advertised by an attached server."],"exampleFix":"# before\n:lsp-workspace-command myCommand hello\n# after\n:lsp-workspace-command myCommand \"hello\"","handlingStrategy":"validation","validationCode":"// each argument word must be a standalone JSON value\nfn args_ok(words: &[String]) -> bool {\n    words.iter().all(|w| serde_json::from_str::<serde_json::Value>(w).is_ok())\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Quote string arguments as JSON ('\"hello\"', not hello) when scripting :lsp-workspace-command.","Use the no-argument form to enumerate the exact commands a server advertises."],"tags":["lsp","json","command"],"backgroundTag":null,"analyzedSha":"079a789e8cb08ead67f19e1971a1b7438b37354b","analyzedAt":"2026-08-16T09:09:59.668Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}