{"record":{"id":"b86fb7e1685a1d6c","repo":"facebook/flow","slug":"invalid-column","errorCode":null,"errorMessage":"invalid column","messagePattern":"invalid column","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"rust_port/crates/flow_cli/src/autocomplete_command.rs","lineNumber":105,"sourceCode":"    command_utils::get_file_from_filename_or_stdin(spec().name.as_str(), filename, None)\n}\n\nfn parse_args(\n    args: Option<Vec<String>>,\n) -> (flow_server_utils::file_input::FileInput, Option<(i32, i32)>) {\n    match args.as_deref() {\n        None | Some([]) => {\n            let input = file_input_from_stdin(None);\n            extract_cursor(input)\n        }\n        Some([filename]) => {\n            let input = file_input_from_stdin(Some(filename.as_str()));\n            extract_cursor(input)\n        }\n        Some([line, column]) => {\n            let cursor = command_utils::convert_input_pos(\n                line.parse().expect(\"invalid line\"),\n                column.parse().expect(\"invalid column\"),\n            );\n            let input = file_input_from_stdin(None);\n            (input, Some(cursor))\n        }\n        Some([filename, line, column]) => {\n            let cursor = command_utils::convert_input_pos(\n                line.parse().expect(\"invalid line\"),\n                column.parse().expect(\"invalid column\"),\n            );\n            let input = file_input_from_stdin(Some(filename.as_str()));\n            (input, Some(cursor))\n        }\n        _ => {\n            eprintln!(\n                \"{}\",\n                command_spec::command(spec(), |_| {}).string_of_usage()\n            );\n            flow_common_exit_status::exit(","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/facebook/flow/blob/f88ac94bcf6992f5d5a158854d94613ebb92c6e6/rust_port/crates/flow_cli/src/autocomplete_command.rs#L87-L123","documentation":"In the autocomplete command's two-argument form [line, column] (no filename, content from stdin), the column argument is parsed with column.parse().expect(\"invalid column\"). A value that is not a valid i32 (letters, empty, out of range) panics with \"invalid column\" rather than producing a usage error.","triggerScenarios":"Calling autocomplete with two positional args where the second is not an integer: flow autocomplete 12 5.5, flow autocomplete 12 col, or an empty string from an unset script variable.","commonSituations":"Editor integrations sending a 0-based/offset or formatted position instead of a plain integer; scripts interpolating unquoted/empty variables; argument-order mixups placing a flag in the column slot.","solutions":["Pass a plain 1-based integer for column: flow autocomplete 12 5.","Validate that both values are integers before shelling out from integrations or scripts.","Check the usage output (run with no args) for the accepted forms."],"exampleFix":"# before: second argument is not an i32\nflow autocomplete 12 5.5   # panics: invalid column\n\n# after\nflow autocomplete 12 5","handlingStrategy":"validation","validationCode":"# Reject non-integer column values before invoking autocomplete.\ncase \"$2\" in ''|*[!0-9-]*) echo \"column must be an integer\"; exit 2;; esac","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Send plain integers from integrations — no decorations, offsets, or formatted positions.","Default optional/empty variables to a valid integer or omit the position entirely.","Smoke-test CLI wrappers with edge-case arguments before shipping."],"tags":["cli","autocomplete","argument-parsing","panic","rust"],"backgroundTag":"invalid-cli-argument","analyzedSha":"f88ac94bcf6992f5d5a158854d94613ebb92c6e6","analyzedAt":"2026-08-20T10:41:37.992Z","schemaVersion":2},"datasetVersion":"2026-08-23T11:17:13.642Z"}