Minr Scripts VSCode Extension READMEThis Visual Studio Code extension adds syntax highlighting and code completion functionalities for minr.org Minecraft server scripts (MSC), as well as fast upload and download to paste.minr.org. The extension is available to download at Visual Studio Marketplace. FeaturesSyntax HighlightingHighlighting is applied to files with the .msc extension. Code CompletionThe extension features a wide range of code completion functionalities. It will suggest the following items:
Note that when you're typing something at the beginning of the line, only command operator suggestions will work. You need to first type some operator (for example, This extension also provides hover hints: if you hover your mouse over a variable, function or field name, the extension will show its information.
Upload/Download using HastebinThe upload function uploads the currently opened file and copies the resulting URL to clipboard. The download function downloads the script from the URL currently stored in the user's clipboard and opens it in a new tab of the editor. They can be accessed through Command Palette (Ctrl+Shift+P) by searching for 'Upload script' and 'Download script'. Keyboard shortcuts are also available: Namespace Import / UpdateWhen calling 'Upload script' with a .nms file open, the extension will automatically generate script for namespace import. This script sets up your namespace from scratch, defining everything you need, and possibly running an initialisation function (optionally included as The script defines all variables, functions and classes (as well as their members) present in the namespace. It then searches the workspace folder for .msc files corresponding to the functions present in the namespace. These files should be put in a folder with the same name as the namespace. Custom methods should be put in a subfolder with the type name inside the namespace folder. An example folder structure is shown in the image below. The import script generated must be applied as an interact script to a block. It automatically removes itself after execution. Be careful: the namespace import script automatically removes everything contained in the namespace at the start of its execution. Only execute it if you already have the full namespace definition in your namespace file, and all your functions are backed up. You can also update a namespace using the 'Update namespace' command. This only imports scripts, sets variables, and runs the namespace initialisation function, without removing and redefining the namespace. Custom Namespace Files (.nms)You can make a custom namespace file for your namespace to get code completion. Extension automatically scans currently opened folder for .nms files and updates them on save. You'll have to open folder (File -> Open Folder) to use them. The format is as following (documentation is optional, and consists of one or multiple lines of comments directly above variable, function, field, method, or class definition. It will be shown in code completion suggestions):
Note that any use of variables and classes in .nms file has to include the namespace. For example, the Release Notes3.0.0Added command completion, error highlighting, automatic formatting, and improved autofill. 2.1.0Added namespace upload. 2.0.0Added code completion, signature help, hover help, custom namespaces. 1.1.0Added code snippets. 1.0.0Initial release of Minr Scripts Extension. |