All Projects → dramforever → Vscode Ghc Simple

dramforever / Vscode Ghc Simple

Licence: isc
Simple GHC (Haskell) integration for VSCode

Programming Languages

typescript
32286 projects
haskell
3896 projects

Projects that are alternatives of or similar to Vscode Ghc Simple

Vscode Journal
Lightweight journal and simple notes support for Visual Studio Code
Stars: ✭ 174 (-18.69%)
Mutual labels:  vscode-extension
Flutter preview
Flutter | Because a widget-driven development requires a widget-driven preview.
Stars: ✭ 197 (-7.94%)
Mutual labels:  vscode-extension
Abracadabra
Automated refactorings for VS Code (JS & TS) ✨ It's magic ✨
Stars: ✭ 204 (-4.67%)
Mutual labels:  vscode-extension
Vs Shell Format
the shellscript、Dockerfile、properties ...... format extension
Stars: ✭ 176 (-17.76%)
Mutual labels:  vscode-extension
Haskell Gi
Generate Haskell bindings for GObject-Introspection capable libraries
Stars: ✭ 190 (-11.21%)
Mutual labels:  ghc
Js Refactor
JS Refactoring tool for Visual Studio Code
Stars: ✭ 195 (-8.88%)
Mutual labels:  vscode-extension
Svn Scm
SVN support for VS Code
Stars: ✭ 172 (-19.63%)
Mutual labels:  vscode-extension
Svelte Vscode
Svelte language support for VS Code
Stars: ✭ 211 (-1.4%)
Mutual labels:  vscode-extension
Vscode Crystal Lang
Yet another VSCode extension for Crystal Programming Language
Stars: ✭ 192 (-10.28%)
Mutual labels:  vscode-extension
All Hies
Cached Haskell IDE Engine Nix builds for all GHC versions
Stars: ✭ 201 (-6.07%)
Mutual labels:  ghc
Vscode Jest
The optimal flow for Jest based testing in VS Code
Stars: ✭ 2,357 (+1001.4%)
Mutual labels:  vscode-extension
Vscode Kanban
Kanban board for Visual Studio Code.
Stars: ✭ 191 (-10.75%)
Mutual labels:  vscode-extension
Vscode Ltex
LTeX – Grammar/spell checker for VS Code with LanguageTool and LaTeX/Markdown support
Stars: ✭ 199 (-7.01%)
Mutual labels:  vscode-extension
Vscode Ocaml
An extension for VS Code which provides support for the OCaml language.
Stars: ✭ 175 (-18.22%)
Mutual labels:  vscode-extension
Vscode Notion
Browse Notion pages right inside Visual Studio Code.
Stars: ✭ 204 (-4.67%)
Mutual labels:  vscode-extension
Waypoint
📍 VSCode extension for navigating JS codebases
Stars: ✭ 174 (-18.69%)
Mutual labels:  vscode-extension
Vscode Remote Workspace
Multi protocol support for handling remote files like local ones in Visual Studio Code.
Stars: ✭ 197 (-7.94%)
Mutual labels:  vscode-extension
Code Blue
A carefully concocted dark theme made of subtle blues and bright hues that’s easy on the eyes for focused coding.
Stars: ✭ 215 (+0.47%)
Mutual labels:  vscode-extension
Vs Picgo
A VSCode plugin of PicGo
Stars: ✭ 209 (-2.34%)
Mutual labels:  vscode-extension
Metals Vscode
Visual Studio Code extension for Metals
Stars: ✭ 200 (-6.54%)
Mutual labels:  vscode-extension

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' tab.

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.

Usage

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 auto-detect the appropriate way to start a GHCi and communicate with it to provide editor tooling. Configuration options can be used to tweak the (see below).

Please note that projects should be opened so that the top-level configuration file (stack.yaml or *.cabal) is at the workspace root. This way the extension can detect the project.

Also note that when the project configuration is changed, the Restart GHCi sessions command needs to be issued manually for changes to take place. Again, see below.

Debugging/issues

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.

Commands

  • vscode-ghc-simple.restart: Restart GHCi sessions

    vscode-ghc-simple currently lacks a way of detecting changes of critical configuration files such as stack.yaml or *.cabal. Run this command whenever, had you been running GHCi manually, you would restart it.

Configuration options

  • ghcSimple.feature.*: Feature switches

    Some users might want only a subset of the features provided in vscode-ghc-simple. These options can be used to disabled unneeded features.

  • ghcSimple.filterInfo: Shorten :info output

    GHCi's :info writes instance information, which is usually excessively long and not useful for a quick look. With this option, these are filtered out. Enabled by default.

  • ghcSimple.workspaceType: This option is deprecated. See ghcSimple.replCommand and ghcSimple.replScope.

  • ghcSimple.replCommand: The command used to start GHCi.

    Configure this to change the command used to start GHCi. $stack_ide_targets will be replaced by the output of stack ide targets. Leave blank for auto detection. When set, overrides the deprecated ghcSimple.workspaceType. If you set this, please also set ghcSimple.replScope to an appropriate value.

  • ghcSimple.replScope: The scope of each GHCi session

    Whether GHCi should be started for a project or individual files. Note: This option has no effect when ghcSimple.replCommand is set to empty string for auto detection.

  • ghcSimple.startupCommands.*: GHCi Startup commands

    Commands to run at GHCi startup. Configures some common options.

    Two of the command lists are semantically meant to configure GHCi for use by vscode-ghc-simple:

    • all: Commands for all workspaces
    • bare: Commands for standalone files (bare workspaces)

    If you need to add more commands, it's suggested that you do so using the following command list, so that the previous to can be updated as needed in newer versions of vscode-ghc-simple:

    • custom: Custom commands for all workspaces

    Change the options in workspace settings instead of user settings if you want to apply the settings to a workspace locally.

  • ghcSimple.maxCompletions: Maximum number of completion items to show.

  • ghcSimple.inlineRepl.codeLens: Show code lens for GHCi REPL blocks

    Disable this if you don't like 'Run in GHCi' code lens littered around your files. If you disable the inline repl feature using ghcSimple.feature.inlineRepl you will also not see code lens.

  • ghcSimple.inlineRepl.loadType: -fbyte-code or -fobject-code for REPL

    Whether to load modules with -fbyte-code or -fobject-code when using the REPL. The former is the default as it loads faster. The latter runs faster and can use FFI. Write :set -fbyte-code or :set -fobject-code as first line of GHCi REPL block to override. Note that code in GHCi is always interpreted bytecode.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].