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

Ide.Plugin.Cabal.Completion.Completer.Paths

Synopsis

Documentation

data PathCompletionInfo Source #

Information used to query and build path completions.

Note that pathSegment combined with queryDirectory results in the original prefix.

Example: When given the written prefix, dir1/dir2/fi, the resulting PathCompletionInfo would be:

   pathSegment = "fi"
   queryDirectory  = "dir1/dir2/fi"
   ...
 

Constructors

PathCompletionInfo 

Fields

pathCompletionInfoFromCabalPrefixInfo :: FilePath -> CabalPrefixInfo -> PathCompletionInfo Source #

Takes an optional source subdirectory and a prefix info and creates a path completion info accordingly.

The source directory represents some subdirectory of the working directory such as a path from the field hs-source-dirs.

If the source subdirectory is empty, then the working directory is simply set to the currently handled cabal file's directory.

sourceDirsExtractionLibrary :: Maybe StanzaName -> GenericPackageDescription -> [FilePath] Source #

Extracts the source directories of the library stanza.

sourceDirsExtractionExecutable :: Maybe StanzaName -> GenericPackageDescription -> [FilePath] Source #

Extracts the source directories of the executable stanza with the given name.

sourceDirsExtractionTestSuite :: Maybe StanzaName -> GenericPackageDescription -> [FilePath] Source #

Extracts the source directories of the test suite stanza with the given name.

sourceDirsExtractionBenchmark :: Maybe StanzaName -> GenericPackageDescription -> [FilePath] Source #

Extracts the source directories of benchmark stanza with the given name.

extractRelativeDirsFromStanza :: Maybe StanzaName -> GenericPackageDescription -> (GenericPackageDescription -> [(UnqualComponentName, CondTree b c a)]) -> (a -> BuildInfo) -> [FilePath] Source #

Takes a possible stanza name, a GenericPackageDescription, a function to access the stanza information we are interested in and a function to access the build info from the specific stanza.

Returns a list of relative source directory paths specified for the extracted stanza.