You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Syntax highlighting support for Haskell and associated languages (e.g. Cabal, Happy and Alex) in Visual Studio Code.
Syntax highlighting
Adds syntax highlighting support for Haskell (.hs and .lhs). This is a (now heavily) modified version of
the syntax file from the Haskell TextMate bundle.
Additionally there is support for Cabal files (.cabal) via a concoction of my own.
Also adds automatic indentation after where, do, -> etc. and surrounding brackets ([], {} etc)
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.
Theme authors
I recently realized that I am woefully unaware of whether there are any themes with Haskell-specific
rules and how changes to this extension affect such themes. If you are a theme author that wishes to
use Haskell specific rules, or are aware of a theme with Haskell specific rules, feel free to get in
touch.
With version 3.0.0 some new tm scopes were added, such that now record and GADT definitions can be
distinguished. Let me know if there are any questions about the scope assignment in this
extension or if there are further scope assigments you'd like to see added.
We now publish an automatically generated, complete list of the textmate scopes
used in our grammars. You can find the lists of scopes in the
scope-lists directory.
Contributing
This project currently uses the YAML-tmLanguage format for language grammars (Haskell, Cabal, alex, happy, ...).
The grammars 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):