yi-core-0.18.0: Yi editor core library

Yi.Eval

Description

Evaluator for actions (Action, YiAction). Uses a GHCi session under the hood.

Synopsis

# Main (generic) evaluation interface

Runs the action, as written by the user.

The behaviour of this function can be customised by modifying the Evaluator variable.

Lists the action names in scope, for use by execEditorAction, and help index.

The behaviour of this function can be customised by modifying the Evaluator variable.

Describes the named action in scope, for use by help.

The behaviour of this function can be customised by modifying the Evaluator variable.

data Evaluator Source #

Config variable for customising the behaviour of execEditorAction and getAllNamesInScope.

Set this variable using evaluator. See ghciEvaluator and finiteListEvaluator for two implementation.

Constructors

 Evaluator FieldsexecEditorActionImpl :: String -> YiM ()implementation of execEditorActiongetAllNamesInScopeImpl :: YiM [String]implementation of getAllNamesInScopedescribeNamedActionImpl :: String -> YiM Stringdescribe named action (or at least its type.), simplest implementation is at least return.
Instances
 Source # Instance detailsDefined in Yi.Eval Methods Source # Instance detailsDefined in Yi.Eval

The evaluator to use for execEditorAction and getAllNamesInScope.

## Standard evaluators

Evaluator based on a fixed list of published actions. Has a few differences from ghciEvaluator:

• expressions can't be evaluated
• all suggested actions are actually valued
• (related to the above) doesn't contain junk actions from Prelude
• doesn't require GHCi backend, so uses less memory

Accessor for the published actions. Consider using publishAction.

publishAction :: (YiAction a x, Show x) => String -> a -> ConfigM () Source #

Publish the given action, by the given name. This will overwrite any existing actions by the same name.

# Eval/Interpretation

Tries to jump to error at the current line. See parseErrorMessageB.

Arguments

 :: FilePath Filename to make the jump in. -> Int Line to jump to. -> Int Column to jump to. -> YiM ()

Jumps to specified position in a given file.