.vscode/contains files for VSCode development.launch.jsondefines launch tasks for debugging.settings.jsondefines project-level settings.
grammars/contains generated grammars. Do not modify these files by-hand; they will be over-written.icons/contains file icons and the original extension icon SVG. The file icons are not currently used by the extension due to limitations with the VSCode theming API.lib/contains all of the interesting stuff, and most of what you'll probably care about.out/is where compiled output typically goes. You can safely ignore folders like this.src/contains all of the library TypeScript source code to be compiled into JavaScript.grammars/contains grammar stubs used as a basis for generated grammars.version-agnostic.yamlis the version-agnostic grammar, in a custom format.version-specific-base.yamlis the base grammar, common to all version-specific grammars.
cli.tsis the entry point for the grammar generator's command-line interface.command-manifest.tsdefines data structures for the server-generatedcommands.json.language-grammar.tsdefines data structures for various tmLanguage constructs.utils.tscontains common utilities.version-specific.tscontains the bulk of the version-specific grammar generator.
tsconfig.jsonis the configuration file for the TypeScript compiler.
tests/contains all of the samplemcfunctionfiles for testing. It is recommend that you add to the tests when fixing bugs or adding new features..vscodeignorelists the files/folders that need not be packaged with the extension. Everything inlibandtestsis already listed here, but if you add new files elsewhere you should consider listing them in this file.CHANGELOG.mdlists changes from version to version, via the Keep a Changelog format.CONTRIBUTING.mddescribes itself in one sentence.icon.pngis the extension icon.language-configuration.jsondefines the language configuration for the VSCode extension.LICENSEcontains the license in plain-text.mcfunction.tmLanguage(.json|.yaml)are generated files that exist in the project root to support other editors like SublimeText, without further configuration.mcfunction.tmPreferencesbasically just defines comment formatting for SublimeText and other editors that support the tmLanguage format.package-lock.jsonis a file generated by npm. No need to touch this one.package.jsondefines the package attributes, such as name, version, and dependencies. Generally you shouldn't need to change this unless you're adding a new feature or language definition.README.mddescribes the project and extension in detail.
- Make sure you have Node.js and npm installed and ready to go.
- Clone a copy of the project to your development environment.
- Change into the project directory and run
npm installto install dependencies. - Attempt to debug the extension to ensure you have things in working order.
- Otherwise, feel free to post an issue and we'll do our best to help.
We recommend using VSCode to develop and test the VSCode extension. Otherwise you're welcome to use whichever editor you prefer. In any case, please do your best to follow the style guide.
- Press
F5to launch an extension development host for debugging. - Make changes in your main VSCode development window.
- Compile the grammars.
- Press
Ctrl+Rin the extension development host to reload the window and test your changes. - At the moment we are testing the syntax highlighter just by scanning over relevant
mcfunctionfiles intests/, but a more rigorous testing procedure may be implemented in the future.
The following command will both compile lib (from TypeScript into JavaScript) and run the cli script to generate the version-agnostic grammar from version-agnostic.yaml:
npm run cli build-grammar
Providing two additional arguments: (1) a directory (the server-generated data folder) and (2) a version label; will cause the script to instead build a data dump for a particular version of the game. This data can in turn be used to generate a version-specific grammar based on version-specific-base.yaml:
npm run cli build-data ./generated/ snapshot
npm run cli build-grammar snapshot
I recommend creating a symlink generated (pre-configured in .gitignore) in the repository root that points to the generated data folder of a recent Minecraft snapshot. This will make it easier to supply the grammar generator with a directory for the server-generated data.
- We use prettier to auto-format our TypeScript code.