A VS Code extension for previewing tmLanguage grammar files. Created with Reactive VS Code.
There is also a online version: tmLanguage Playground.
- Open a
.tmLanguage.jsonfile in VSCode. For example,xyz.tmLanguage.json. - Create a new file with the same name but with a
.exampleinfix. For example,xyz.example.any. - Click the icon on the top right of the editor to open the previewer.
package.json- this is the manifest file in which you declare your extension and command.src/*- this is the folder containing the webview code. (DOM environment)extension/*- this is the folder containing the extension code. (Node.js environment)
- Run
pnpm installto install all necessary dependencies. - Run
pnpm devin a terminal to compile the extension. - Press
F5to open a new window with your extension loaded.
- You can relaunch the extension from the debug toolbar after changing code in
src/extension.ts. - You can also reload (
Ctrl+RorCmd+Ron Mac) the VS Code window with your extension to load your changes.