An official highlighter schema for the Skript language.
This repository contains the details for publishing individual editor plugins (e.g. skript-vscode
and skript-atom
) as well as a single source.cson
file that is used by all of these.
The source file is designed to be automatically converted to all editor styles, so that any updates require changing only one copy rather than several.
We use an automatic process
- to make sure all highlighters have reliable, matching output
- to reduce the amount of work needed to maintain everything
- to prevent accidental errors
This project uses node.js
. Individual editor builds and deployments may require special packages installed (as well as the editor itself, of course.)
To build changes to the source.cson
file, use npm run build
.
This will update the respective source file for each editor.
To publish changes, use npm run publish <version>
.
This may require additional configuration, e.g. providing git credentials.
Publishing is a dangerous action and should be taken with care.
Each editor can be tested individually. The highlighter file will need to be rebuilt from source first.
$ npm run build
A sample test.sk
file is provided, which contains all of the example scripts provided with the Skript plugin.
If a new feature is not displayed or tested within this file, an example should be added to the bottom of the test.sk
file with a clear comment above it explaining what the feature is and, if necessary, what it should look like.
- Open VS Code in
skript-grammar/syntax-vscode
directory.
$ code .
- Press F5 or
Run > Start Debugging
.
- Install VSCE.
- Navigate to the
skript-grammar/syntax-vscode
directory.
$ cd skript-grammar/syntax-vscode
- Package the files for VS Code using VSCE and follow up with the process.
$ vsce package
- Install the extension (replace 1.x.x with the correct numbers from the output file).
$ code --install-extension ./skript-grammar-1.x.x.vsix
- Relaunch VS Code or Ctrl+Shift+P and choose
reload window
. - Open the
test.sk
example file.
- Navigate to the
skript-grammar/syntax-atom
directory.
$ cd skript-grammar/syntax-atom
- Link this package with your Atom editor in DEV mode.
$ apm link --dev
- Open the atom editor and navigate to
View > Developer > Open in Dev Mode...
- Open the
test.sk
example file.
Once the file is opened in developer mode, the window can be reloaded to visualise changes (after rebuilding the language file.)