.vscode/
contains files for VSCode development.launch.json
defines launch tasks for debugging.settings.json
defines 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.yaml
is the version-agnostic grammar, in a custom format.version-specific-base.yaml
is the base grammar, common to all version-specific grammars.
cli.ts
is the entry point for the grammar generator's command-line interface.command-manifest.ts
defines data structures for the server-generatedcommands.json
.language-grammar.ts
defines data structures for various tmLanguage constructs.utils.ts
contains common utilities.version-specific.ts
contains the bulk of the version-specific grammar generator.
tsconfig.json
is the configuration file for the TypeScript compiler.
tests/
contains all of the samplemcfunction
files for testing. It is recommend that you add to the tests when fixing bugs or adding new features..vscodeignore
lists the files/folders that need not be packaged with the extension. Everything inlib
andtests
is already listed here, but if you add new files elsewhere you should consider listing them in this file.CHANGELOG.md
lists changes from version to version, via the Keep a Changelog format.CONTRIBUTING.md
describes itself in one sentence.icon.png
is the extension icon.language-configuration.json
defines the language configuration for the VSCode extension.LICENSE
contains 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.tmPreferences
basically just defines comment formatting for SublimeText and other editors that support the tmLanguage format.package-lock.json
is a file generated by npm. No need to touch this one.package.json
defines 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.md
describes 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 install
to 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
F5
to launch an extension development host for debugging. - Make changes in your main VSCode development window.
- Compile the grammars.
- Press
Ctrl+R
in 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
mcfunction
files 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 generate-grammars
Providing two additional arguments: (1) a directory (the server-generated data folder) and (2) a version label; will cause the script to instead generate a version-specific grammar based on version-specific-base.yaml
:
npm run generate-grammars ./generated 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.
- We usually bump the
version
inpackage.json
alongside the first change after any given release.