MERP PXPlus Helper
PXPlus language support for VS Code, focused on reading and navigating PxPlus code.
Features
Syntax highlighting
- TextMate grammar for PxPlus (
.pxprg, .pxp, .pvp, .pvx, .pvc, .bbx)
- Sensible default token colors that work with any dark theme (comments, strings, numbers, flow keywords like
GOSUB/RETURN/PERFORM, labels, variables, classes) — applied only to PxPlus token scopes, never to other languages, and without changing your color theme
- Editor decorations for labels (
LABEL:), special headers (NAME:!), and special block regions up to their closing RETURN
- Virtual indentation — lines inside loops and
LABEL: … RETURN routine bodies are visually shifted per nesting level without modifying the file (pxplus.virtualIndent.enabled / pxplus.virtualIndent.size)
- PxPlus globe file icon for PxPlus files
- Owns a private
pxplus-merp language id so highlighting never conflicts with other installed PxPlus extensions
Typing aids
- Smart Enter — pressing Enter on a numbered line inserts the next line number (inferring the step from nearby lines, splitting gaps, and renumbering following lines when the gap runs out); toggle with
pxplus.autoInsertLineNumbersOnEnter
- Paste numbering — multi-line pastes of unnumbered code get line numbers continuing from the line above
PXPlus: Renumber Line Numbers command resequences the whole file
- Completions — statement snippets (
if, for, while, repeat, select, fh open/fh close, gosub, …) whose extra lines are numbered to match the file, plus keywords, built-in functions/system variables with docs, err=/dom=/key= clauses inside I/O parens, PERFORM "FILE;ROUTINE" file & routine names, and OBJ' class members
- Signature help for built-in functions and class methods
- Hover docs for keywords, built-ins, and
PERFORM "FH;…" commands
PXPlus: Insert Routine Shell command scaffolds a routine (optionally numbered via pxplus.includeLineNumbersInSnippets)
Navigation
- Outline / breadcrumbs — labels, routines, functions, classes, and properties (class members grouped under their class)
- Jump to routine or label —
Ctrl+Alt+O quick pick
- Go to definition (
F12 / Ctrl+Click)
- labels and
GOSUB targets
GOTO 1234 numbered lines
PERFORM "FILE;ROUTINE" / CALL "FILE;ROUTINE" into other workspace files
RUN/LOAD/SAVE "FILE" references
OBJ'MEMBER class members (resolves NEW("Class") and LIKE "Parent" chains)
- Find references (
Shift+F12) across open and workspace PxPlus files
- Workspace symbol search (
Ctrl+T) across all PxPlus files
- Clickable links on
PERFORM/CALL/RUN/LOAD/SAVE file names
- Folding for
LABEL: … RETURN routines, special blocks, and IF/FOR/WHILE/REPEAT/SELECT/SELECT … NEXT RECORD blocks
- Hover previews of local labels/routines and class member signatures
Stage in WindX session (Windows only)
- Stage button in the editor title bar (also
Ctrl+Alt+R) sends the current file into a running WindX session: l <name> → delete 1,65000 → the program body — then you run/save it in the session yourself
- Any program size — the program is pasted in chunks under WindX's clipboard limit (
pxplus.run.pasteChunkBytes); each chunk ends with serial "[WDX]…" so the host acknowledges the chunk by creating a local file before the next one is sent (no timing guesses; falls back to timed delays of pxplus.run.pasteLineDelayMs per line if [WDX] writes are blocked)
- Multi-session aware — finds every running
pxplus.exe, reads the launcher -arg (e.g. MERP-D5, MERP-QA) from its command line, and shows a picker when more than one is open; the chosen target is remembered per workspace and shown in the status bar (click to switch)
- Targets matching
pxplus.run.confirmTargets (default PROD/PRD) require a modal confirmation before anything is sent
- Assumes the target session is sitting at the ads ready prompt; the paste replaces the program in session memory and overwrites the Windows clipboard
- Settings:
pxplus.run.processName, pxplus.run.loadProgramFirst, pxplus.run.sessionLabels, pxplus.run.confirmTargets
Development
npm install
npm run build # bundle to dist/index.cjs
npm run dev # watch mode (used by F5 launch)
npm run ext:package # build the .vsix
Press F5 with the repo root open in VS Code to launch an Extension Development Host (the launch config lives in the repo root's .vscode/).
| |