Safe Haskell | None |
---|---|
Language | Haskell2010 |
A Shake implementation of the compiler service, built using the Shaker abstraction layer for in-memory use.
Synopsis
- data IdeState
- data GetDependencies = GetDependencies
- data GetParsedModule = GetParsedModule
- data TransitiveDependencies = TransitiveDependencies {}
- newtype Priority = Priority Double
- data GhcSessionIO = GhcSessionIO
- data GetClientSettings = GetClientSettings
- priorityTypeCheck :: Priority
- priorityGenerateCore :: Priority
- priorityFilesOfInterest :: Priority
- runAction :: String -> IdeState -> Action a -> IO a
- useE :: IdeRule k v => k -> NormalizedFilePath -> MaybeT IdeAction (v, PositionMapping)
- useNoFileE :: IdeRule k v => IdeState -> k -> MaybeT IdeAction v
- usesE :: IdeRule k v => k -> [NormalizedFilePath] -> MaybeT IdeAction [(v, PositionMapping)]
- toIdeResult :: Either [FileDiagnostic] v -> IdeResult v
- defineNoFile :: IdeRule k v => (k -> Action v) -> Rules ()
- defineEarlyCutOffNoFile :: IdeRule k v => (k -> Action (ByteString, v)) -> Rules ()
- mainRule :: Rules ()
- getAtPoint :: NormalizedFilePath -> Position -> IdeAction (Maybe (Maybe Range, [Text]))
- getDefinition :: NormalizedFilePath -> Position -> IdeAction (Maybe Location)
- getTypeDefinition :: NormalizedFilePath -> Position -> IdeAction (Maybe [Location])
- highlightAtPoint :: NormalizedFilePath -> Position -> IdeAction (Maybe [DocumentHighlight])
- getDependencies :: NormalizedFilePath -> Action (Maybe [NormalizedFilePath])
- getParsedModule :: NormalizedFilePath -> Action (Maybe ParsedModule)
- getClientConfigAction :: (Default a, FromJSON a) => Action a
- newtype CompiledLinkables = CompiledLinkables {}
- data IsHiFileStable = IsHiFileStable
- getParsedModuleRule :: Rules ()
- getLocatedImportsRule :: Rules ()
- getDependencyInformationRule :: Rules ()
- reportImportCyclesRule :: Rules ()
- getDependenciesRule :: Rules ()
- typeCheckRule :: Rules ()
- getDocMapRule :: Rules ()
- loadGhcSession :: Rules ()
- getModIfaceFromDiskRule :: Rules ()
- getModIfaceRule :: Rules ()
- getModIfaceWithoutLinkableRule :: Rules ()
- getModSummaryRule :: Rules ()
- isHiFileStableRule :: Rules ()
- getModuleGraphRule :: Rules ()
- knownFilesRule :: Rules ()
- getClientSettingsRule :: Rules ()
- getHieAstsRule :: Rules ()
- getBindingsRule :: Rules ()
- needsCompilationRule :: Rules ()
- generateCoreRule :: Rules ()
- getImportMapRule :: Rules ()
Types
A Shake database plus persistent store. Can be thought of as storing
mappings from (FilePath, k)
to RuleResult k
.
data GetDependencies Source #
Instances
data GetParsedModule Source #
Instances
data TransitiveDependencies Source #
TransitiveDependencies | |
|
Instances
data GhcSessionIO Source #
Instances
Eq GhcSessionIO Source # | |
Defined in Development.IDE.Core.RuleTypes (==) :: GhcSessionIO -> GhcSessionIO -> Bool # (/=) :: GhcSessionIO -> GhcSessionIO -> Bool # | |
Show GhcSessionIO Source # | |
Defined in Development.IDE.Core.RuleTypes showsPrec :: Int -> GhcSessionIO -> ShowS # show :: GhcSessionIO -> String # showList :: [GhcSessionIO] -> ShowS # | |
Generic GhcSessionIO Source # | |
Defined in Development.IDE.Core.RuleTypes type Rep GhcSessionIO :: Type -> Type # from :: GhcSessionIO -> Rep GhcSessionIO x # to :: Rep GhcSessionIO x -> GhcSessionIO # | |
Hashable GhcSessionIO Source # | |
Defined in Development.IDE.Core.RuleTypes hashWithSalt :: Int -> GhcSessionIO -> Int # hash :: GhcSessionIO -> Int # | |
Binary GhcSessionIO Source # | |
Defined in Development.IDE.Core.RuleTypes | |
NFData GhcSessionIO Source # | |
Defined in Development.IDE.Core.RuleTypes rnf :: GhcSessionIO -> () # | |
type Rep GhcSessionIO Source # | |
type RuleResult GhcSessionIO Source # | |
Defined in Development.IDE.Core.RuleTypes |
data GetClientSettings Source #
Get the vscode client settings stored in the ide state
Instances
Functions
useE :: IdeRule k v => k -> NormalizedFilePath -> MaybeT IdeAction (v, PositionMapping) Source #
useE is useful to implement functions that aren’t rules but need shortcircuiting e.g. getDefinition.
usesE :: IdeRule k v => k -> [NormalizedFilePath] -> MaybeT IdeAction [(v, PositionMapping)] Source #
toIdeResult :: Either [FileDiagnostic] v -> IdeResult v Source #
This is useful for rules to convert rules that can only produce errors or a result into the more general IdeResult type that supports producing warnings while also producing a result.
defineEarlyCutOffNoFile :: IdeRule k v => (k -> Action (ByteString, v)) -> Rules () Source #
getAtPoint :: NormalizedFilePath -> Position -> IdeAction (Maybe (Maybe Range, [Text])) Source #
Try to get hover text for the name under point.
getDefinition :: NormalizedFilePath -> Position -> IdeAction (Maybe Location) Source #
Goto Definition.
getTypeDefinition :: NormalizedFilePath -> Position -> IdeAction (Maybe [Location]) Source #
highlightAtPoint :: NormalizedFilePath -> Position -> IdeAction (Maybe [DocumentHighlight]) Source #
getDependencies :: NormalizedFilePath -> Action (Maybe [NormalizedFilePath]) Source #
Get all transitive file dependencies of a given module. Does not include the file itself.
getParsedModule :: NormalizedFilePath -> Action (Maybe ParsedModule) Source #
Parse the contents of a daml file.
getClientConfigAction :: (Default a, FromJSON a) => Action a Source #
Returns the client configurarion stored in the IdeState. You can use this function to access it from shake Rules
Rules
newtype CompiledLinkables Source #
Tracks which linkables are current, so we don't need to unload them
Instances
data IsHiFileStable Source #
Given the path to a module src file, this rule returns True if the corresponding `.hi` file is stable, that is, if it is newer than the src file, and all its dependencies are stable too.
Instances
Eq IsHiFileStable Source # | |
Defined in Development.IDE.Core.Rules (==) :: IsHiFileStable -> IsHiFileStable -> Bool # (/=) :: IsHiFileStable -> IsHiFileStable -> Bool # | |
Show IsHiFileStable Source # | |
Defined in Development.IDE.Core.Rules showsPrec :: Int -> IsHiFileStable -> ShowS # show :: IsHiFileStable -> String # showList :: [IsHiFileStable] -> ShowS # | |
Generic IsHiFileStable Source # | |
Defined in Development.IDE.Core.Rules type Rep IsHiFileStable :: Type -> Type # from :: IsHiFileStable -> Rep IsHiFileStable x # to :: Rep IsHiFileStable x -> IsHiFileStable # | |
Hashable IsHiFileStable Source # | |
Defined in Development.IDE.Core.Rules hashWithSalt :: Int -> IsHiFileStable -> Int # hash :: IsHiFileStable -> Int # | |
Binary IsHiFileStable Source # | |
Defined in Development.IDE.Core.Rules | |
NFData IsHiFileStable Source # | |
Defined in Development.IDE.Core.Rules rnf :: IsHiFileStable -> () # | |
type Rep IsHiFileStable Source # | |
type RuleResult IsHiFileStable Source # | |
Defined in Development.IDE.Core.Rules |
getParsedModuleRule :: Rules () Source #
IMPORTANT FOR HLINT INTEGRATION: We currently parse the module both with and without Opt_Haddock, and return the one with Haddocks if it -- succeeds. However, this may not work for hlint, and we might need to save the one without haddocks too. See https://github.com/haskell/ghcide/pull/350#discussion_r370878197 and https://github.com/mpickering/ghcide/pull/22#issuecomment-625070490
getLocatedImportsRule :: Rules () Source #
reportImportCyclesRule :: Rules () Source #
getDependenciesRule :: Rules () Source #
typeCheckRule :: Rules () Source #
getDocMapRule :: Rules () Source #
loadGhcSession :: Rules () Source #
getModIfaceFromDiskRule :: Rules () Source #
getModIfaceRule :: Rules () Source #
getModSummaryRule :: Rules () Source #
isHiFileStableRule :: Rules () Source #
getModuleGraphRule :: Rules () Source #
knownFilesRule :: Rules () Source #
getClientSettingsRule :: Rules () Source #
getHieAstsRule :: Rules () Source #
getBindingsRule :: Rules () Source #
needsCompilationRule :: Rules () Source #
generateCoreRule :: Rules () Source #
getImportMapRule :: Rules () Source #