Skip to content

TextMate-style grammar for syntax highlighting of Bluespec BH/Classic

License

Notifications You must be signed in to change notification settings

B-Lang-org/language-bh

Repository files navigation

Bluespec Classic Highlighting Support

This mode adapts the Haskell textmate grammar to Bluespec Classic to provide Bluespec Classic syntax highlighting in Visual Studio Code.

The extension is derived from https://github.com/JustusAdam/language-haskell

Syntax highlighting

Adds syntax highlighting support for Bluespec Classic (.bs). Also adds automatic indentation after where, do, -> etc. and surrounding brackets ([], {} etc)

Screenshot Bluespec Classic

Bugs

If you happen to notice bugs or have suggestions for improvements visit the issue section of the repository.

Themes

This extension provides TextMate scopes for use in syntax highlighting, but the colours displayed depend on the theme being used. Unfortunately many themes have incomplete support for the different TextMate scopes, and as a result different tokens can end up with identical colours.

For a theme that supports all the scopes provided by this extension, see the Groovy Lambda theme.

Contributing

This project currently uses the YAML-tmLanguage format for language grammar. The grammar can be found in the syntaxes directory. To generate JSON grammars (which is the format VS Code expects), we use the Node package js-yaml (requires npx in PATH):

npx js-yaml bh.YAML-tmLanguage > bh.json

For testing, we use the Node package vscode-tmgrammar-test.

To run the test-suite, simply call make test. This will build the grammar files and run vscode-tmgrammar-test on all the files in the testsuite.

Local installation

First, install the JavaScript dependencies with

npm ci

To build the syntax rules and create the VSCode extension package, run

make
npm run package

Finally, you can install it either from the GUI or from the command line by running

code --install-extension ./language-bh-*.vsix

and then restarting VSCode.

To run the test suite, simply call make test. This can be called on a clean repository, as it does not require the package to be built. It only needs the grammar files, which will be compiled if necessary. It then runs vscode-tmgrammar-test (installing the package in npx if necessary) on all the files in the test suite.

About

TextMate-style grammar for syntax highlighting of Bluespec BH/Classic

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages