Professional VSCode support for OPL (One Piece Language), a lightweight programming language with pirate syntax, an AST interpreter, bytecode VM, diagnostics, and debugger tooling.
Quickstart
- Install the OPL runtime:
python -m pip install oplang
-
Install this VSCode extension.
-
Open any
.oplfile. -
Run from a terminal:
opl run file.opl
- Debug from VSCode with the included
Run OPLlaunch configuration, or run:
opl debug file.opl
Features
- Syntax highlighting for
.oplfiles - File icon support for
.oplfiles - Bracket auto-closing for
{},[], and() - Indentation support for functions, models, loops, and conditionals
- Snippets for common OPL patterns
- Autocomplete for functions, models, variables, methods, and standard library symbols
- Diagnostics for syntax and semantic issues
- Hover, go-to-definition, document symbols, and workspace symbols
- Editor title buttons for running and debugging the current
.oplfile - Explorer context menu actions for running and debugging
.oplfiles - VSCode debugger integration with breakpoints, stepping, stack frames, and variables
File Extension
OPL uses one official source file extension:
.opl
Example
Pirate syntax:
dfruit add(a, b):
return a + b
bounty result = add(2, 3)
say result
Core syntax:
fn add(a, b) {
return a + b
}
let result = add(2, 3)
print(result)
Debugging
Use the default launch configuration:
{
"type": "opl",
"request": "launch",
"name": "Run OPL",
"program": "${file}"
}
Set breakpoints in .opl files, press F5, step through execution, and inspect variables in the VSCode debugger panels.
You can also use the editor title Debug button or right-click a .opl file in the Explorer and choose Debug OPL File.
Requirements
This extension expects the OPL runtime tools to be available through Python:
python -m pip install oplang
The runtime provides:
oplopl-lspopl-dap
If VSCode cannot find your Python installation, set OPL_PYTHON to the Python executable that has oplang installed.
Snippets
dfruitcreates a functionmodelcreates a model with aspawnconstructorforcreates a for-in loopifcreates an if statement
Extension Development
For maintainers working on the extension internals:
OPL_LSP_PATHcan point to a local language server script.OPL_DAP_PATHcan point to a local debug adapter script.- Publish a patch release only after reviewing the Marketplace README:
vsce publish patch