VS Code extension providing autocomplete and type support for OpenJavascript (JavaScript scripting plugin for bukkit based Minecraft servers)
Features
- Full autocomplete for all OpenJS globals:
task,log,script,Services,DiskApi,registerEvent,addCommand, and more - Service typing:
Services.get("FileManager")returns the correct typed service - importClass() autocomplete: type
importClass("org.bukkit.)` and get a list of all available Java classes from your server - FileManager path suggestions:
FileManager.read(")` suggests files relative to your current script - Code snippets for common patterns:
task.main→ expands to a full function templatetask.spawn,task.thread,task.delay,task.repeatregisterEvent→ expands with handler
- Generated types from your server: run
/oj genvsextensionon your server and import the output for full autocomplete of every loaded plugin and Bukkit API class
Info
- Full type generation is only available on the nightly builds of OpenJS
/oj genvsextension - The type generator is very CPU-intensive, depending on the server version over 4000 and 5000 definitions and javadocs will be generated.
- On my mid-range pc it usually takes 1 minute and 30 seconds to generate all of the types on Paper v26.1
Installation
Install from the VS Code marketplace *soon*, or download the .vsix from releases and run:
Building from source
Requires Node.js and vsce:
npm install -g @vscode/vsce
Clone the repo and build:
git clone https://github.com/spidermodders/OpenJavascript-intellisense.git
cd openjs-intellisense
vsce package
This outputs a .vsix file. Install it in VS Code via Extensions: Install from VSIX...