manage_line_endings
Detect or fix line endings in files. Reports dominant style (LF/CRLF/mixed) and converts to your chosen style, preserving BOM.
Instructions
Detect or fix line endings. action="detect" reports the dominant style (crlf/lf/mixed/none), total lines, and the line numbers that disagree — use it when a file looks inconsistent. action="convert" rewrites the file to style, per code unit for UTF-16 and preserving its BOM; no-op if the file already matches. Parameters: path, action ("detect"|"convert"), style ("lf"|"crlf", required for convert), encoding (auto-detected, including most BOM-less UTF-16 — pass utf-16-le/utf-16-be if a very short or unusual file is misread). Example: {"path": "D:\src\unit1.pas", "action": "convert", "style": "crlf"}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| style | No | ||
| action | Yes | ||
| encoding | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| style | Yes | ||
| changed | No | ||
| message | No | ||
| totalLines | No | ||
| linesChanged | No | ||
| originalStyle | No | ||
| inconsistentLines | No |