Skip to content

Formatter

Paul Raingeard edited this page Nov 24, 2021 · 5 revisions

Format a document

The assembly language will be formatted with the standard shortcuts :

  • On Windows Shift + Alt + F
  • On Mac Shift + Option + F
  • On Ubuntu Ctrl + Shift + I
  • or Ctrl + Shift + P (or Command + Shift + P on Mac), and then search for "Format Document".

Formatting screenshot

Format a selection

  • The format sizes are calculated only for the selection

Formatting screenshot

Format on typing

  • Activate option formatOnType in the settings
{
    ...
    "editor.formatOnType": true,
    ...
}

Formatting screenshot

Configure spacing between elements

label spacing instruction spacing data spacing comment
mylabel amiga-assembly.format.labelToInstructionDistance move.l amiga-assembly.format.instructionToDataDistance d0,a0 amiga-assembly.format.dataToCommentsDistance ; mycomment

Set a preferred comment and/or instruction position while formatting a source

  • In the workspace or folder settings
{
    ...
    "amiga-assembly.format.preferredCommentPosition": 80,
    "amiga-assembly.format.preferredInstructionPosition": 10
    ...
}
option description
preferredCommentPosition Column of the comments, if not possible it will be placed according to the value of dataToCommentsDistance
preferredInstructionPosition Column of the instructions, if not possible it will be placed according to the value of labelToInstructionDistance