|
| 1 | +--- |
| 2 | +name: Rocket MV BASIC Plugin Workflows |
| 3 | +description: How to use the Rocket MV BASIC VS Code extension for compiling, cataloging, debugging, and connecting to MultiValue servers. |
| 4 | +applyTo: "**/*" |
| 5 | +--- |
| 6 | + |
| 7 | +# Rocket MV BASIC Plugin Workflows |
| 8 | + |
| 9 | +You are assisting a developer using the **Rocket MV BASIC** VS Code extension (`rocket-mvbasic`). This extension supports **UniVerse**, **UniData**, and **jBASE** servers. |
| 10 | + |
| 11 | +## Extension Activation |
| 12 | + |
| 13 | +The extension activates when: |
| 14 | +- A workspace contains a `.rmv` file (offline mode) |
| 15 | +- A workspace contains a `.rmvonline` file (online/remote editing mode) |
| 16 | +- A `.b` or `.B` file is opened |
| 17 | +- The user runs "Activate Rocket MV BASIC" from the Command Palette |
| 18 | + |
| 19 | +## Workspace Setup (Offline Mode) |
| 20 | + |
| 21 | +To set up an offline MV BASIC workspace: |
| 22 | + |
| 23 | +1. Open the folder containing your BASIC source files |
| 24 | +2. Run "Activate Rocket MV BASIC" from Command Palette — this creates a `.rmv` marker file |
| 25 | +3. The extension creates `.rmv/config/` with configuration templates: |
| 26 | + - `db.mvbasic.json` — server connection settings |
| 27 | + - `basic.mvbasic.json` — compilation/catalog settings |
| 28 | + - `format.mvbasic.json` — code formatting rules |
| 29 | + |
| 30 | +## Connecting to a Server |
| 31 | + |
| 32 | +Edit `.rmv/config/db.mvbasic.json`: |
| 33 | + |
| 34 | +```json |
| 35 | +{ |
| 36 | + "version": "1.0", |
| 37 | + "db": { |
| 38 | + "host": "myserver.local", |
| 39 | + "port": 31438, |
| 40 | + "account": "/u2/MYACCOUNT", |
| 41 | + "username": "", |
| 42 | + "password": "", |
| 43 | + "datasource": "UniVerse" |
| 44 | + } |
| 45 | +} |
| 46 | +``` |
| 47 | + |
| 48 | +- `datasource`: `"UniVerse"`, `"UniData"`, or `"jBASE"` |
| 49 | +- Username/password: leave blank to be prompted, or fill in for auto-connect |
| 50 | +- `port`: Default is 31438 for UniVerse, 31438 for UniData, varies for jBASE |
| 51 | + |
| 52 | +To connect: Run **"Connect to U2 Server"** from Command Palette, or use the status bar button. |
| 53 | + |
| 54 | +## Compilation |
| 55 | + |
| 56 | +### Configuration |
| 57 | + |
| 58 | +Edit `.rmv/config/basic.mvbasic.json`: |
| 59 | + |
| 60 | +```json |
| 61 | +{ |
| 62 | + "catalog": "local", |
| 63 | + "catalog_arguments": "", |
| 64 | + "initialCharacter": "", |
| 65 | + "ud_compile_flavor": "", |
| 66 | + "compile_arguments": "", |
| 67 | + "file_lock_state": "OFF" |
| 68 | +} |
| 69 | +``` |
| 70 | + |
| 71 | +Key settings: |
| 72 | +- `catalog`: UniVerse = `"global"`, `"local"`, `"normal"`; UniData = `"local"`, `"direct"` |
| 73 | +- `ud_compile_flavor`: UniData only — `"Pick"`, `"Unibasic"`, `"revelation"`, `"douglas"` |
| 74 | +- `compile_arguments`: Extra flags passed to BASIC command |
| 75 | +- `initialCharacter`: For UniVerse global catalog — `"*"`, `"!"`, `"-"`, `"$"` |
| 76 | + |
| 77 | +### How to Compile |
| 78 | + |
| 79 | +1. **Command Palette**: Run "Compile BASIC Program" (`vscode-rocket.mv.basic.command.compile.do`) |
| 80 | +2. **Task**: Use `Terminal > Run Task > BASIC` — the extension provides a task provider |
| 81 | +3. **Keyboard**: Default keybinding can be assigned in VS Code settings |
| 82 | +4. **Context menu**: Right-click in editor → Compile |
| 83 | + |
| 84 | +The compile output appears in a dedicated Build Terminal with problem matcher integration — errors become clickable links in the Problems panel. |
| 85 | + |
| 86 | +### How to Catalog |
| 87 | + |
| 88 | +1. **Command Palette**: Run "Catalog BASIC Program" (`vscode-rocket.mv.basic.command.catalog.do`) |
| 89 | +2. The catalog type is read from `basic.mvbasic.json` |
| 90 | + |
| 91 | +## Debugging |
| 92 | + |
| 93 | +### Setup |
| 94 | + |
| 95 | +1. Ensure server connection is configured in `db.mvbasic.json` |
| 96 | +2. Create a launch configuration (`.vscode/launch.json`): |
| 97 | + |
| 98 | +```json |
| 99 | +{ |
| 100 | + "version": "0.2.0", |
| 101 | + "configurations": [ |
| 102 | + { |
| 103 | + "type": "mvbasic", |
| 104 | + "request": "launch", |
| 105 | + "name": "Debug MV BASIC", |
| 106 | + "program": "${file}", |
| 107 | + "stopOnEntry": true |
| 108 | + } |
| 109 | + ] |
| 110 | +} |
| 111 | +``` |
| 112 | + |
| 113 | +### How to Debug |
| 114 | + |
| 115 | +1. Set breakpoints by clicking the gutter (left of line numbers) |
| 116 | +2. Press F5 or use Run > Start Debugging |
| 117 | +3. The debugger connects to the server and executes the program |
| 118 | +4. Use standard VS Code debug controls: Step Over (F10), Step Into (F11), Continue (F5) |
| 119 | +5. Variables panel shows current variable values |
| 120 | +6. Debug Console allows evaluating expressions |
| 121 | + |
| 122 | +### Debug Features |
| 123 | + |
| 124 | +- Breakpoints (line breakpoints) |
| 125 | +- Step Over / Step Into / Step Out |
| 126 | +- Variable inspection |
| 127 | +- Watch expressions |
| 128 | +- Call stack display |
| 129 | + |
| 130 | +## Online (Remote) Editing |
| 131 | + |
| 132 | +For editing files directly on the server: |
| 133 | + |
| 134 | +1. Open Command Palette → "Add MV Server" to configure a server |
| 135 | +2. The Server Explorer tree view shows connected servers, accounts, and files |
| 136 | +3. Open files directly from the server — edits save back to the server |
| 137 | +4. Compile/catalog run directly on the server |
| 138 | + |
| 139 | +Online mode uses `.rmvonline` marker and `servers.mvbasic.json` for server definitions. |
| 140 | + |
| 141 | +## Code Formatting |
| 142 | + |
| 143 | +Configure in `.rmv/config/format.mvbasic.json`: |
| 144 | + |
| 145 | +```json |
| 146 | +{ |
| 147 | + "indentBody": true, |
| 148 | + "indentComment": true, |
| 149 | + "tabSize": 3, |
| 150 | + "useTab": true, |
| 151 | + "keywordsCase": "upper", |
| 152 | + "indentBEGINCASE": true, |
| 153 | + "indentCASE": true |
| 154 | +} |
| 155 | +``` |
| 156 | + |
| 157 | +Trigger formatting with: |
| 158 | +- `Shift+Alt+F` (Format Document) |
| 159 | +- Right-click → Format Document |
| 160 | +- Format on save (if enabled in VS Code settings) |
| 161 | + |
| 162 | +## Key Commands |
| 163 | + |
| 164 | +| Command | Description | |
| 165 | +|---------|-------------| |
| 166 | +| Activate Rocket MV BASIC | Activate the extension and create workspace config | |
| 167 | +| Compile BASIC Program | Compile the current file on the server | |
| 168 | +| Catalog BASIC Program | Catalog the current file on the server | |
| 169 | +| Connect to U2 Server | Connect to the configured server | |
| 170 | +| Add MV Server | Add a new server for online editing | |
| 171 | +| Show/Hide Auto Group | Toggle the file grouping view | |
| 172 | +| Show/Hide CodeLens | Toggle CodeLens annotations | |
| 173 | + |
| 174 | +## File Patterns |
| 175 | + |
| 176 | +| File | Purpose | |
| 177 | +|------|---------| |
| 178 | +| `.rmv` | Marks an offline mode workspace | |
| 179 | +| `.rmvonline` | Marks an online editing workspace | |
| 180 | +| `.rmv/config/db.mvbasic.json` | Server connection configuration | |
| 181 | +| `.rmv/config/basic.mvbasic.json` | Compilation and catalog settings | |
| 182 | +| `.rmv/config/format.mvbasic.json` | Code formatting rules | |
| 183 | +| `servers.mvbasic.json` | Online mode server definitions | |
| 184 | + |
| 185 | +## Tips |
| 186 | + |
| 187 | +- The extension requires **Java 17+** runtime (OpenJDK or Oracle JDK) |
| 188 | +- Configure the Java path in VS Code settings: `Rocket MV BASIC > Java Bin Path` |
| 189 | +- Open folders at the **account level** for best results (not individual files) |
| 190 | +- Use `$INCLUDE` for shared code — the extension resolves includes for go-to-definition |
| 191 | +- The extension provides IntelliSense for BASIC statements, cataloged programs (CALL), and symbols in the workspace |
0 commit comments