• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

JustusAdam/language-haskell: Highlighting support for the Haskell language in vi ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

JustusAdam/language-haskell

开源软件地址(OpenSource Url):

https://github.com/JustusAdam/language-haskell

开源编程语言(OpenSource Language):

Haskell 94.3%

开源软件介绍(OpenSource Introduction):

Haskell Syntax Highlighting Support

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)

Screenshot Haskell

Screenshot Cabal

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):

npx js-yaml haskell.YAML-tmLanguage > haskell.json

For testing, we use the Node package vscode-tmgrammar-test. For instance, to generate/check the scopes of a Haskell source file, run:

npx vscode-tmgrammar-test "-s" "source.haskell" "-g" "syntaxes/haskell.json" "-t" "myTestFile.hs"

To run the test-suite, simply call make test. This will build the grammar files and run vscode-tmgrammar-test on all the files in the testsuite.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
tweag/ormolu: A formatter for Haskell source code发布时间:2022-06-22
下一篇:
tweag/sparkle: Haskell on Apache Spark.发布时间:2022-06-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap