Skip to content

bfgroup/b2-vscode

 
 

Repository files navigation

b2-vscode

This extension provides support for B2 build system in Visual Studio Code.

screenshot

The main, and currently only, feature of this extension is coloring of the Boost.Jam language. Which is an extension of the Perforce Jam language. Boost.Jam is an interpreted language implemented by B2 engine, b2, which loads the Jam code that implements the build system.

Features

  • Syntax highlighting
  • Code comments

Although the process of writing a TextMate language grammar remains poorly documented, this is a brave first attempt to provide a minimal usable support for Boost.Jam. By no means, it is free from bugs or covers all elements of Boost.Jam language. Non-trivial TextMate grammars for Visual Studio Code count from 500 to 5000 lines of code, and this one less than 200.

Installation

Acknowledgements

Development

The main part of the extension is the bjam.tmLanguage.json file. This file contains language grammar for Boost.Jam syntax highlighting. The file was written from scratch and not converted from any existing TextMate grammar.

If you want to offer a fix or improvement, awesome!

Please improve the file and create a pull request against this git repository.

All contributions are welcome!

Testing

There are no automated tests provided. There is just test/colorize-fixtures/test.jam file provided, but without company of test/colorize-results/test_jam.json file. In fact, I have no idea how such tests should be implemented.

Instead, install or run the extension and open test/colorize-fixtures/test.jam file. Look what you see and compare it with what you would prefer to see. Then, hopefully, happy hacking in attempt to correct the language grammar :-)

Running and debugging your extension explains in details how to run the extension for convenient development and testing. In short:

  1. Open b2-vscode folder in VSCode and hit F5 to start debugging.
  2. New (preview) window appears with the extension loaded, in it, open the test.jam or your own Jamfile.
  3. Edit the grammar file in the parent window.
  4. Reload the debugging (preview) window with CTRL+R
  5. Observe result, modify the test.jam.
  6. Iterate over steps from 3 to 5

Publishing

(by original author)

Follow the official guide on [Publishing Extension(https://code.visualstudio.com/api/working-with-extensions/publishing-extension) to VS Code Extension Marketplace.

License

MIT

Enjoy!

Releases

No releases published

Packages

 
 
 

Contributors