A VS Code extension that provides code folding support for IBMi languages including RPGLE, CLLE, and DDS.
Features
RPGLE (.rpgle, .sqlrpgle, .rpgleinc)
- Procedure folding: Collapses procedure definitions (DCL-PI, DCL-PR, DCL-PROC)
- Subroutine folding: Collapses BEGSR/ENDSR blocks
- Comment folding: Collapses multi-line comment blocks (/* */)
- Fixed format folding: Collapses fixed format specification sections (P-specs, E-specs)
- IF block folding: Collapses IF/ENDIF groups (configurable)
CLLE (.clle, .cl, .clp)
- Procedure folding: Collapses PGM/ENDPGM blocks
- Variable declaration folding: Collapses DCL variable blocks
- Comment folding: Collapses multi-line comment blocks
- IF block folding: Collapses IF/ENDIF groups (configurable)
- SELECT folding: Collapses SELECT/ENDSELECT blocks
DDS (.dspf, .prtf, .pf, .lf, .dds)
- Record format folding: Collapses record format definitions (R REFNAME)
- Key specification folding: Collapses key definitions
- Comment folding: Collapses multi-line comment blocks
Configuration
The extension provides the following configuration options:
ibmiSourceFold.enableCommentFolding: Enable folding of comment blocks (default: true)ibmiSourceFold.enableProcedureFolding: Enable folding of procedure definitions (default: true)ibmiSourceFold.enableSubroutineFolding: Enable folding of subroutine blocks (default: true)ibmiSourceFold.enableIfGroupFolding: Enable folding of IF/ENDIF groups (default: false)ibmiSourceFold.enableDspfRecordFolding: Enable folding of DDS record formats (default: true)
Installation
- Clone this repository
- Run
npm install - Run
npm run compile - Open the project in VS Code
- Press F5 to launch the extension
Usage
The extension automatically provides folding when you open an IBMi source file. Use the folding icons in the gutter (left side of the editor) to collapse and expand code blocks.
Building
npm install
npm run compile
Publishing
npm install -g vsce
vsce package
vsce publish
License
MIT