hls-cabal-plugin-2.1.0.0: Cabal integration plugin with Haskell Language Server
Safe HaskellSafe-Inferred
LanguageHaskell2010

Ide.Plugin.Cabal.Completion.Types

Synopsis

Documentation

data Log Source #

Constructors

LogFileSplitError Position 
LogUnknownKeyWordInContextError KeyWordName

This should never occur since we extract the word to lookup from the same map we look it up in.

LogUnknownStanzaNameInContextError StanzaName

This should never occur since we extract the word to lookup from the same map we look it up in.

LogFilePathCompleterIOError FilePath IOError 
LogUseWithStaleFastNoResult 
LogMapLookUpOfKnownKeyFailed Text 

Instances

Instances details
Show Log Source # 
Instance details

Defined in Ide.Plugin.Cabal.Completion.Types

Methods

showsPrec :: Int -> Log -> ShowS #

show :: Log -> String #

showList :: [Log] -> ShowS #

Pretty Log Source # 
Instance details

Defined in Ide.Plugin.Cabal.Completion.Types

Methods

pretty :: Log -> Doc ann #

prettyList :: [Log] -> Doc ann #

data ParseCabal Source #

Constructors

ParseCabal 

Instances

Instances details
Generic ParseCabal Source # 
Instance details

Defined in Ide.Plugin.Cabal.Completion.Types

Associated Types

type Rep ParseCabal :: Type -> Type #

Show ParseCabal Source # 
Instance details

Defined in Ide.Plugin.Cabal.Completion.Types

NFData ParseCabal Source # 
Instance details

Defined in Ide.Plugin.Cabal.Completion.Types

Methods

rnf :: ParseCabal -> () #

Eq ParseCabal Source # 
Instance details

Defined in Ide.Plugin.Cabal.Completion.Types

Hashable ParseCabal Source # 
Instance details

Defined in Ide.Plugin.Cabal.Completion.Types

type Rep ParseCabal Source # 
Instance details

Defined in Ide.Plugin.Cabal.Completion.Types

type Rep ParseCabal = D1 ('MetaData "ParseCabal" "Ide.Plugin.Cabal.Completion.Types" "hls-cabal-plugin-2.1.0.0-DoFezuWCvM3G7Czn8Yqjx" 'False) (C1 ('MetaCons "ParseCabal" 'PrefixI 'False) (U1 :: Type -> Type))
type RuleResult ParseCabal Source # 
Instance details

Defined in Ide.Plugin.Cabal.Completion.Types

type Context = (StanzaContext, FieldContext) Source #

The context a cursor can be in within a cabal file.

We can be in stanzas or the top level, and additionally we can be in a context where we have already written a keyword but no value for it yet

data StanzaContext Source #

Context inside a cabal file. Used to decide which keywords to suggest.

Constructors

TopLevel

Top level context in a cabal file such as author

Stanza StanzaType (Maybe StanzaName)

Nested context in a cabal file, such as library.

Stanzas have their own fields which differ from top-level fields. Each stanza must be named, such as 'executable exe', except for the main library.

data FieldContext Source #

Keyword context in a cabal file.

Used to decide whether to suggest values or keywords.

Constructors

KeyWord KeyWordName

Key word context, where a keyword occurs right before the current word to be completed

None

Keyword context where no keyword occurs right before the current word to be completed

data CabalPrefixInfo Source #

Information regarding the current completion status

Example: "dir1/fi having been written to the file would correspond to:

   completionPrefix = "dir1/fi"
   isStringNotation = LeftSide
   ...
 

We define this type instead of simply using VFS.PosPrefixInfo since e.g. for filepaths we need more than just the word before the cursor (as can be seen above), since we want to capture the whole filepath before the cursor.

We also use this type to wrap all information necessary to complete filepaths and other values in a cabal file.

Constructors

CabalPrefixInfo 

Fields

data Apostrophe Source #

Where are the apostrophes around the item to be completed?

Surrounded means the item to complete already has the necessary apostrophes, while LeftSide means, a closing apostrophe has to be added after the completion item.

Constructors

Surrounded 
LeftSide 

applyStringNotation :: Maybe Apostrophe -> Text -> Text Source #

Wraps a completion in apostrophes where appropriate.

If a completion starts with an apostrophe we want to end it with an apostrophe. If a completed filepath contains a space, it can only be written in the cabal file if it is wrapped in apostrophes, thus we wrap it.