catala/syntax_highlighting
Denis Merigoux 5adfb0d9ae
Fix annoying highlighting problem
About variables starting with "an" or "ou" in French.
Should be replicated in other languages.
2023-08-07 14:59:52 +02:00
..
emacs French syntax: replace 'sortie' with 'résultat' 2022-12-13 12:27:33 +01:00
en Embed the Pygments Catala lexer 2023-03-13 14:41:24 +01:00
fr Fix annoying highlighting problem 2023-08-07 14:59:52 +02:00
gnu_gedit Remove chinese language support as it is not yet supported by the compiler 2022-09-20 10:44:46 +02:00
pl Embed the Pygments Catala lexer 2023-03-13 14:41:24 +01:00
dune Add a (very simple) syntax highlighting mode for Emacs 2022-05-13 17:42:03 +02:00
README.md Refactor Python dependency handling 2023-03-02 16:24:53 +01:00

Syntax highlighting

The Catala language also comes with syntax highlighting to ease program development. The syntax highlighting is done, among other techniques, with the Iro compiler that allows writing the syntax only once, and then export it to formats understood by various IDE.

DISCLAIMER:

The maintenance of the various syntax highlighting plugins is BEST-EFFORT. Indeed many of the plugins were developed by the community and their creators did not commit to long-term maintenance.

Atom

To get Catala syntax highlighting in Atom, simply enter from the root of the repository, depending on the language you want to use :

make atom_fr

or

make atom_en

You can now reload Atom and check that you have syntax highlighting on any .catala file.

VSCode

To get Catala syntax highlighting in VSCode, simply enter from the root of the repository, depending on the language you want to use :

make vscode_fr

or

make vscode_en

You can now reload VSCode and check that you have syntax highlighting on any .catala file.

Pygments

Pygments is a Python-based versatile lexer for various programming languages. To use a version of Pygments augmented with the Catala plugin, simply enter from the root of the repository

make pygments

This will setup a Python virtual environment ("venv"), and install the syntax highlighting plugins that allow Pygments to handle Catala files. Those are defined in syntax_highlighting/XX/pygments/.

Pygments is used for instance by the minted LaTeX package. To make sure it is available, you need to "activate" the python venv each time using:

. _python_venv/bin/activate

GNU gedit

Copy the file catala.lang to the directory below (create if it does not exist) and then restart GEdit.

~/.local/share/gtksourceview-4/language-specs