Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data ParseResult a
- action :: Action a -> Rules ()
- type family RuleResult key
- data Rules a
- data Action a
- getClientConfig :: MonadLsp Config m => m Config
- data NormalizedUri
- type DiagnosticStore = HashMap NormalizedUri StoreItem
- data Diagnostic = Diagnostic {}
- data DiagnosticSeverity
- data Location = Location {}
- data Range = Range {}
- data Position = Position {
- _line :: UInt
- _character :: UInt
- fromNormalizedFilePath :: NormalizedFilePath -> FilePath
- fromNormalizedUri :: NormalizedUri -> Uri
- toNormalizedUri :: Uri -> NormalizedUri
- newtype Uri = Uri {}
- data NormalizedFilePath
- newtype List a = List [a]
- data GhcVersion
- setHieDir :: FilePath -> DynFlags -> DynFlags
- dontWriteHieFiles :: DynFlags -> DynFlags
- disableWarningsAsErrors :: DynFlags -> DynFlags
- ghcVersion :: GhcVersion
- toNormalizedFilePath' :: FilePath -> NormalizedFilePath
- emptyFilePath :: NormalizedFilePath
- uriToFilePath' :: Uri -> Maybe FilePath
- emptyPathUri :: NormalizedUri
- filePathToUri' :: NormalizedFilePath -> NormalizedUri
- fromUri :: NormalizedUri -> NormalizedFilePath
- noFilePath :: FilePath
- noRange :: Range
- showPosition :: Position -> String
- readSrcSpan :: ReadS RealSrcSpan
- type FileDiagnostic = (NormalizedFilePath, ShowDiagnostic, Diagnostic)
- data ShowDiagnostic
- type IdeResultNoDiagnosticsEarlyCutoff v = (Maybe ByteString, Maybe v)
- type IdeResult v = ([FileDiagnostic], Maybe v)
- ideErrorText :: NormalizedFilePath -> Text -> FileDiagnostic
- ideErrorWithSource :: Maybe DiagnosticSource -> Maybe DiagnosticSeverity -> a -> Text -> (a, ShowDiagnostic, Diagnostic)
- showDiagnostics :: [FileDiagnostic] -> Text
- showDiagnosticsColored :: [FileDiagnostic] -> Text
- modifyDynFlags :: GhcMonad m => (DynFlags -> DynFlags) -> m ()
- lookupPackageConfig :: Unit -> HscEnv -> Maybe UnitInfo
- textToStringBuffer :: Text -> StringBuffer
- runParser :: DynFlags -> String -> P a -> ParseResult a
- stringBufferToByteString :: StringBuffer -> ByteString
- bytestringToStringBuffer :: ByteString -> StringBuffer
- prettyPrint :: Outputable a => a -> String
- unsafePrintSDoc :: SDoc -> String
- printRdrName :: RdrName -> String
- printName :: Name -> String
- evalGhcEnv :: HscEnv -> Ghc b -> IO b
- moduleImportPath :: NormalizedFilePath -> ModuleName -> Maybe FilePath
- readFileUtf8 :: FilePath -> IO Text
- cgGutsToCoreModule :: SafeHaskellMode -> CgGuts -> ModDetails -> CoreModule
- fingerprintToBS :: Fingerprint -> ByteString
- fingerprintFromStringBuffer :: StringBuffer -> IO Fingerprint
- fingerprintFromByteString :: ByteString -> IO Fingerprint
- fingerprintFromPut :: Put -> IO Fingerprint
- hDuplicateTo' :: Handle -> Handle -> IO ()
- traceAst :: (Data a, ExactPrint a, Outputable a, HasCallStack) => String -> a -> a
- diagFromErrMsg :: Text -> DynFlags -> MsgEnvelope DecoratedSDoc -> [FileDiagnostic]
- diagFromErrMsgs :: Text -> DynFlags -> Bag (MsgEnvelope DecoratedSDoc) -> [FileDiagnostic]
- srcSpanToRange :: SrcSpan -> Maybe Range
- realSrcSpanToRange :: RealSrcSpan -> Range
- realSrcLocToPosition :: RealSrcLoc -> Position
- srcSpanToFilename :: SrcSpan -> Maybe FilePath
- realSrcSpanToLocation :: RealSrcSpan -> Location
- srcSpanToLocation :: SrcSpan -> Maybe Location
- rangeToSrcSpan :: NormalizedFilePath -> Range -> SrcSpan
- rangeToRealSrcSpan :: NormalizedFilePath -> Range -> RealSrcSpan
- positionToRealSrcLoc :: NormalizedFilePath -> Position -> RealSrcLoc
- isInsideSrcSpan :: Position -> SrcSpan -> Bool
- toDSeverity :: Severity -> Maybe DiagnosticSeverity
- diagFromStrings :: Text -> DiagnosticSeverity -> [(SrcSpan, String)] -> [FileDiagnostic]
- diagFromString :: Text -> DiagnosticSeverity -> SrcSpan -> String -> [FileDiagnostic]
- noSpan :: String -> SrcSpan
- zeroSpan :: FastString -> RealSrcSpan
- realSpan :: SrcSpan -> Maybe RealSrcSpan
- catchSrcErrors :: DynFlags -> Text -> IO a -> IO (Either [FileDiagnostic] a)
- diagFromGhcException :: Text -> DynFlags -> GhcException -> [FileDiagnostic]
- newtype Logger = Logger {
- logPriority :: Priority -> Text -> IO ()
- data Priority
- logError :: Logger -> Text -> IO ()
- logWarning :: Logger -> Text -> IO ()
- logInfo :: Logger -> Text -> IO ()
- logDebug :: Logger -> Text -> IO ()
- logTelemetry :: Logger -> Text -> IO ()
- noLogging :: Logger
- data HscEnvEq
- hscEnvWithImportPaths :: HscEnvEq -> HscEnv
- data GhcSessionIO = GhcSessionIO
- data IdeGhcSession = IdeGhcSession {
- loadSessionFun :: FilePath -> IO (IdeResult HscEnvEq, [FilePath])
- sessionVersion :: !Int
- data AddWatchedFile = AddWatchedFile
- data GetClientSettings = GetClientSettings
- data GetModSummary = GetModSummary
- data GetModSummaryWithoutTimestamps = GetModSummaryWithoutTimestamps
- data IsFileOfInterest = IsFileOfInterest
- data GetModIface = GetModIface
- data GetModIfaceFromDiskAndIndex = GetModIfaceFromDiskAndIndex
- data GetModIfaceFromDisk = GetModIfaceFromDisk
- newtype GhcSessionDeps where
- GhcSessionDeps_ { }
- pattern GhcSessionDeps :: GhcSessionDeps
- data GhcSession = GhcSession
- data GetBindings = GetBindings
- data GetHieAst = GetHieAst
- data GetDocMap = GetDocMap
- data TypeCheck = TypeCheck
- data ReportImportCycles = ReportImportCycles
- data GetModuleGraph = GetModuleGraph
- data GetDependencyInformation = GetDependencyInformation
- data NeedsCompilation = NeedsCompilation
- data GetLocatedImports = GetLocatedImports
- data GetParsedModuleWithComments = GetParsedModuleWithComments
- data GetParsedModule = GetParsedModule
- data ModSummaryResult = ModSummaryResult {}
- data IsFileOfInterestResult
- data FileOfInterestStatus
- data GetFileExists = GetFileExists
- data GetFileContents = GetFileContents
- data FileVersion
- newtype GetModificationTime = GetModificationTime_ {}
- data DocAndKindMap = DKMap {
- getDocMap :: !DocMap
- getKindMap :: !KindMap
- data HieKind a where
- data HieAstResult = forall a. HAR {}
- data HiFileResult = HiFileResult {}
- data TcModuleResult = TcModuleResult {}
- data Splices = Splices {
- exprSplices :: [(LHsExpr GhcTc, LHsExpr GhcPs)]
- patSplices :: [(LHsExpr GhcTc, LPat GhcPs)]
- typeSplices :: [(LHsExpr GhcTc, LHsType GhcPs)]
- declSplices :: [(LHsExpr GhcTc, [LHsDecl GhcPs])]
- awSplices :: [(LHsExpr GhcTc, Serialized)]
- newtype ImportMap = ImportMap {}
- data GetImportMap = GetImportMap
- data GenerateCore = GenerateCore
- data GetKnownTargets = GetKnownTargets
- data LinkableType
- pattern GetModificationTime :: GetModificationTime
- encodeLinkableType :: Maybe LinkableType -> ByteString
- tmrModSummary :: TcModuleResult -> ModSummary
- hiFileFingerPrint :: HiFileResult -> ByteString
- mkHiFileResult :: ModSummary -> HomeModInfo -> HiFileResult
- hirModIface :: HiFileResult -> ModIface
- vfsVersion :: FileVersion -> Maybe Int32
- awSplicesL :: Lens' Splices [(LHsExpr GhcTc, Serialized)]
- declSplicesL :: Lens' Splices [(LHsExpr GhcTc, [LHsDecl GhcPs])]
- exprSplicesL :: Lens' Splices [(LHsExpr GhcTc, LHsExpr GhcPs)]
- patSplicesL :: Lens' Splices [(LHsExpr GhcTc, LPat GhcPs)]
- typeSplicesL :: Lens' Splices [(LHsExpr GhcTc, LHsType GhcPs)]
- data RuleBody k v
- = Rule (k -> NormalizedFilePath -> Action (Maybe ByteString, IdeResult v))
- | RuleNoDiagnostics (k -> NormalizedFilePath -> Action (Maybe ByteString, Maybe v))
- | RuleWithCustomNewnessCheck {
- newnessCheck :: ByteString -> ByteString -> Bool
- build :: k -> NormalizedFilePath -> Action (Maybe ByteString, Maybe v)
- data FastResult a = FastResult {}
- newtype IdeAction a = IdeAction {}
- data IdeState
- type IdeRule k v = (RuleResult k ~ v, ShakeValue k, Show v, Typeable v, NFData v)
- data ShakeExtras
- getPluginConfig :: MonadLsp Config m => PluginId -> m PluginConfig
- define :: IdeRule k v => (k -> NormalizedFilePath -> Action (IdeResult v)) -> Rules ()
- defineNoDiagnostics :: IdeRule k v => (k -> NormalizedFilePath -> Action (Maybe v)) -> Rules ()
- use :: IdeRule k v => k -> NormalizedFilePath -> Action (Maybe v)
- useWithStale :: IdeRule k v => k -> NormalizedFilePath -> Action (Maybe (v, PositionMapping))
- useWithStale_ :: IdeRule k v => k -> NormalizedFilePath -> Action (v, PositionMapping)
- runIdeAction :: String -> ShakeExtras -> IdeAction a -> IO a
- useWithStaleFast :: IdeRule k v => k -> NormalizedFilePath -> IdeAction (Maybe (v, PositionMapping))
- useWithStaleFast' :: IdeRule k v => k -> NormalizedFilePath -> IdeAction (FastResult v)
- useNoFile :: IdeRule k v => k -> Action (Maybe v)
- use_ :: IdeRule k v => k -> NormalizedFilePath -> Action v
- useNoFile_ :: IdeRule k v => k -> Action v
- uses_ :: IdeRule k v => k -> [NormalizedFilePath] -> Action [v]
- uses :: IdeRule k v => k -> [NormalizedFilePath] -> Action [Maybe v]
- defineEarlyCutoff :: IdeRule k v => RuleBody k v -> Rules ()
- ideLogger :: IdeState -> Logger
- actionLogger :: Action Logger
- data Plugin c = Plugin {
- pluginRules :: Rules ()
- pluginHandlers :: Handlers (ServerM c)
- pluginModifyDynflags :: c -> DynFlagsModifications
- getFilesOfInterestUntracked :: Action (HashMap NormalizedFilePath FileOfInterestStatus)
- data IdeConfiguration = IdeConfiguration {}
- isWorkspaceFile :: NormalizedFilePath -> Action Bool
- getFileContents :: NormalizedFilePath -> Action (UTCTime, Maybe Text)
- getFileExists :: NormalizedFilePath -> Action Bool
- runAction :: String -> IdeState -> Action a -> IO a
- getAtPoint :: NormalizedFilePath -> Position -> IdeAction (Maybe (Maybe Range, [Text]))
- 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)]
- getDefinition :: NormalizedFilePath -> Position -> IdeAction (Maybe [Location])
- getTypeDefinition :: NormalizedFilePath -> Position -> IdeAction (Maybe [Location])
- data IsHiFileStable = IsHiFileStable
- getParsedModule :: NormalizedFilePath -> Action (Maybe ParsedModule)
- getClientConfigAction :: Config -> Action Config
Documentation
data ParseResult a #
The result of running a parser.
POk | The parser has consumed a (possibly empty) prefix
of the input and produced a result. Use |
| |
PFailed | The parser has consumed a (possibly empty) prefix of the input and failed. |
|
type family RuleResult key #
The type mapping between the key
or a rule and the resulting value
.
See addBuiltinRule
and apply
.
Instances
type RuleResult NonLocalCompletions Source # | |
type RuleResult LocalCompletions Source # | Produce completions info for a file |
Defined in Development.IDE.Plugin.Completions.Types | |
type RuleResult GhcSessionIO Source # | |
Defined in Development.IDE.Core.RuleTypes | |
type RuleResult AddWatchedFile Source # | |
Defined in Development.IDE.Core.RuleTypes | |
type RuleResult GetClientSettings Source # | |
Defined in Development.IDE.Core.RuleTypes | |
type RuleResult GetModSummary Source # | Generate a ModSummary that has enough information to be used to get .hi and .hie files. without needing to parse the entire source |
Defined in Development.IDE.Core.RuleTypes | |
type RuleResult GetModSummaryWithoutTimestamps Source # | Generate a ModSummary with the timestamps and preprocessed content elided, for more successful early cutoff |
type RuleResult IsFileOfInterest Source # | |
Defined in Development.IDE.Core.RuleTypes | |
type RuleResult GetModIface Source # | Get a module interface details, either from an interface file or a typechecked module |
Defined in Development.IDE.Core.RuleTypes | |
type RuleResult GetModIfaceFromDiskAndIndex Source # | GetModIfaceFromDisk and index the `.hie` file into the database.
This is an internal rule, use |
Defined in Development.IDE.Core.RuleTypes | |
type RuleResult GetModIfaceFromDisk Source # | Read the module interface file from disk. Throws an error for VFS files.
This is an internal rule, use |
Defined in Development.IDE.Core.RuleTypes | |
type RuleResult GhcSessionDeps Source # | A GHC session preloaded with all the dependencies This rule is also responsible for calling ReportImportCycles for the direct dependencies |
Defined in Development.IDE.Core.RuleTypes | |
type RuleResult GhcSession Source # | A GHC session that we reuse. |
Defined in Development.IDE.Core.RuleTypes | |
type RuleResult GetBindings Source # | A IntervalMap telling us what is in scope at each point |
Defined in Development.IDE.Core.RuleTypes | |
type RuleResult GetHieAst Source # | The uncompressed HieAST |
Defined in Development.IDE.Core.RuleTypes | |
type RuleResult GetDocMap Source # | |
Defined in Development.IDE.Core.RuleTypes | |
type RuleResult TypeCheck Source # | The type checked version of this file, requires TypeCheck+ |
Defined in Development.IDE.Core.RuleTypes | |
type RuleResult ReportImportCycles Source # | This rule is used to report import cycles. It depends on GetDependencyInformation. We cannot report the cycles directly from GetDependencyInformation since we can only report diagnostics for the current file. |
Defined in Development.IDE.Core.RuleTypes | |
type RuleResult GetModuleGraph Source # | |
Defined in Development.IDE.Core.RuleTypes | |
type RuleResult GetDependencyInformation Source # | The dependency information produced by following the imports recursively. This rule will succeed even if there is an error, e.g., a module could not be located, a module could not be parsed or an import cycle. |
type RuleResult NeedsCompilation Source # | Does this module need to be compiled? |
Defined in Development.IDE.Core.RuleTypes | |
type RuleResult GetLocatedImports Source # | Resolve the imports in a module to the file path of a module in the same package |
Defined in Development.IDE.Core.RuleTypes | |
type RuleResult GetParsedModuleWithComments Source # | The parse tree for the file using GetFileContents, all comments included using Opt_KeepRawTokenStream |
Defined in Development.IDE.Core.RuleTypes | |
type RuleResult GetParsedModule Source # | The parse tree for the file using GetFileContents |
Defined in Development.IDE.Core.RuleTypes | |
type RuleResult GetFileExists Source # | |
Defined in Development.IDE.Core.RuleTypes | |
type RuleResult GetFileContents Source # | Get the contents of a file, either dirty (if the buffer is modified) or Nothing to mean use from disk. |
Defined in Development.IDE.Core.RuleTypes | |
type RuleResult GetModificationTime Source # | Get the modification time of a file. |
Defined in Development.IDE.Core.RuleTypes | |
type RuleResult GetImportMap Source # | |
Defined in Development.IDE.Core.RuleTypes | |
type RuleResult GenerateCore Source # | Convert to Core, requires TypeCheck* |
Defined in Development.IDE.Core.RuleTypes | |
type RuleResult GetKnownTargets Source # | |
Defined in Development.IDE.Core.RuleTypes | |
type RuleResult GetAnnotatedParsedSource Source # | |
Defined in Development.IDE.GHC.ExactPrint | |
type RuleResult IsHiFileStable Source # | |
Defined in Development.IDE.Core.Rules | |
type RuleResult GetGlobalBindingTypeSigs Source # | |
type RuleResult (Q k) Source # | |
Defined in Development.IDE.Types.Shake |
Instances
getClientConfig :: MonadLsp Config m => m Config #
Returns the current client configuration. It is not wise to permanently cache the returned value of this function, as clients can at runitime change their configuration.
data NormalizedUri #
Instances
data Diagnostic #
Diagnostic | |
|
Instances
data DiagnosticSeverity #
Instances
Instances
Eq Location | |
Ord Location | |
Defined in Language.LSP.Types.Location | |
Read Location | |
Show Location | |
Generic Location | |
ToJSON Location | |
Defined in Language.LSP.Types.Location | |
FromJSON Location | |
NFData Location | |
Defined in Language.LSP.Types.Location | |
HasLocation DiagnosticRelatedInformation Location | |
Defined in Language.LSP.Types.Lens | |
HasLocation SymbolInformation Location | |
Defined in Language.LSP.Types.Lens | |
HasRange Location Range | |
HasUri Location Uri | |
type Rep Location | |
Defined in Language.LSP.Types.Location type Rep Location = D1 ('MetaData "Location" "Language.LSP.Types.Location" "lsp-types-1.4.0.1-2rh5K3u4z9UBFaccFshq5a" 'False) (C1 ('MetaCons "Location" 'PrefixI 'True) (S1 ('MetaSel ('Just "_uri") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Uri) :*: S1 ('MetaSel ('Just "_range") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Range))) |
Instances
Position | |
|
Instances
fromNormalizedUri :: NormalizedUri -> Uri #
toNormalizedUri :: Uri -> NormalizedUri #
Instances
data NormalizedFilePath #
Newtype wrapper around FilePath that always has normalized slashes. The NormalizedUri and hash of the FilePath are cached to avoided repeated normalisation when we need to compute them (which is a lot).
This is one of the most performance critical parts of ghcide, do not modify it without profiling.
Instances
All LSP types representing a list **must** use this type rather than '[]'.
In particular this is necessary to change the FromJSON
instance to be compatible
with Elisp (where empty lists show up as null
)
List [a] |
Instances
data GhcVersion Source #
Instances
Eq GhcVersion Source # | |
Defined in Development.IDE.GHC.Compat (==) :: GhcVersion -> GhcVersion -> Bool # (/=) :: GhcVersion -> GhcVersion -> Bool # | |
Ord GhcVersion Source # | |
Defined in Development.IDE.GHC.Compat compare :: GhcVersion -> GhcVersion -> Ordering # (<) :: GhcVersion -> GhcVersion -> Bool # (<=) :: GhcVersion -> GhcVersion -> Bool # (>) :: GhcVersion -> GhcVersion -> Bool # (>=) :: GhcVersion -> GhcVersion -> Bool # max :: GhcVersion -> GhcVersion -> GhcVersion # min :: GhcVersion -> GhcVersion -> GhcVersion # | |
Show GhcVersion Source # | |
Defined in Development.IDE.GHC.Compat showsPrec :: Int -> GhcVersion -> ShowS # show :: GhcVersion -> String # showList :: [GhcVersion] -> ShowS # |
dontWriteHieFiles :: DynFlags -> DynFlags Source #
uriToFilePath' :: Uri -> Maybe FilePath Source #
We use an empty string as a filepath when we don’t have a file. However, haskell-lsp doesn’t support that in uriToFilePath and given that it is not a valid filepath it does not make sense to upstream a fix. So we have our own wrapper here that supports empty filepaths.
showPosition :: Position -> String Source #
readSrcSpan :: ReadS RealSrcSpan Source #
Parser for the GHC output format
type FileDiagnostic = (NormalizedFilePath, ShowDiagnostic, Diagnostic) Source #
Human readable diagnostics for a specific file.
This type packages a pretty printed, human readable error message along with the related source location so that we can display the error on either the console or in the IDE at the right source location.
data ShowDiagnostic Source #
Defines whether a particular diagnostic should be reported back to the user.
One important use case is "missing signature" code lenses, for which we need to enable the corresponding warning during type checking. However, we do not want to show the warning unless the programmer asks for it (#261).
Instances
Eq ShowDiagnostic Source # | |
Defined in Development.IDE.Types.Diagnostics (==) :: ShowDiagnostic -> ShowDiagnostic -> Bool # (/=) :: ShowDiagnostic -> ShowDiagnostic -> Bool # | |
Ord ShowDiagnostic Source # | |
Defined in Development.IDE.Types.Diagnostics compare :: ShowDiagnostic -> ShowDiagnostic -> Ordering # (<) :: ShowDiagnostic -> ShowDiagnostic -> Bool # (<=) :: ShowDiagnostic -> ShowDiagnostic -> Bool # (>) :: ShowDiagnostic -> ShowDiagnostic -> Bool # (>=) :: ShowDiagnostic -> ShowDiagnostic -> Bool # max :: ShowDiagnostic -> ShowDiagnostic -> ShowDiagnostic # min :: ShowDiagnostic -> ShowDiagnostic -> ShowDiagnostic # | |
Show ShowDiagnostic Source # | |
Defined in Development.IDE.Types.Diagnostics showsPrec :: Int -> ShowDiagnostic -> ShowS # show :: ShowDiagnostic -> String # showList :: [ShowDiagnostic] -> ShowS # | |
NFData ShowDiagnostic Source # | |
Defined in Development.IDE.Types.Diagnostics rnf :: ShowDiagnostic -> () # |
type IdeResultNoDiagnosticsEarlyCutoff v = (Maybe ByteString, Maybe v) Source #
an IdeResult with a fingerprint
type IdeResult v = ([FileDiagnostic], Maybe v) Source #
The result of an IDE operation. Warnings and errors are in the Diagnostic, and a value is in the Maybe. For operations that throw an error you expect a non-empty list of diagnostics, at least one of which is an error, and a Nothing. For operations that succeed you expect perhaps some warnings and a Just. For operations that depend on other failing operations you may get empty diagnostics and a Nothing, to indicate this phase throws no fresh errors but still failed.
A rule on a file should only return diagnostics for that given file. It should not propagate diagnostic errors through multiple phases.
ideErrorText :: NormalizedFilePath -> Text -> FileDiagnostic Source #
ideErrorWithSource :: Maybe DiagnosticSource -> Maybe DiagnosticSeverity -> a -> Text -> (a, ShowDiagnostic, Diagnostic) Source #
showDiagnostics :: [FileDiagnostic] -> Text Source #
showDiagnosticsColored :: [FileDiagnostic] -> Text Source #
modifyDynFlags :: GhcMonad m => (DynFlags -> DynFlags) -> m () Source #
Used to modify dyn flags in preference to calling setSessionDynFlags
,
since that function also reloads packages (which is very slow).
lookupPackageConfig :: Unit -> HscEnv -> Maybe UnitInfo Source #
Given a Unit
try and find the associated PackageConfig
in the environment.
textToStringBuffer :: Text -> StringBuffer Source #
Convert from the text
package to the GHC
StringBuffer
.
Currently implemented somewhat inefficiently (if it ever comes up in a profile).
prettyPrint :: Outputable a => a -> String Source #
Pretty print a GHC value using 'unsafeGlobalDynFlags '.
unsafePrintSDoc :: SDoc -> String Source #
moduleImportPath :: NormalizedFilePath -> ModuleName -> Maybe FilePath Source #
Given a module location, and its parse tree, figure out what is the include directory implied by it.
For example, given the file /usr/Test/Foo/Bar.hs
with the module name Foo.Bar
the directory
/usr/Test
should be on the include path to find sibling modules.
readFileUtf8 :: FilePath -> IO Text Source #
Read a UTF8 file, with lenient decoding, so it will never raise a decoding error.
cgGutsToCoreModule :: SafeHaskellMode -> CgGuts -> ModDetails -> CoreModule Source #
Convert from a CgGuts
to a CoreModule
.
fingerprintToBS :: Fingerprint -> ByteString Source #
Convert a Fingerprint
to a ByteString
by copying the byte across.
Will produce an 8 byte unreadable ByteString.
fingerprintFromStringBuffer :: StringBuffer -> IO Fingerprint Source #
Take the Fingerprint
of a StringBuffer
.
fingerprintFromPut :: Put -> IO Fingerprint Source #
hDuplicateTo' :: Handle -> Handle -> IO () Source #
A slightly modified version of hDuplicateTo
from GHC.
Importantly, it avoids the bug listed in https://gitlab.haskell.org/ghc/ghc/merge_requests/2318.
traceAst :: (Data a, ExactPrint a, Outputable a, HasCallStack) => String -> a -> a Source #
Prints an Outputable
value to stderr and to an HTML file for further inspection
diagFromErrMsg :: Text -> DynFlags -> MsgEnvelope DecoratedSDoc -> [FileDiagnostic] Source #
Produce a GHC-style error from a source span and a message.
diagFromErrMsgs :: Text -> DynFlags -> Bag (MsgEnvelope DecoratedSDoc) -> [FileDiagnostic] Source #
srcSpanToFilename :: SrcSpan -> Maybe FilePath Source #
Extract a file name from a GHC SrcSpan (use message for unhelpful ones) FIXME This may not be an _absolute_ file name, needs fixing.
rangeToSrcSpan :: NormalizedFilePath -> Range -> SrcSpan Source #
toDSeverity :: Severity -> Maybe DiagnosticSeverity Source #
Convert a GHC severity to a DAML compiler Severity. Severities below Warning level are dropped (returning Nothing).
diagFromStrings :: Text -> DiagnosticSeverity -> [(SrcSpan, String)] -> [FileDiagnostic] Source #
Produce a bag of GHC-style errors (ErrorMessages
) from the given
(optional) locations and message strings.
diagFromString :: Text -> DiagnosticSeverity -> SrcSpan -> String -> [FileDiagnostic] Source #
Produce a GHC-style error from a source span and a message.
:: FastString | file path of span |
-> RealSrcSpan |
creates a span with zero length in the filename of the argument passed
catchSrcErrors :: DynFlags -> Text -> IO a -> IO (Either [FileDiagnostic] a) Source #
Catch the errors thrown by GHC (SourceErrors and compiler-internal exceptions like Panic or InstallationError), and turn them into diagnostics
diagFromGhcException :: Text -> DynFlags -> GhcException -> [FileDiagnostic] Source #
Note that this is logging actions _of the program_, not of the user. You shouldn't call warning/error if the user has caused an error, only if our code has gone wrong and is itself erroneous (e.g. we threw an exception).
Logger | |
|
Telemetry | Events that are useful for gathering user metrics. |
Debug | Verbose debug logging. |
Info | Useful information in case an error has to be understood. |
Warning | These error messages should not occur in a expected usage, and should be investigated. |
Error | Such log messages must never occur in expected usage. |
Instances
Bounded Priority Source # | |
Enum Priority Source # | |
Defined in Development.IDE.Types.Logger | |
Eq Priority Source # | |
Ord Priority Source # | |
Defined in Development.IDE.Types.Logger | |
Show Priority Source # | |
An HscEnv
with equality. Two values are considered equal
if they are created with the same call to newHscEnvEq
.
hscEnvWithImportPaths :: HscEnvEq -> HscEnv Source #
Unwrap the HscEnv
with the original import paths.
Used only for locating imports
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 # | |
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 IdeGhcSession Source #
IdeGhcSession | |
|
Instances
Show IdeGhcSession Source # | |
Defined in Development.IDE.Core.RuleTypes showsPrec :: Int -> IdeGhcSession -> ShowS # show :: IdeGhcSession -> String # showList :: [IdeGhcSession] -> ShowS # | |
NFData IdeGhcSession Source # | |
Defined in Development.IDE.Core.RuleTypes rnf :: IdeGhcSession -> () # |
data AddWatchedFile Source #
Instances
Eq AddWatchedFile Source # | |
Defined in Development.IDE.Core.RuleTypes (==) :: AddWatchedFile -> AddWatchedFile -> Bool # (/=) :: AddWatchedFile -> AddWatchedFile -> Bool # | |
Show AddWatchedFile Source # | |
Defined in Development.IDE.Core.RuleTypes showsPrec :: Int -> AddWatchedFile -> ShowS # show :: AddWatchedFile -> String # showList :: [AddWatchedFile] -> ShowS # | |
Generic AddWatchedFile Source # | |
Defined in Development.IDE.Core.RuleTypes type Rep AddWatchedFile :: Type -> Type # from :: AddWatchedFile -> Rep AddWatchedFile x # to :: Rep AddWatchedFile x -> AddWatchedFile # | |
Hashable AddWatchedFile Source # | |
Defined in Development.IDE.Core.RuleTypes hashWithSalt :: Int -> AddWatchedFile -> Int # hash :: AddWatchedFile -> Int # | |
NFData AddWatchedFile Source # | |
Defined in Development.IDE.Core.RuleTypes rnf :: AddWatchedFile -> () # | |
type Rep AddWatchedFile Source # | |
type RuleResult AddWatchedFile Source # | |
Defined in Development.IDE.Core.RuleTypes |
data GetClientSettings Source #
Get the vscode client settings stored in the ide state
Instances
data GetModSummary Source #
Instances
data GetModSummaryWithoutTimestamps Source #
Instances
Eq GetModSummaryWithoutTimestamps Source # | |
Show GetModSummaryWithoutTimestamps Source # | |
Defined in Development.IDE.Core.RuleTypes | |
Generic GetModSummaryWithoutTimestamps Source # | |
Defined in Development.IDE.Core.RuleTypes type Rep GetModSummaryWithoutTimestamps :: Type -> Type # | |
Hashable GetModSummaryWithoutTimestamps Source # | |
Defined in Development.IDE.Core.RuleTypes hashWithSalt :: Int -> GetModSummaryWithoutTimestamps -> Int # | |
NFData GetModSummaryWithoutTimestamps Source # | |
Defined in Development.IDE.Core.RuleTypes rnf :: GetModSummaryWithoutTimestamps -> () # | |
type Rep GetModSummaryWithoutTimestamps Source # | |
type RuleResult GetModSummaryWithoutTimestamps Source # | Generate a ModSummary with the timestamps and preprocessed content elided, for more successful early cutoff |
data IsFileOfInterest Source #
Instances
Eq IsFileOfInterest Source # | |
Defined in Development.IDE.Core.RuleTypes (==) :: IsFileOfInterest -> IsFileOfInterest -> Bool # (/=) :: IsFileOfInterest -> IsFileOfInterest -> Bool # | |
Show IsFileOfInterest Source # | |
Defined in Development.IDE.Core.RuleTypes showsPrec :: Int -> IsFileOfInterest -> ShowS # show :: IsFileOfInterest -> String # showList :: [IsFileOfInterest] -> ShowS # | |
Generic IsFileOfInterest Source # | |
Defined in Development.IDE.Core.RuleTypes type Rep IsFileOfInterest :: Type -> Type # from :: IsFileOfInterest -> Rep IsFileOfInterest x # to :: Rep IsFileOfInterest x -> IsFileOfInterest # | |
Hashable IsFileOfInterest Source # | |
Defined in Development.IDE.Core.RuleTypes hashWithSalt :: Int -> IsFileOfInterest -> Int # hash :: IsFileOfInterest -> Int # | |
NFData IsFileOfInterest Source # | |
Defined in Development.IDE.Core.RuleTypes rnf :: IsFileOfInterest -> () # | |
type Rep IsFileOfInterest Source # | |
type RuleResult IsFileOfInterest Source # | |
Defined in Development.IDE.Core.RuleTypes |
data GetModIface Source #
Instances
Eq GetModIface Source # | |
Defined in Development.IDE.Core.RuleTypes (==) :: GetModIface -> GetModIface -> Bool # (/=) :: GetModIface -> GetModIface -> Bool # | |
Show GetModIface Source # | |
Defined in Development.IDE.Core.RuleTypes showsPrec :: Int -> GetModIface -> ShowS # show :: GetModIface -> String # showList :: [GetModIface] -> ShowS # | |
Generic GetModIface Source # | |
Defined in Development.IDE.Core.RuleTypes type Rep GetModIface :: Type -> Type # from :: GetModIface -> Rep GetModIface x # to :: Rep GetModIface x -> GetModIface # | |
Hashable GetModIface Source # | |
Defined in Development.IDE.Core.RuleTypes hashWithSalt :: Int -> GetModIface -> Int # hash :: GetModIface -> Int # | |
NFData GetModIface Source # | |
Defined in Development.IDE.Core.RuleTypes rnf :: GetModIface -> () # | |
type Rep GetModIface Source # | |
type RuleResult GetModIface Source # | Get a module interface details, either from an interface file or a typechecked module |
Defined in Development.IDE.Core.RuleTypes |
data GetModIfaceFromDiskAndIndex Source #
Instances
Eq GetModIfaceFromDiskAndIndex Source # | |
Show GetModIfaceFromDiskAndIndex Source # | |
Defined in Development.IDE.Core.RuleTypes showsPrec :: Int -> GetModIfaceFromDiskAndIndex -> ShowS # show :: GetModIfaceFromDiskAndIndex -> String # showList :: [GetModIfaceFromDiskAndIndex] -> ShowS # | |
Generic GetModIfaceFromDiskAndIndex Source # | |
Defined in Development.IDE.Core.RuleTypes type Rep GetModIfaceFromDiskAndIndex :: Type -> Type # | |
Hashable GetModIfaceFromDiskAndIndex Source # | |
Defined in Development.IDE.Core.RuleTypes hashWithSalt :: Int -> GetModIfaceFromDiskAndIndex -> Int # hash :: GetModIfaceFromDiskAndIndex -> Int # | |
NFData GetModIfaceFromDiskAndIndex Source # | |
Defined in Development.IDE.Core.RuleTypes rnf :: GetModIfaceFromDiskAndIndex -> () # | |
type Rep GetModIfaceFromDiskAndIndex Source # | |
type RuleResult GetModIfaceFromDiskAndIndex Source # | GetModIfaceFromDisk and index the `.hie` file into the database.
This is an internal rule, use |
Defined in Development.IDE.Core.RuleTypes |
data GetModIfaceFromDisk Source #
Instances
newtype GhcSessionDeps Source #
GhcSessionDeps_ | |
|
pattern GhcSessionDeps :: GhcSessionDeps |
Instances
Eq GhcSessionDeps Source # | |
Defined in Development.IDE.Core.RuleTypes (==) :: GhcSessionDeps -> GhcSessionDeps -> Bool # (/=) :: GhcSessionDeps -> GhcSessionDeps -> Bool # | |
Show GhcSessionDeps Source # | |
Defined in Development.IDE.Core.RuleTypes showsPrec :: Int -> GhcSessionDeps -> ShowS # show :: GhcSessionDeps -> String # showList :: [GhcSessionDeps] -> ShowS # | |
Hashable GhcSessionDeps Source # | |
Defined in Development.IDE.Core.RuleTypes hashWithSalt :: Int -> GhcSessionDeps -> Int # hash :: GhcSessionDeps -> Int # | |
NFData GhcSessionDeps Source # | |
Defined in Development.IDE.Core.RuleTypes rnf :: GhcSessionDeps -> () # | |
type RuleResult GhcSessionDeps Source # | A GHC session preloaded with all the dependencies This rule is also responsible for calling ReportImportCycles for the direct dependencies |
Defined in Development.IDE.Core.RuleTypes |
data GhcSession Source #
Instances
Eq GhcSession Source # | |
Defined in Development.IDE.Core.RuleTypes (==) :: GhcSession -> GhcSession -> Bool # (/=) :: GhcSession -> GhcSession -> Bool # | |
Show GhcSession Source # | |
Defined in Development.IDE.Core.RuleTypes showsPrec :: Int -> GhcSession -> ShowS # show :: GhcSession -> String # showList :: [GhcSession] -> ShowS # | |
Generic GhcSession Source # | |
Defined in Development.IDE.Core.RuleTypes type Rep GhcSession :: Type -> Type # from :: GhcSession -> Rep GhcSession x # to :: Rep GhcSession x -> GhcSession # | |
Hashable GhcSession Source # | |
Defined in Development.IDE.Core.RuleTypes hashWithSalt :: Int -> GhcSession -> Int # hash :: GhcSession -> Int # | |
NFData GhcSession Source # | |
Defined in Development.IDE.Core.RuleTypes rnf :: GhcSession -> () # | |
type Rep GhcSession Source # | |
type RuleResult GhcSession Source # | A GHC session that we reuse. |
Defined in Development.IDE.Core.RuleTypes |
data GetBindings Source #
Instances
Eq GetBindings Source # | |
Defined in Development.IDE.Core.RuleTypes (==) :: GetBindings -> GetBindings -> Bool # (/=) :: GetBindings -> GetBindings -> Bool # | |
Show GetBindings Source # | |
Defined in Development.IDE.Core.RuleTypes showsPrec :: Int -> GetBindings -> ShowS # show :: GetBindings -> String # showList :: [GetBindings] -> ShowS # | |
Generic GetBindings Source # | |
Defined in Development.IDE.Core.RuleTypes type Rep GetBindings :: Type -> Type # from :: GetBindings -> Rep GetBindings x # to :: Rep GetBindings x -> GetBindings # | |
Hashable GetBindings Source # | |
Defined in Development.IDE.Core.RuleTypes hashWithSalt :: Int -> GetBindings -> Int # hash :: GetBindings -> Int # | |
NFData GetBindings Source # | |
Defined in Development.IDE.Core.RuleTypes rnf :: GetBindings -> () # | |
type Rep GetBindings Source # | |
type RuleResult GetBindings Source # | A IntervalMap telling us what is in scope at each point |
Defined in Development.IDE.Core.RuleTypes |
Instances
Eq GetHieAst Source # | |
Show GetHieAst Source # | |
Generic GetHieAst Source # | |
Hashable GetHieAst Source # | |
Defined in Development.IDE.Core.RuleTypes | |
NFData GetHieAst Source # | |
Defined in Development.IDE.Core.RuleTypes | |
type Rep GetHieAst Source # | |
type RuleResult GetHieAst Source # | The uncompressed HieAST |
Defined in Development.IDE.Core.RuleTypes |
Instances
Eq GetDocMap Source # | |
Show GetDocMap Source # | |
Generic GetDocMap Source # | |
Hashable GetDocMap Source # | |
Defined in Development.IDE.Core.RuleTypes | |
NFData GetDocMap Source # | |
Defined in Development.IDE.Core.RuleTypes | |
type Rep GetDocMap Source # | |
type RuleResult GetDocMap Source # | |
Defined in Development.IDE.Core.RuleTypes |
Instances
Eq TypeCheck Source # | |
Show TypeCheck Source # | |
Generic TypeCheck Source # | |
Hashable TypeCheck Source # | |
Defined in Development.IDE.Core.RuleTypes | |
NFData TypeCheck Source # | |
Defined in Development.IDE.Core.RuleTypes | |
type Rep TypeCheck Source # | |
type RuleResult TypeCheck Source # | The type checked version of this file, requires TypeCheck+ |
Defined in Development.IDE.Core.RuleTypes |
data ReportImportCycles Source #
Instances
data GetModuleGraph Source #
Instances
Eq GetModuleGraph Source # | |
Defined in Development.IDE.Core.RuleTypes (==) :: GetModuleGraph -> GetModuleGraph -> Bool # (/=) :: GetModuleGraph -> GetModuleGraph -> Bool # | |
Show GetModuleGraph Source # | |
Defined in Development.IDE.Core.RuleTypes showsPrec :: Int -> GetModuleGraph -> ShowS # show :: GetModuleGraph -> String # showList :: [GetModuleGraph] -> ShowS # | |
Generic GetModuleGraph Source # | |
Defined in Development.IDE.Core.RuleTypes type Rep GetModuleGraph :: Type -> Type # from :: GetModuleGraph -> Rep GetModuleGraph x # to :: Rep GetModuleGraph x -> GetModuleGraph # | |
Hashable GetModuleGraph Source # | |
Defined in Development.IDE.Core.RuleTypes hashWithSalt :: Int -> GetModuleGraph -> Int # hash :: GetModuleGraph -> Int # | |
NFData GetModuleGraph Source # | |
Defined in Development.IDE.Core.RuleTypes rnf :: GetModuleGraph -> () # | |
type Rep GetModuleGraph Source # | |
type RuleResult GetModuleGraph Source # | |
Defined in Development.IDE.Core.RuleTypes |
data GetDependencyInformation Source #
Instances
data NeedsCompilation Source #
Instances
data GetLocatedImports Source #
Instances
data GetParsedModuleWithComments Source #
Instances
Eq GetParsedModuleWithComments Source # | |
Show GetParsedModuleWithComments Source # | |
Defined in Development.IDE.Core.RuleTypes showsPrec :: Int -> GetParsedModuleWithComments -> ShowS # show :: GetParsedModuleWithComments -> String # showList :: [GetParsedModuleWithComments] -> ShowS # | |
Generic GetParsedModuleWithComments Source # | |
Defined in Development.IDE.Core.RuleTypes type Rep GetParsedModuleWithComments :: Type -> Type # | |
Hashable GetParsedModuleWithComments Source # | |
Defined in Development.IDE.Core.RuleTypes hashWithSalt :: Int -> GetParsedModuleWithComments -> Int # hash :: GetParsedModuleWithComments -> Int # | |
NFData GetParsedModuleWithComments Source # | |
Defined in Development.IDE.Core.RuleTypes rnf :: GetParsedModuleWithComments -> () # | |
type Rep GetParsedModuleWithComments Source # | |
type RuleResult GetParsedModuleWithComments Source # | The parse tree for the file using GetFileContents, all comments included using Opt_KeepRawTokenStream |
Defined in Development.IDE.Core.RuleTypes |
data GetParsedModule Source #
Instances
data ModSummaryResult Source #
ModSummaryResult | |
|
Instances
Show ModSummaryResult Source # | |
Defined in Development.IDE.Core.RuleTypes showsPrec :: Int -> ModSummaryResult -> ShowS # show :: ModSummaryResult -> String # showList :: [ModSummaryResult] -> ShowS # | |
NFData ModSummaryResult Source # | |
Defined in Development.IDE.Core.RuleTypes rnf :: ModSummaryResult -> () # |
data IsFileOfInterestResult Source #
Instances
data FileOfInterestStatus Source #
Instances
data GetFileExists Source #
Instances
Eq GetFileExists Source # | |
Defined in Development.IDE.Core.RuleTypes (==) :: GetFileExists -> GetFileExists -> Bool # (/=) :: GetFileExists -> GetFileExists -> Bool # | |
Show GetFileExists Source # | |
Defined in Development.IDE.Core.RuleTypes showsPrec :: Int -> GetFileExists -> ShowS # show :: GetFileExists -> String # showList :: [GetFileExists] -> ShowS # | |
Generic GetFileExists Source # | |
Defined in Development.IDE.Core.RuleTypes type Rep GetFileExists :: Type -> Type # from :: GetFileExists -> Rep GetFileExists x # to :: Rep GetFileExists x -> GetFileExists # | |
Hashable GetFileExists Source # | |
Defined in Development.IDE.Core.RuleTypes hashWithSalt :: Int -> GetFileExists -> Int # hash :: GetFileExists -> Int # | |
NFData GetFileExists Source # | |
Defined in Development.IDE.Core.RuleTypes rnf :: GetFileExists -> () # | |
type Rep GetFileExists Source # | |
type RuleResult GetFileExists Source # | |
Defined in Development.IDE.Core.RuleTypes |
data GetFileContents Source #
Instances
data FileVersion Source #
Instances
Show FileVersion Source # | |
Defined in Development.IDE.Core.RuleTypes showsPrec :: Int -> FileVersion -> ShowS # show :: FileVersion -> String # showList :: [FileVersion] -> ShowS # | |
Generic FileVersion Source # | |
Defined in Development.IDE.Core.RuleTypes type Rep FileVersion :: Type -> Type # from :: FileVersion -> Rep FileVersion x # to :: Rep FileVersion x -> FileVersion # | |
NFData FileVersion Source # | |
Defined in Development.IDE.Core.RuleTypes rnf :: FileVersion -> () # | |
type Rep FileVersion Source # | |
Defined in Development.IDE.Core.RuleTypes type Rep FileVersion = D1 ('MetaData "FileVersion" "Development.IDE.Core.RuleTypes" "ghcide-1.6.0.0-6rn0EpOlTRZ4j4Z1t1BPzW" 'False) (C1 ('MetaCons "VFSVersion" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int32)) :+: C1 ('MetaCons "ModificationTime" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 POSIXTime))) |
newtype GetModificationTime Source #
GetModificationTime_ | |
|
Instances
data DocAndKindMap Source #
DKMap | |
|
Instances
Show DocAndKindMap Source # | |
Defined in Development.IDE.Core.RuleTypes showsPrec :: Int -> DocAndKindMap -> ShowS # show :: DocAndKindMap -> String # showList :: [DocAndKindMap] -> ShowS # | |
NFData DocAndKindMap Source # | |
Defined in Development.IDE.Core.RuleTypes rnf :: DocAndKindMap -> () # |
data HieAstResult Source #
Save the uncompressed AST here, we compress it just before writing to disk
forall a. HAR | |
Instances
Show HieAstResult Source # | |
Defined in Development.IDE.Core.RuleTypes showsPrec :: Int -> HieAstResult -> ShowS # show :: HieAstResult -> String # showList :: [HieAstResult] -> ShowS # | |
NFData HieAstResult Source # | |
Defined in Development.IDE.Core.RuleTypes rnf :: HieAstResult -> () # |
data HiFileResult Source #
HiFileResult | |
|
Instances
Show HiFileResult Source # | |
Defined in Development.IDE.Core.RuleTypes showsPrec :: Int -> HiFileResult -> ShowS # show :: HiFileResult -> String # showList :: [HiFileResult] -> ShowS # | |
NFData HiFileResult Source # | |
Defined in Development.IDE.Core.RuleTypes rnf :: HiFileResult -> () # |
data TcModuleResult Source #
Contains the typechecked module and the OrigNameCache entry for that module.
TcModuleResult | |
|
Instances
Show TcModuleResult Source # | |
Defined in Development.IDE.Core.RuleTypes showsPrec :: Int -> TcModuleResult -> ShowS # show :: TcModuleResult -> String # showList :: [TcModuleResult] -> ShowS # | |
NFData TcModuleResult Source # | |
Defined in Development.IDE.Core.RuleTypes rnf :: TcModuleResult -> () # |
Splices | |
|
ImportMap | |
|
data GetImportMap Source #
Instances
Eq GetImportMap Source # | |
Defined in Development.IDE.Core.RuleTypes (==) :: GetImportMap -> GetImportMap -> Bool # (/=) :: GetImportMap -> GetImportMap -> Bool # | |
Show GetImportMap Source # | |
Defined in Development.IDE.Core.RuleTypes showsPrec :: Int -> GetImportMap -> ShowS # show :: GetImportMap -> String # showList :: [GetImportMap] -> ShowS # | |
Generic GetImportMap Source # | |
Defined in Development.IDE.Core.RuleTypes type Rep GetImportMap :: Type -> Type # from :: GetImportMap -> Rep GetImportMap x # to :: Rep GetImportMap x -> GetImportMap # | |
Hashable GetImportMap Source # | |
Defined in Development.IDE.Core.RuleTypes hashWithSalt :: Int -> GetImportMap -> Int # hash :: GetImportMap -> Int # | |
NFData GetImportMap Source # | |
Defined in Development.IDE.Core.RuleTypes rnf :: GetImportMap -> () # | |
type Rep GetImportMap Source # | |
type RuleResult GetImportMap Source # | |
Defined in Development.IDE.Core.RuleTypes |
data GenerateCore Source #
Instances
Eq GenerateCore Source # | |
Defined in Development.IDE.Core.RuleTypes (==) :: GenerateCore -> GenerateCore -> Bool # (/=) :: GenerateCore -> GenerateCore -> Bool # | |
Show GenerateCore Source # | |
Defined in Development.IDE.Core.RuleTypes showsPrec :: Int -> GenerateCore -> ShowS # show :: GenerateCore -> String # showList :: [GenerateCore] -> ShowS # | |
Generic GenerateCore Source # | |
Defined in Development.IDE.Core.RuleTypes type Rep GenerateCore :: Type -> Type # from :: GenerateCore -> Rep GenerateCore x # to :: Rep GenerateCore x -> GenerateCore # | |
Hashable GenerateCore Source # | |
Defined in Development.IDE.Core.RuleTypes hashWithSalt :: Int -> GenerateCore -> Int # hash :: GenerateCore -> Int # | |
NFData GenerateCore Source # | |
Defined in Development.IDE.Core.RuleTypes rnf :: GenerateCore -> () # | |
type Rep GenerateCore Source # | |
type RuleResult GenerateCore Source # | Convert to Core, requires TypeCheck* |
Defined in Development.IDE.Core.RuleTypes |
data GetKnownTargets Source #
Instances
data LinkableType Source #
Instances
pattern GetModificationTime :: GetModificationTime Source #
encodeLinkableType :: Maybe LinkableType -> ByteString Source #
Encode the linkable into an ordered bytestring.
This is used to drive an ordered "newness" predicate in the
NeedsCompilation
build rule.
mkHiFileResult :: ModSummary -> HomeModInfo -> HiFileResult Source #
hirModIface :: HiFileResult -> ModIface Source #
vfsVersion :: FileVersion -> Maybe Int32 Source #
awSplicesL :: Lens' Splices [(LHsExpr GhcTc, Serialized)] Source #
Rule (k -> NormalizedFilePath -> Action (Maybe ByteString, IdeResult v)) | |
RuleNoDiagnostics (k -> NormalizedFilePath -> Action (Maybe ByteString, Maybe v)) | |
RuleWithCustomNewnessCheck | |
|
IdeActions are used when we want to return a result immediately, even if it is stale Useful for UI actions like hover, completion where we don't want to block.
Run via runIdeAction
.
Instances
Monad IdeAction Source # | |
Functor IdeAction Source # | |
Applicative IdeAction Source # | |
MonadIO IdeAction Source # | |
Defined in Development.IDE.Core.Shake | |
MonadReader ShakeExtras IdeAction Source # | |
Defined in Development.IDE.Core.Shake ask :: IdeAction ShakeExtras # local :: (ShakeExtras -> ShakeExtras) -> IdeAction a -> IdeAction a # reader :: (ShakeExtras -> a) -> IdeAction a # |
A Shake database plus persistent store. Can be thought of as storing
mappings from (FilePath, k)
to RuleResult k
.
type IdeRule k v = (RuleResult k ~ v, ShakeValue k, Show v, Typeable v, NFData v) Source #
data ShakeExtras Source #
Instances
MonadReader ShakeExtras IdeAction Source # | |
Defined in Development.IDE.Core.Shake ask :: IdeAction ShakeExtras # local :: (ShakeExtras -> ShakeExtras) -> IdeAction a -> IdeAction a # reader :: (ShakeExtras -> a) -> IdeAction a # |
getPluginConfig :: MonadLsp Config m => PluginId -> m PluginConfig Source #
define :: IdeRule k v => (k -> NormalizedFilePath -> Action (IdeResult v)) -> Rules () Source #
Define a new Rule without early cutoff
defineNoDiagnostics :: IdeRule k v => (k -> NormalizedFilePath -> Action (Maybe v)) -> Rules () Source #
use :: IdeRule k v => k -> NormalizedFilePath -> Action (Maybe v) Source #
Request a Rule result if available
useWithStale :: IdeRule k v => k -> NormalizedFilePath -> Action (Maybe (v, PositionMapping)) Source #
Request a Rule result, it not available return the last computed result, if any, which may be stale
useWithStale_ :: IdeRule k v => k -> NormalizedFilePath -> Action (v, PositionMapping) Source #
Request a Rule result, it not available return the last computed result which may be stale. Errors out if none available.
runIdeAction :: String -> ShakeExtras -> IdeAction a -> IO a Source #
useWithStaleFast :: IdeRule k v => k -> NormalizedFilePath -> IdeAction (Maybe (v, PositionMapping)) Source #
Lookup value in the database and return with the stale value immediately Will queue an action to refresh the value. Might block the first time the rule runs, but never blocks after that.
useWithStaleFast' :: IdeRule k v => k -> NormalizedFilePath -> IdeAction (FastResult v) Source #
Same as useWithStaleFast but lets you wait for an up to date result
useNoFile_ :: IdeRule k v => k -> Action v Source #
defineEarlyCutoff :: IdeRule k v => RuleBody k v -> Rules () Source #
Define a new Rule with early cutoff
Plugin | |
|
data IdeConfiguration Source #
Lsp client relevant configuration details
Instances
Show IdeConfiguration Source # | |
Defined in Development.IDE.Core.IdeConfiguration showsPrec :: Int -> IdeConfiguration -> ShowS # show :: IdeConfiguration -> String # showList :: [IdeConfiguration] -> ShowS # |
getFileContents :: NormalizedFilePath -> Action (UTCTime, Maybe Text) Source #
Returns the modification time and the contents. For VFS paths, the modification time is the current time.
getFileExists :: NormalizedFilePath -> Action Bool Source #
Returns True if the file exists
Note that a file is not considered to exist unless it is saved to disk.
In particular, VFS existence is not enough.
Consider the following example:
1. The file A.hs
containing the line import B
is added to the files of interest
Since B.hs
is neither open nor exists, GetLocatedImports finds Nothing
2. The editor creates a new buffer B.hs
Unless the editor also sends a DidChangeWatchedFile
event, ghcide will not pick it up
Most editors, e.g. VSCode, only send the event when the file is saved to disk.
getAtPoint :: NormalizedFilePath -> Position -> IdeAction (Maybe (Maybe Range, [Text])) Source #
Try to get hover text for the name under point.
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 #
getDefinition :: NormalizedFilePath -> Position -> IdeAction (Maybe [Location]) Source #
Goto Definition.
getTypeDefinition :: NormalizedFilePath -> Position -> IdeAction (Maybe [Location]) Source #
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 # | |
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 |
getParsedModule :: NormalizedFilePath -> Action (Maybe ParsedModule) Source #
Parse the contents of a haskell file.