forked from Bard-Gaming/Minecraft-Script
-
Notifications
You must be signed in to change notification settings - Fork 0
Enhance contributor documentation and VS Code extension setup #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,5 +14,6 @@ dist/ | |
| build_test/ | ||
| highlighter/node_modules/ | ||
| highlighter/dist/ | ||
| highlighter/*.vsix | ||
| npm/node_modules/ | ||
| npm/*.tgz | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| * | ||
| **/* | ||
|
|
||
| !dist/*.js | ||
| !syntaxes/ | ||
| !syntaxes/** | ||
| !language-configuration.json | ||
| !package.json | ||
| !README.md | ||
| !CHANGELOG.md | ||
| !LICENSE | ||
| !icon.png | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| # Change Log | ||
|
|
||
| All notable changes to the Minecraft Script Language Support extension are documented here. | ||
|
|
||
| ## [0.0.1] - 2026-06-07 | ||
|
|
||
| ### Added | ||
|
|
||
| - Syntax highlighting for Minecraft Script (`.mcs`) files | ||
| - Hover documentation for keywords, built-in functions, text components, and target selectors | ||
| - Command linting, completion, and hover inside literal `command("...")` and `command('...')` strings via Spyglass | ||
| - Configurable Minecraft version for command validation (`mcsHighlighter.minecraftVersion`) | ||
| - Commands: **Minecraft Script: Select Command Lint Version** and **Minecraft Script: Show Output** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| MIT License | ||
|
|
||
| Copyright (c) Minecraft Script contributors | ||
|
|
||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
|
|
||
| The above copyright notice and this permission notice shall be included in all | ||
| copies or substantial portions of the Software. | ||
|
|
||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| SOFTWARE. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,28 +1,48 @@ | ||
| # Minecraft Script Highlighter | ||
| # Minecraft Script Language Support | ||
|
|
||
| VS Code language support for Minecraft Script `.mcs` files. | ||
| Language support for [Minecraft Script](https://github.com/SpyC0der77/Minecraft-Script) `.mcs` files in VS Code. | ||
|
|
||
| ## Try It Locally | ||
| ## Features | ||
|
|
||
| 1. Open the `highlighter/` folder in VS Code. | ||
| 2. Run `bun install` if you have not already. | ||
| 3. Press `F5` to build and launch an Extension Development Host. | ||
| 4. Open a `.mcs` file in the Extension Development Host. | ||
| - **Syntax highlighting** for MCS keywords, selectors, resource locations, built-in helpers, text components, and `command()` strings | ||
| - **Hover help** for keywords, built-in functions, text component methods, and target selectors (`@a`, `@s`, …) | ||
| - **Command linting and completion** inside literal `command("...")` and `command('...')` calls via [Spyglass](https://github.com/SpyglassMC/Spyglass) | ||
| - **Version picker** for command validation across supported Minecraft releases | ||
|
|
||
| ## Commands | ||
|
|
||
| If command linting fails, open the **Minecraft Script** output channel: in the Output panel, use the dropdown on the right (it may say "Tasks") and select **Minecraft Script**. You can also run **Minecraft Script: Show Output** from the command palette. The first run downloads Minecraft command data from the network. | ||
| | Command | Description | | ||
| | --- | --- | | ||
| | **Minecraft Script: Select Command Lint Version** | Choose the Minecraft version Spyglass uses for command validation | | ||
| | **Minecraft Script: Show Output** | Open the Minecraft Script output channel (useful if linting fails on first run) | | ||
|
|
||
| The grammar highlights Minecraft Script-specific syntax such as `set`, `on`, selector-prefixed calls, event bindings, built-in helpers, text component chains, Minecraft resource locations, and `command()` strings. It still includes VS Code's JavaScript grammar as a fallback for JavaScript-like expressions. | ||
| ## Settings | ||
|
|
||
| Hover over keywords, built-in functions, text component methods (`.text()`, `.color()`, etc.), and target selectors (`@a`, `@s`, ...) to see TypeScript-style syntax help. | ||
| | Setting | Default | Description | | ||
| | --- | --- | --- | | ||
| | `mcsHighlighter.minecraftVersion` | `1.21.2` | Minecraft version used when linting literal `command()` strings | | ||
|
|
||
| The small command-name keyword list used inside `command()` strings targets the default `1.21.2` lint version. Full command validation comes from Spyglass and follows the version selected with `Minecraft Script: Select Command Lint Version`. | ||
| The first lint run downloads Minecraft command data from the network. Dynamic commands such as `command(myVar)` are skipped because their final text is not known in the editor. | ||
|
|
||
| ## Spyglass | ||
|
|
||
| This extension uses Spyglass only for Minecraft command linting inside literal `command("...")` and `command('...')` calls. It does not register `.mcs` files as `.mcfunction`, and it does not enable Spyglass diagnostics across the whole MCS document. | ||
| This extension uses Spyglass only for Minecraft command linting inside literal `command()` strings. It does not register `.mcs` files as `.mcfunction`, and it does not enable Spyglass diagnostics across the whole MCS document. | ||
|
|
||
| Spyglass is MIT licensed: [SpyglassMC/Spyglass](https://github.com/SpyglassMC/Spyglass). | ||
|
|
||
| ## Development | ||
|
|
||
| To work on the extension locally: | ||
|
|
||
| 1. Open the `highlighter/` folder in VS Code. | ||
| 2. Run `bun install`. | ||
| 3. Run `bun run build` (or press `F5` to build and launch an Extension Development Host). | ||
| 4. Open a `.mcs` file in the Extension Development Host. | ||
|
|
||
| Dynamic command values such as `command(cmd)` are skipped because their final command text is not available to the editor. | ||
| To package a `.vsix` without publishing: | ||
|
|
||
| Use the `Minecraft Script: Select Command Lint Version` command from the VS Code command menu to choose the Minecraft version used by Spyglass. The command updates `mcsHighlighter.minecraftVersion` and re-lints open `.mcs` files. | ||
| ```commandline | ||
| bun run package | ||
| ``` | ||
|
|
||
| Spyglass is MIT licensed and available at [SpyglassMC/Spyglass](https://github.com/SpyglassMC/Spyglass). See `../spyglass/LICENSE` for the original license text and copyright notice. | ||
| See [contributors.md](../contributors.md) for the full Marketplace publishing flow. |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.