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

dramforever/vscode-ghc-simple: Simple GHC (Haskell) integration for VSCode

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

开源软件名称(OpenSource Name):

dramforever/vscode-ghc-simple

开源软件地址(OpenSource Url):

https://github.com/dramforever/vscode-ghc-simple

开源编程语言(OpenSource Language):

TypeScript 99.7%

开源软件介绍(OpenSource Introduction):

Simple GHC (Haskell) Integration for VSCode

Icon

Simple Haskell support using only GHCi.

(Icon derived from logo on http://haskell.org/.)

Shiny badges

vscode-ghc-simple on Visual Studio Marketplace CI

Related and recommended extensions

  • Haskutil provides Quick Fix actions for tasks like missing/redundant imports that GHC reports. It works with this extension by reading the diagnostics it produces.

Installation

Get vscode-ghc-simple from the Visual Studio Marketplace or run the following in Quick Open:

ext install dramforever.vscode-ghc-simple

Alternatively, if you want the latest and greatest, you can download vsix files from GitHub Actions. Pick the latest build, and check out the 'Artifacts' section.

What?

This VSCode extension provides editing enhancements for Haskell development.

Currently implemented features:

  1. Diagnostics: Basic squiggles and error messages. Automatic re-checking on save.

    Squiggle demo screenshot

  2. Completion: Crude completion with GHCi's :complete command, with :info and :doc lookup. Works okay with imported and top level identifiers.

    Completion demo screenshot

  3. Hover: Hover to see :info and :doc lookup.

    Completion demo screenshot

  4. Type: View types by selecting in the code. The minimal expression covering the selection will have its type shown. Implemented with :all-types.

    Range type demo screenshot

  5. Inline REPL: Add REPL blocks to your code with haddock syntax, either using no spaces before >>> or put it in a comment like -- >>>. Click on the code lens or type Shift+Enter to run a single block, or type Shift+Alt+Enter to run all blocks in a file.

    Inline REPL demo screenshot

    If the first line of a block begins with :set, it also applies to loading dependency modules. One use is to override -fbyte-code or -fobject-code settings.

  6. Definition and usages: See definitions amd references of identifiers. Supports both module level and local identifiers. Implemented with :loc-at and uses. Does not yet support identifiers imported from packages.

    Definition demo screenshot

Why?

Since around GHC 8, the compiler GHC and its interactive REPL GHCi has gained various tooling-related features. These allow for more tooling that communicate with the compiler using text IO and files, instead of a Haskell API. This project aims to explore the possibilities provided by said features, by implementing Haskell tooling within the editor VSCode.

Basic usage

Install the extension from the marketplace or using the Quick Open command ext install dramforever.vscode-ghc-simple. Open individual Haskell source files or projects, and vscode-ghc-simple will try to use the appropriate way to start a GHCi session and communicate with it to provide editor tooling.

Use an hie.yaml or the extension configuration to tweak vscode-ghc-simple's behavior. Check out the wiki page Project Configuration for more.

Checking the logs

The full log of interaction between GHCi and this extension can be found by clicking the 'GHC' item on the status bar:

Status bar item 'GHC'

When reporting an issue please also attach relevant log output, ideally (but not necessarily) from a fresh start (Developer: Reload Window command) to reproduction of the bug. You can also check there when things go unexpectedly.

Wiki

For the FAQ and more on configuring your project, configuring the extension, etc., please check out the wiki page on GitHub.




鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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