gmlarumbe / vhdl-ts-mode

Emacs VHDL Tree-sitter Major-mode
GNU General Public License v3.0
7 stars 5 forks source link

MELPA MELPA Stable Build Status Build Status Build Status

vhdl-ts-mode.el - VHDL Tree-sitter mode for Emacs

The package vhdl-ts-mode provides syntax highlighting, indentation, imenu, which-func, navigation and basic beautify and completion features.

vhdl-ts-mode is derived from vhdl-mode making beautify and other utilities still available.

Requirements

Before installing/building Emacs make sure that tree-sitter is available:

If Emacs has been built with tree-sitter support the following command should return t:

(treesit-available-p)

Installation

MELPA

vhdl-ts-mode is available on MELPA.

straight.el

To install it via straight with use-package:

(straight-use-package 'use-package)
(use-package vhdl-ts-mode)

Tree-sitter grammar

The package provides an interactive command to simplify the installation of the grammar:

This command requires Git, a C compiler and (sometimes) a C++ compiler, and the linker to be installed and on the PATH.

Setup

To open VHDL files with vhdl-ts-mode simply add this line to your init file:

(add-to-list 'auto-mode-alist '("\\.vhdl?\\'" . vhdl-ts-mode))

Syntax highlighting

To change the faces default values there are two methods:

Contributing

Contributions are welcome! Just stick to common Elisp conventions and run the ERT suite after testing your changes and before submitting a new PR.

For new functionality add new ERT tests if possible.

Consider sponsoring to help maintaining the project and for the development of new features. Thank you!

Setup

To run the whole ERT test suite change directory to the vhdl-ts-mode root and make sure test-hdl Git submodule has been loaded:

git submodule update --init

Targets

Then run the default target:

$ make

To run a subset of tests (e.g. navigation):

$ make TESTS=navigation

To regenerate all the expected outputs for the tests:

$ make gen

To regenerate the expected outputs for a group of tests (e.g. navigation):

$ make gen TESTS=navigation

Other Emacs packages