Skip to content

Latest commit

 

History

History

vscode

VSCode Language Support for Brat

This is a VS Code extension providing syntax highlighting and a language server for Brat.

Development

Developing the extension requires Node.js and VSCode Insiders. Run

> cd brat  # Go to root of the repo
> cd vscode
> npm install
> npm run compile

The intitial extension structure was generated by Yeoman using the VS Code Extension Generator. To reproduce, install using npm install -g yo generator-code and then run

yo code

# ? What type of extension do you want to create? New Language Support
# ? URL or file to import, or none for new: LEAVE BLANK
# ? What's the name of your extension? brat
# ? What's the identifier of your extension? brat
# ? What's the description of your extension? Brat language support
# ? Language id: brat
# ? Language name: Brat
# ? File extensions: .brat
# ? Scope names: source.brat
# ? Initialize a git repository? n
# ? Do you want to open the new folder with Visual Studio Code? Skip

Building

To build the extension, run

> cd brat  # Go to root of the repo
> cd vscode
> npm run publish

which will generate a file brat.vsix in brat/vscode

Installation

To install, run

> code --install-extension brat.vsix

If code is not found, open the Command Palette in VSCode by pressing Cmd + Shift + P and type shell command to find and run Install 'code' command in PATH.

For the LSP to work, the lsp-brat binary must be available. The default location, to which stack install will install, is ~/.local/bin. If you want to use the binary from a different location, you have to update the Lsp Path property in the extension settings inside VSCode.