All Projects → haskell → Vscode Haskell

haskell / Vscode Haskell

Licence: other
VS Code extension for Haskell, powered by haskell-language-server

Programming Languages

typescript
32286 projects
haskell
3896 projects

Projects that are alternatives of or similar to Vscode Haskell

Vscode Java
Java Language Support for Visual Studio Code
Stars: ✭ 1,370 (+340.51%)
Mutual labels:  vscode-extension, language-server
Vscode R Lsp
R LSP Client for Visual Studio Code
Stars: ✭ 57 (-81.67%)
Mutual labels:  vscode-extension, language-server
Language Tools
The Svelte Language Server, and official extensions which use it
Stars: ✭ 516 (+65.92%)
Mutual labels:  vscode-extension, language-server
vscode-caddyfile-support
Rich Caddyfile support for Visual Studio Code
Stars: ✭ 30 (-90.35%)
Mutual labels:  language-server, vscode-extension
Langserver Swift
A Swift implementation of the open Language Server Protocol.
Stars: ✭ 171 (-45.02%)
Mutual labels:  vscode-extension, language-server
Ffi Navigator
Stars: ✭ 122 (-60.77%)
Mutual labels:  vscode-extension, language-server
Vscode Intelephense
PHP intellisense for Visual Studio Code
Stars: ✭ 872 (+180.39%)
Mutual labels:  vscode-extension, language-server
Vscode Swift
An extension for VS Code which provides support for the Swift language.
Stars: ✭ 132 (-57.56%)
Mutual labels:  vscode-extension, language-server
Vshaxe
Haxe Support for Visual Studio Code
Stars: ✭ 234 (-24.76%)
Mutual labels:  vscode-extension, language-server
vscode-tenkawa-php
Visual Studio Code extension integrating Tenkawa PHP language server.
Stars: ✭ 28 (-91%)
Mutual labels:  language-server, vscode-extension
vscode-snippet-generator
📜 Generate snippets from code in VSCode
Stars: ✭ 31 (-90.03%)
Mutual labels:  vscode-extension
vscode-react-redux-react-router-snippets
vscode-react-redux-react-router-snippets
Stars: ✭ 32 (-89.71%)
Mutual labels:  vscode-extension
Ide Php
PHP language support for Atom-IDE
Stars: ✭ 269 (-13.5%)
Mutual labels:  language-server
Vscode Reveal
Revealjs vsCode extension
Stars: ✭ 298 (-4.18%)
Mutual labels:  vscode-extension
satysfi-language-server
The SATySFi Language Server
Stars: ✭ 26 (-91.64%)
Mutual labels:  language-server
Swdc Vscode
Time-tracking plugin for Visual Studio Code
Stars: ✭ 268 (-13.83%)
Mutual labels:  vscode-extension
vscode-appcelerator-titanium
Appcelerator development tools and UI package for Visual Studio Code.
Stars: ✭ 35 (-88.75%)
Mutual labels:  vscode-extension
VSCode-Anywhere
VSCode with preconfigured tools for your programming languages : binaries, settings, extensions and documentations
Stars: ✭ 26 (-91.64%)
Mutual labels:  vscode-extension
vscode-ecsstractor
Extracting selectors from HTML / JSX / TSX and generate CSS file.
Stars: ✭ 45 (-85.53%)
Mutual labels:  vscode-extension
Elm Language Server
Language server implementation for Elm
Stars: ✭ 298 (-4.18%)
Mutual labels:  language-server

Haskell for Visual Studio Code

vsmarketplacebadge

This extension adds language support for Haskell, powered by the Haskell Language Server.

Features

  • Warning and error diagnostics from GHC

  • Type information and documentation on hover

  • Jump to definition

  • Document symbols

  • Highlight references in document

  • Code completion

  • Formatting via Brittany, Floskell, Fourmolu, Ormolu or Stylish Haskell

  • Multi-root workspace support

  • Code evaluation (Haskell Language Server), see (Tutorial)

    Eval Demo

  • Integration with retrie

    Retrie Demo

  • Code lenses for explicit import lists

    Imports code lens Demo

  • Generate functions from type signatures, and intelligently complete holes using Wingman (tactics)

    Wingman Demo

  • Integration with hlint to show diagnostics and apply hints via apply-refact

    Hlint Demo

  • Module name suggestions for insertion or correction

    Module Name Demo

Requirements

  • For standalone .hs/.lhs files, ghc must be installed and on the PATH. The easiest way to install it is with ghcup or Chocolatey on Windows.
  • For Cabal based projects, both ghc and cabal-install must be installed and on the PATH. It can also be installed with ghcup or Chocolatey on Windows.
  • For Stack based projects, stack must be installed and on the PATH.

Configuration options

Path to server executable executable

If your server is manually installed and not on your path, you can also manually set the path to the executable.

"haskell.serverExecutablePath": "~/.local/bin/hie"

There are a few placeholders which will be expanded:

  • ~, ${HOME} and ${home} will be expanded into your users' home folder.
  • ${workspaceFolder} and ${workspaceRoot} will expand into your current project root.

Local documentation

Haskell Language Server can display Haddock documentation on hover and completions if the project and its dependencies have been built with the -haddock GHC flag.

  • For cabal:

    • Add to your global config file (e.g. ~/.cabal/config):

      program-default-options
        ghc-options: -haddock
      
    • Or, for a single project, run cabal configure --ghc-options=-haddock

  • For stack, add to global $STACK_ROOT\config.yaml, or project's stack.yaml:

    ghc-options:
      '$everything': -haddock
    

    Note that this flag will cause compilation errors if a dependency contains invalid Haddock markup, until GHC 9.0 which will report warnings instead.

Downloaded binaries

This extension will download haskell-language-server binaries to a specific location depending on your system. If you find yourself running out of disk space, you can try deleting old versions of language servers in this directory. The extension will redownload them, no strings attached.

Platform Path
macOS ~/Library/Application\ Support/Code/User/globalStorage/haskell.haskell/
Windows %APPDATA%\Code\User\globalStorage\haskell.haskell
Linux $HOME/.config/Code/User/globalStorage/haskell.haskell

Note that if haskell-language-server-wrapper/haskell-language-server is already on the PATH, then the extension will launch it directly instead of downloading binaries.

Supported GHC versions

These are the versions of GHC that there are binaries of haskell-language-server for. Building from source may support more versions!

GHC Linux macOS Windows
8.10.4
8.10.3
8.10.2
8.8.4
8.8.3
8.8.2
8.6.5
8.6.4

The exact list of binaries can be checked in the last release of haskell-language-server: https://github.com/haskell/haskell-language-server/releases/latest

Using multi-root workspaces

First, check out what multi-root workspaces are. The idea of using multi-root workspaces, is to be able to work on several different Haskell projects, where the GHC version or stackage LTS could differ, and have it work smoothly.

The language server is now started for each workspace folder you have in your multi-root workspace, and several configurations are on a resource (i.e. folder) scope, instead of window (i.e. global) scope.

Investigating and reporting problems

  1. Go to extensions and right click Haskell Language Server and choose Extensions Settings
  2. Scroll down to Language Server Haskell › Trace: Server and set it to messages
  3. Restart vscode and reproduce your problem
  4. Go to the main menu and choose View -> Output (Ctrl + Shift + U)
  5. On the new Output panel that opens on the right side in the drop down menu choose Haskell (<your project>)

Please include the output when filing any issues on the haskell-language-server issue tracker.

Troubleshooting

  • Sometimes the language server might get stuck in a rut and stop responding to your latest changes. Should this occur you can try restarting the language server with Ctrl shift P/ shift P > Restart Haskell LSP Server.
  • Usually the error or unexpected behaviour is already reported in the haskell language server issue tracker. Finding the issue could be useful to help resolve it and sometimes includes a workaround for the issue.

Contributing

If you want to help, get started by reading Contributing for more details.

Release Notes

See the Changelog for more details.

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].