Search Rocket site

Rocket MV Basic For Visual Studio Code Extension Feature Review: Formatting

July 12, 2022

I’m happy to introduce to you the Rocket MV BASIC for Visual Studio Code Extension Feature Review series!

In this series, I will cover useful features related to editing, compiling, and debugging using the Rocket MV BASIC for Visual Studio Code Extension. I’ll start by covering the editing feature, specifically formatting.

Background

Reading legacy BASIC code can be challenging because different developers have different coding styles, and BASIC language grammar is so flexible. The formatting functionality can help you unify the BASIC program style and improve readability.

Recommended Configuration

The formatting functionality provides you with more than 20 configuration options to choose from. To make your BASIC programs more readable and concise, I recommend that you consider using the core format options shown below.

Parameters Values Description
“style.keywordCase”
  • uppercase
  • lowercase
  • titlecase
  • keep
All keywords and statements should have the same case.
“multiStatementsOneLine” Boolean
  • true
  • false
Specify whether to allow multiple statements on the same line.
“clause.useBlock” Boolean
  • true
  • false
Specify whether to always use a block for clauses
“style.commentMark”
  • rem”: use rem for as comment mark.
  •  “*”: use * as comment mark.
  • “!”: use ! as comment mark.
  • “$”: use $ as comment mark.
Specify the style of comment mark.
“spacing.operator”
“spacing.semicolon”
“spacing.comma”
“spacing.assignment”
  • >=1 Integer
Specify the number of whitespaces around binary operators, assignment symbols, after semicolon, comma.
“indent.block” Boolean
  • true
  • false
Specify whether to indent statements in block clauses

 Formatting options
There are many options to format your BASIC program, please choose the one that best meets your needs.

  • Option #1- Use the VS Code default shortcut command to format the whole document: Shift + Alt + F
  • Option #2- Right click document content and select “Format Document”
  • Option #3- Press the F1 button to open the command palette and enter command “Format Document”
  • Option #4- Select the text you want to format, then right click the selection, and select “Format Selection”

Formatting Code Sample

This is an example of formatted code after implementing the recommended configurations.

MVVS Code

If you have not tried it please visit the VS Code Marketplace to download the free Rocket MV BASIC for VS Code extension today.

For more information on future MVVS releases and to collaborate with fellow MVVS users, please visit the Rocket MVVS: MV BASIC for Visual Studio Code forum.