You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This project contains syntax definitions for Minecraft commands (`.mcfunction`) using the textmate grammer spec. It is a general, feature complete language spec built via generic syntatical components that describe the language (aka, mimimal hardcoded command support). This means it should support future game versions, many modded commands, and even custom language compilers such as [bolt](https://github.com/mcbeet/bolt) and [jmc](https://jmc.wingedseal.com/).
14
14
15
-
The aim of this syntax definition is to provide a general, feature complete language spec for Minecraft commands. It is **not** geared towards error checking or the specific commands and specifically contains **zero** error highlighting, allowing for decent highlighting of invalid or custom pre-processed command scripts.
16
-
17
-
## TODOs
18
-
19
-
-[x] Add explicit macro support
20
-
-[x] Fix issues with nbt and other suffixes on numbrs
21
-
-[x] Fix issues on resource names versus keywords
22
-
-[ ] Add tests for Bedrock
23
-
-[ ] (VSCode & Sublime) Add jsonschema file for `pack.mcmeta`
24
-
-[-] Compare w/ `language-mcfunction` to synchronize scope names
25
-
- Likely won't get better than this tbh, will need feedback
15
+
> [!Warning]
16
+
> This syntax does **not** contain any error highlighting meaning invalid commands will highlight correctly. If you are looking error validation and auto-complete for vanilla commands, we recommend the [Spyglass](https://spyglassmc.com/) project for a language-server that builds upon this simple grammar!
Install the extension from the [marketplace](https://marketplace.visualstudio.com/items?itemName=MinecraftCommands.syntax-mcfunction) or by searching for `syntax-mcfunction` in the extensions tab.
Follow these [instructions](https://github.com/eclipse/openvsx/wiki/Using-Open-VSX-in-VS-Code) if you are looking on using the open-vsix version of this project in VSCode or any of it's forks.
27
+
33
28
### Sublime Text
34
29
35
30
It is recommended you use [Package Control](https://packagecontrol.io/) to manage the package:
@@ -49,6 +44,22 @@ This will keep the package updated with the repository automatically.
49
44
50
45
Otherwise you can clone the repository into user packages (e.g. `%appdata%\Sublime Text 3\Packages`) and update it manually.
51
46
47
+
## `language-mcfunction`
48
+
49
+
While this grammar was created from scratch, much of it's work was adapted from the original [`language-mcfunction`](https://github.com/arcensoth/language-mcfunction) grammar. One of the original ideas for `language-mcfunction` was to develop a general, simpler version for `mcfunction`.
50
+
51
+
> [!Note]
52
+
> Actually, an earlier prototype of this grammar was going to be used as a base for a `language-mcfunction` rewrite.
53
+
54
+
There are some key differences to note between this syntax and the original:
55
+
-`language-mcfunction` is designed to operate on singular lines. If one line is broken, it does not affect lines after it and commands **cannot** span across multiple lines at all.
56
+
- This was the core issue that caused me to develop `syntax-mcfunction` (even before Minecraft 1.20.2 introduced multi-line commands) as I needed a grammar that had multi-line support.
57
+
-`language-mcfunction` contains specific commands validation and reports errors for invalid commands
58
+
-`syntax-mcfunction` differs in philosophy here. Textmate grammars are not well-equipped to actually validate commands — that's more of a role for language servers.
59
+
- This project also generally highlights commands as it allows for easier maintenance and is better for platforms such as Github where multiple command extensions / modded commands might reuse the `.mcfunction` extension.
60
+
61
+
Due to these, coloring and highlighting will vary in a couple of places when comparing these grammars. While the goal is to match `language-mcfunction` as close as possible, there will never be a true 1:1 match in highlighting as the entire design of the grammar differs.
62
+
52
63
## Contributing
53
64
54
65
We are happy to accept any PRs just make sure to make a cooresponding issue first to track it. When making a PR, make sure the branch of your fork is **not**`main` and also make sure maintainers are allowed to edit your PR. This is helpful for me making small edits to the PR before merging.
@@ -59,6 +70,19 @@ We only require edits to the `yaml` file as the `json` and `plist` files are gen
Releases are semi-automated in this repo. Once your PR is merged into the `main` branch, the maintainer will create a new tag to trigger our Github CI to produce a new version.
76
+
77
+
```bash
78
+
git tag -a v1.2.3
79
+
git push --tags
80
+
```
81
+
82
+
This will generate the json and plist variations of the grammar, create and push a `.vsix` extension to the VSCode and open-vsix marketplaces, and create a release in the [releases](https://github.com/MinecraftCommands/syntax-mcfunction/releases) tab.
83
+
84
+
The maintainer will then need to manually fill in the body of the release to add in the changelog and links.
85
+
62
86
## Acknowledgements
63
87
64
88
This repo is entirely dedicated to our beloved community member and friend, [Arcensoth](https://github.com/Arcensoth). His work on the original [language-mcfunction](https://github.com/Arcensoth/language-mcfunction) and overall contributions to the Minecraft Commands community was invaluable and he will be missed.
0 commit comments