Syntax highlighting and reference for SAP IDocs in VS Code. Supports both fixed-width flat files and XML.
Features
Flat-file IDocs (.txt, .idoc)
Syntax highlighting: For flat files, segments are highlighted and grouped (e.g. control record, header data, items, etc). Positions are also separated visually by type.
Hover hints: Enable to hover over a segment name (xml/ff) or position (ff) to see useful reference information. Reference the field, its value, a qualifier translation, a readable date or time, and the field's offset, length and data type.
Note: Translations use standard SAP code lists; custom or user-defined values in your system may not be covered.
Auto-detect: A plain-text file whose first line starts with EDI_DC40 activates the SAP IDoc language.
Status bar. Shows the segment and field under the cursor and highlights that field's columns on the line.
XML IDocs
A file is treated as an IDoc if <IDOC or <EDI_DC40 appears in its first 10 lines.
Hovering a segment tag shows the segment's field list.
Hovering a field tag shows the same value, translation and date details as flat files. The parent segment is found automatically, including custom Z* segments that have a SEGMENT= attribute.
Hover hints on/off
Toggle hints with the IDoc Hints status bar item, Ctrl+Alt+Shift+I, or SAP IDoc: Toggle IDoc Hover Hints. The choice is saved to the user setting sapIdoc.hoverHints.enabled, so it persists across reloads and windows.
Customising colours
Each colour role can be overridden in settings.json: