{"record":{"id":"acc374c446648123","repo":"jdx/mise","slug":"path-raw-id-position-is-only-valid-with-lin","errorCode":null,"errorMessage":"\"{path_raw}\".{id}: position is only valid with line, ignoring entry","messagePattern":"\"(.+?)\"\\.(.+?): position is only valid with line, ignoring entry","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/edits.rs","lineNumber":308,"sourceCode":"            comment: None,\n        },\n        EditTomlEntry::Table(table) => table,\n    };\n    let is_block = entry.block.is_some() || entry.source.is_some();\n    let op = match (&is_block, &entry.line) {\n        (true, Some(_)) => {\n            bail!(\n                \"\\\"{path_raw}\\\".{id}: block/source and line are mutually exclusive, ignoring entry\"\n            )\n        }\n        (false, None) => {\n            bail!(\n                \"\\\"{path_raw}\\\".{id}: no recognized operation (block, source, or line), ignoring entry\"\n            )\n        }\n        (true, None) => {\n            if entry.position.is_some() {\n                bail!(\"\\\"{path_raw}\\\".{id}: position is only valid with line, ignoring entry\")\n            }\n            let source = match (entry.block, entry.source) {\n                (Some(_), Some(_)) => {\n                    bail!(\n                        \"\\\"{path_raw}\\\".{id}: block and source are mutually exclusive, ignoring entry\"\n                    )\n                }\n                (Some(inline), None) => BlockSource::Inline(inline),\n                (None, Some(src)) => {\n                    let src = file::replace_path(&src);\n                    let src = if src.is_relative() {\n                        base.join(src)\n                    } else {\n                        src\n                    };\n                    origin.source = Some(src.clone());\n                    BlockSource::File(src)\n                }","sourceCodeStart":290,"sourceCodeEnd":326,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/edits.rs#L290-L326","documentation":"The `position` field (append/prepend) only applies to line-based edits. When an entry uses a `block` or `source` operation but also sets `position`, `resolve_entry` bails and ignores the entry, because block placement is controlled by markers, not by line positioning.","triggerScenarios":"A block/source edit entry includes `position = \"append\"` or `position = \"prepend\"`. `resolve_entry` matches `(is_block=true, line=None)`, sees `entry.position.is_some()`, and bails at src/system/edits.rs:308.","commonSituations":"Users convert a line edit into a block edit (or vice versa) and leave `position` behind, or copy the `position` key from a neighboring line-based entry.","solutions":["Remove the `position` field from the block/source entry.","Switch the entry to `line = ...` if you actually want append/prepend positioning.","Re-run `mise edits` and confirm the entry is applied."],"exampleFix":"# before\n[dotfiles.\"~/.gitconfig\".alias-block]\nblock = \"[alias]\\n  st = status\"\nposition = \"append\"\n\n# after\n[dotfiles.\"~/.gitconfig\".alias-block]\nblock = \"[alias]\\n  st = status\"","handlingStrategy":"validation","validationCode":"if (e.block.is_some() || e.source.is_some()) && e.position.is_some() {\n    return Err(\"position is only meaningful for line edits; remove it\".into());\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only add `position` to entries that use `line`.","When switching an entry between line and block styles, audit all auxiliary fields.","Keep block entries minimal: block/source plus optional template/comment only."],"tags":["config","validation","dotfiles"],"backgroundTag":"mutually-exclusive-options","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}