Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- data PathCompletionInfo = PathCompletionInfo {}
- splitFileNameNoTrailingSlash :: FilePath -> (String, String)
- pathCompletionInfoFromCabalPrefixInfo :: FilePath -> CabalPrefixInfo -> PathCompletionInfo
- sourceDirsExtractionLibrary :: Maybe StanzaName -> GenericPackageDescription -> [FilePath]
- sourceDirsExtractionExecutable :: Maybe StanzaName -> GenericPackageDescription -> [FilePath]
- sourceDirsExtractionTestSuite :: Maybe StanzaName -> GenericPackageDescription -> [FilePath]
- sourceDirsExtractionBenchmark :: Maybe StanzaName -> GenericPackageDescription -> [FilePath]
- extractRelativeDirsFromStanza :: Maybe StanzaName -> GenericPackageDescription -> (GenericPackageDescription -> [(UnqualComponentName, CondTree b c a)]) -> (a -> BuildInfo) -> [FilePath]
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" ...
PathCompletionInfo | |
|
Instances
Show PathCompletionInfo Source # | |
Defined in Ide.Plugin.Cabal.Completion.Completer.Paths showsPrec :: Int -> PathCompletionInfo -> ShowS # show :: PathCompletionInfo -> String # showList :: [PathCompletionInfo] -> ShowS # | |
Eq PathCompletionInfo Source # | |
Defined in Ide.Plugin.Cabal.Completion.Completer.Paths (==) :: PathCompletionInfo -> PathCompletionInfo -> Bool # (/=) :: PathCompletionInfo -> PathCompletionInfo -> Bool # |
splitFileNameNoTrailingSlash :: FilePath -> (String, String) Source #
Posix.splitFileName modification, that drops trailing ./ if if wasn't present in the original path.
Fix for the issue #3774 Examples:
>>>
splitFileNameNoTrailingSlash ""
("", "")>>>
splitFileNameNoTrailingSlash "./"
("./", "")>>>
splitFileNameNoTrailingSlash "dir"
("", "dir")>>>
splitFileNameNoTrailingSlash "./dir"
("./", "dir")>>>
splitFileNameNoTrailingSlash "dir1/dir2"
("dir1/","dir2")>>>
splitFileNameNoTrailingSlash "./dir1/dir2"
("./dir1/","dir2")
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.