{"record":{"id":"c8b6adb9500095a5","repo":"astral-sh/ruff","slug":"invalid-value-0-for-position-column-the-colum","errorCode":null,"errorMessage":"Invalid value `0` for `position.column`. The column index is 1-indexed.","messagePattern":"Invalid value `0` for `position\\.column`\\. The column index is 1-indexed\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"crates/ty_wasm/src/lib.rs","lineNumber":1188,"sourceCode":"    }\n}\n\nimpl Position {\n    fn to_text_size(\n        self,\n        text: &str,\n        index: &LineIndex,\n        position_encoding: PositionEncoding,\n    ) -> Result<TextSize, Error> {\n        let text_size = index.offset(\n            SourceLocation {\n                line: OneIndexed::new(self.line).ok_or_else(|| {\n                    Error::new(\n                        \"Invalid value `0` for `position.line`. The line index is 1-indexed.\",\n                    )\n                })?,\n                character_offset: OneIndexed::new(self.column).ok_or_else(|| {\n                    Error::new(\n                        \"Invalid value `0` for `position.column`. The column index is 1-indexed.\",\n                    )\n                })?,\n            },\n            text,\n            position_encoding.into(),\n        );\n\n        Ok(text_size)\n    }\n\n    fn from_text_size(\n        offset: TextSize,\n        line_index: &LineIndex,\n        source: &str,\n        position_encoding: PositionEncoding,\n    ) -> Self {\n        let location = line_index.source_location(offset, source, position_encoding.into());","sourceCodeStart":1170,"sourceCodeEnd":1206,"githubUrl":"https://github.com/astral-sh/ruff/blob/26f38c119cac42e4d320ba08f09224fdec74af2c/crates/ty_wasm/src/lib.rs#L1170-L1206","documentation":"A wasm-bindgen Error from Position::to_text_size: the caller passed 0 for position.column. Columns are 1-indexed in the wasm API (via OneIndexed), so 0 is invalid and cannot be mapped to a text offset.","triggerScenarios":"Thrown at crates/ty_wasm/src/lib.rs:1188 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a 1-indexed column number (first column is 1)","Convert 0-based editor coordinates to 1-based before calling the API"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"26f38c119cac42e4d320ba08f09224fdec74af2c","analyzedAt":"2026-09-05T10:32:37.492Z","contentChangedAt":"2026-09-05T10:32:37.492Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}