nvim-hs-ghcid-2.0.1.0: Neovim plugin that runs ghcid to update the quickfix list
Copyright(c) Sebastian Witte
LicenseApache-2.0
Maintainerwoozletoff@gmail.com
Stabilityexperimental
PortabilityGHC
Safe HaskellSafe-Inferred
LanguageHaskell2010

Neovim.Ghcid.Plugin

Description

 
Synopsis

Documentation

data ProjectSettings Source #

Simple data type containing a few information on how to start ghcid.

Constructors

ProjectSettings 

Fields

  • rootDir :: FilePath

    Project directory from which ghcid can be started successfully.

  • cmd :: String

    Command to start a ghci session (usually cabal repl or stack ghci).

Instances

Instances details
FromJSON ProjectSettings Source # 
Instance details

Defined in Neovim.Ghcid.Plugin

ToJSON ProjectSettings Source # 
Instance details

Defined in Neovim.Ghcid.Plugin

Generic ProjectSettings Source # 
Instance details

Defined in Neovim.Ghcid.Plugin

Associated Types

type Rep ProjectSettings :: Type -> Type #

Show ProjectSettings Source # 
Instance details

Defined in Neovim.Ghcid.Plugin

Eq ProjectSettings Source # 
Instance details

Defined in Neovim.Ghcid.Plugin

Ord ProjectSettings Source # 
Instance details

Defined in Neovim.Ghcid.Plugin

type Rep ProjectSettings Source # 
Instance details

Defined in Neovim.Ghcid.Plugin

type Rep ProjectSettings = D1 ('MetaData "ProjectSettings" "Neovim.Ghcid.Plugin" "nvim-hs-ghcid-2.0.1.0-pRFBONThxeEWeY0WSfNze" 'False) (C1 ('MetaCons "ProjectSettings" 'PrefixI 'True) (S1 ('MetaSel ('Just "rootDir") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath) :*: S1 ('MetaSel ('Just "cmd") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)))

data GhcidEnv Source #

Constructors

GhcidEnv 

Fields

ghcidStart :: CommandArguments -> Neovim GhcidEnv () Source #

Start or update a ghcid session.

This will call determineProjectSettings and ask you to confirm or overwrite its proposed settings. If you prepend a bang, it acts as if you have confirmed all settings.

startOrReload :: ProjectSettings -> Neovim GhcidEnv () Source #

Start a new ghcid session or reload the modules to update the quickfix list.

ghcidStop :: CommandArguments -> Neovim GhcidEnv () Source #

Stop a ghcid session associated to the currently active buffer.

ghcidRestart :: CommandArguments -> Neovim GhcidEnv () Source #

Same as :GhcidStop followed by :GhcidStart!. Note the bang!

determineProjectSettings' :: FilePath -> IO (Maybe ProjectSettings) Source #

Determine project settings for a directory.

This will traverse through all parent directories and search for a hint on how to start the ghcid background process. The following configurations will be tried in this order:

  • A ghcid.yaml file which can be created with the GhcidStart command
  • A stack.yaml file
  • A cabal.sandbox.config file
  • A *.cabal file

Note that ghcidStart prompts for confirmation unless you prepend a bang. So, if you want to use your preferred settings, simply save them to the ghcid.yaml file and you're done.