Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>IBMi Block CompletionNew to Visual Studio Code? Get it now.
IBMi Block Completion

IBMi Block Completion

Brian Recio

|
3 installs
| (0) | Free
Auto-closes free-format RPG blocks (if/endif, dow/enddo...) and adds snippets. / Cierra automáticamente los bloques de RPG free-format e incluye snippets.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

IBMi Block Completion

English · Español


English

Typing helpers for free-format RPG: automatic block closing and snippets.

Automatic block closing

Type the opening line ending in ; and press Enter at the end. The extension adds the closing statement below and leaves the cursor in between, already indented:

if x = 1;
   |
endif;
Opening Closing
if endif
dow, dou enddo
for, for-each endfor
select endsl
monitor endmon
begsr endsr
dcl-proc end-proc
  • If the opening is uppercase (IF), so is the closing.
  • It only closes when the source has more openings than closings of that type, so it never duplicates an existing endif.
  • It does nothing if you press Enter in the middle of a line, or on fixed-format C specs.
  • Ctrl+Z undoes the closing if you did not want it.

Snippets

Type the prefix, pick the suggestion with Tab or Enter and the whole block is inserted. Tab jumps to the next placeholder.

Prefix Inserts
if if … endif
ifelse if … else … endif
dow dow … enddo
for for i = 1 to n … endfor
select select / when / other / endsl
monitor monitor / on-error / endmon

Settings

Setting Default Description
ibmiBlockCompletion.autoClose true Turns automatic closing on Enter on or off.
ibmiBlockCompletion.indent 3 Spaces of indentation inside the block when it is closed automatically.

Requirements

VS Code 1.75 or later and an extension that assigns the rpgle language to your sources (for example, Code for IBM i).

If you previously pasted these snippets into your user rpgle.json, remove them there so they do not show up twice.


Español

Ayudas de escritura para RPG free-format: cierre automático de bloques y snippets.

Cierre automático

Escribe la línea de apertura terminada en ; y pulsa Enter al final. La extensión añade el cierre debajo y deja el cursor en medio, ya sangrado:

if x = 1;
   |
endif;
Apertura Cierre
if endif
dow, dou enddo
for, for-each endfor
select endsl
monitor endmon
begsr endsr
dcl-proc end-proc
  • Si la apertura está en mayúsculas (IF), el cierre también.
  • Solo cierra cuando en el fuente hay más aperturas que cierres de ese tipo, así no duplica un endif que ya existe.
  • No actúa si pulsas Enter en mitad de la línea ni en líneas C de formato fijo.
  • Ctrl+Z deshace el cierre si no lo querías.

Snippets

Escribe el prefijo, elige la sugerencia con Tab o Enter y se inserta el bloque completo. Tab salta al siguiente hueco.

Prefijo Inserta
if if … endif
ifelse if … else … endif
dow dow … enddo
for for i = 1 to n … endfor
select select / when / other / endsl
monitor monitor / on-error / endmon

Configuración

Ajuste Por defecto Descripción
ibmiBlockCompletion.autoClose true Activa o desactiva el cierre automático al pulsar Enter.
ibmiBlockCompletion.indent 3 Espacios de sangría dentro del bloque al cerrarlo automáticamente.

Requisitos

VS Code 1.75 o superior y una extensión que asigne el lenguaje rpgle a los fuentes (por ejemplo, Code for IBM i).

Si antes pegaste estos snippets en tu rpgle.json de usuario, bórralos de ahí para que no salgan duplicados.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft