Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- tacticDesc :: Text -> Text
- tcCommandName :: TacticCommand -> Text
- runIde :: String -> String -> IdeState -> Action a -> IO a
- runCurrentIde :: forall a r. (r ~ RuleResult a, Eq a, Hashable a, Binary a, Show a, Typeable a, NFData a, Show r, Typeable r, NFData r) => String -> IdeState -> NormalizedFilePath -> a -> MaybeT IO (Tracked 'Current r)
- runStaleIde :: forall a r. (r ~ RuleResult a, Eq a, Hashable a, Binary a, Show a, Typeable a, NFData a, Show r, Typeable r, NFData r) => String -> IdeState -> NormalizedFilePath -> a -> MaybeT IO (TrackedStale r)
- unsafeRunStaleIde :: forall a r. (r ~ RuleResult a, Eq a, Hashable a, Binary a, Show a, Typeable a, NFData a, Show r, Typeable r, NFData r) => String -> IdeState -> NormalizedFilePath -> a -> MaybeT IO r
- properties :: Properties '['PropertyKey "hole_severity" ('TEnum (Maybe DiagnosticSeverity)), 'PropertyKey "max_use_ctor_actions" 'TInteger, 'PropertyKey "timeout_duration" 'TInteger, 'PropertyKey "auto_gas" 'TInteger]
- getTacticConfig :: MonadLsp Config m => PluginId -> m Config
- getIdeDynflags :: IdeState -> NormalizedFilePath -> MaybeT IO DynFlags
- getAllMetaprograms :: Data a => a -> [String]
- judgementForHole :: IdeState -> NormalizedFilePath -> Tracked 'Current Range -> Config -> MaybeT IO HoleJudgment
- holeSortFor :: Maybe Text -> HoleSort
- mkJudgementAndContext :: Config -> Type -> TrackedStale Bindings -> Tracked 'Current RealSrcSpan -> TrackedStale TcGblEnv -> ExternalPackageState -> KnownThings -> Maybe (Judgement, Context)
- getAlreadyDestructed :: Tracked age SrcSpan -> Tracked age (LHsBinds GhcTc) -> Set OccName
- getSpanAndTypeAtHole :: Tracked age Range -> Tracked age (HieASTs b) -> Maybe (Tracked age RealSrcSpan, b)
- spliceProvenance :: Hypothesis a -> Hypothesis a -> Hypothesis a
- getRhsPosVals :: Tracked age RealSrcSpan -> Tracked age TypecheckedSource -> Hypothesis CType
- buildTopLevelHypothesis :: OccName -> [PatCompat GhcTc] -> State Int (Hypothesis CType)
- buildPatHy :: Provenance -> PatCompat GhcTc -> State Int (Hypothesis CType)
- mkDerivedRecordHypothesis :: Provenance -> ConLike -> [Type] -> HsRecFields GhcTc (PatCompat GhcTc) -> State Int (Hypothesis CType)
- mkFakeVar :: State Int OccName
- mkDerivedConHypothesis :: Provenance -> ConLike -> [Type] -> [(Int, PatCompat GhcTc)] -> State Int (Hypothesis CType)
- mkIdHypothesis :: Id -> Provenance -> Hypothesis CType
- isRhsHole :: Tracked age RealSrcSpan -> Tracked age TypecheckedSource -> Bool
- ufmSeverity :: UserFacingMessage -> MessageType
- mkShowMessageParams :: UserFacingMessage -> ShowMessageParams
- showLspMessage :: MonadLsp cfg m => ShowMessageParams -> m ()
- data WriteDiagnostics = WriteDiagnostics
- wingmanRules :: PluginId -> Rules ()
- mkDiagnostic :: DiagnosticSeverity -> Range -> Diagnostic
- mkWorkspaceEdits :: DynFlags -> ClientCapabilities -> Uri -> Annotated ParsedSource -> Graft (Either String) ParsedSource -> Either UserFacingMessage WorkspaceEdit
- annotateMetaprograms :: Data a => a -> Transform a
- getMetaprogramAtSpan :: Tracked age SrcSpan -> Tracked age TcGblEnv -> Maybe Text
- getParserState :: IdeState -> NormalizedFilePath -> Context -> MaybeT IO ParserContext
Documentation
tacticDesc :: Text -> Text Source #
tcCommandName :: TacticCommand -> Text Source #
The name of the command for the LS.
runCurrentIde :: forall a r. (r ~ RuleResult a, Eq a, Hashable a, Binary a, Show a, Typeable a, NFData a, Show r, Typeable r, NFData r) => String -> IdeState -> NormalizedFilePath -> a -> MaybeT IO (Tracked 'Current r) Source #
runStaleIde :: forall a r. (r ~ RuleResult a, Eq a, Hashable a, Binary a, Show a, Typeable a, NFData a, Show r, Typeable r, NFData r) => String -> IdeState -> NormalizedFilePath -> a -> MaybeT IO (TrackedStale r) Source #
unsafeRunStaleIde :: forall a r. (r ~ RuleResult a, Eq a, Hashable a, Binary a, Show a, Typeable a, NFData a, Show r, Typeable r, NFData r) => String -> IdeState -> NormalizedFilePath -> a -> MaybeT IO r Source #
properties :: Properties '['PropertyKey "hole_severity" ('TEnum (Maybe DiagnosticSeverity)), 'PropertyKey "max_use_ctor_actions" 'TInteger, 'PropertyKey "timeout_duration" 'TInteger, 'PropertyKey "auto_gas" 'TInteger] Source #
getIdeDynflags :: IdeState -> NormalizedFilePath -> MaybeT IO DynFlags Source #
getAllMetaprograms :: Data a => a -> [String] Source #
judgementForHole :: IdeState -> NormalizedFilePath -> Tracked 'Current Range -> Config -> MaybeT IO HoleJudgment Source #
Find the last typechecked module, and find the most specific span, as well as the judgement at the given range.
mkJudgementAndContext :: Config -> Type -> TrackedStale Bindings -> Tracked 'Current RealSrcSpan -> TrackedStale TcGblEnv -> ExternalPackageState -> KnownThings -> Maybe (Judgement, Context) Source #
getAlreadyDestructed :: Tracked age SrcSpan -> Tracked age (LHsBinds GhcTc) -> Set OccName Source #
Determine which bindings have already been destructed by the location of the hole.
getSpanAndTypeAtHole :: Tracked age Range -> Tracked age (HieASTs b) -> Maybe (Tracked age RealSrcSpan, b) Source #
:: Hypothesis a | Bindings to keep |
-> Hypothesis a | Bindings to keep if they don't overlap with the first set |
-> Hypothesis a |
Combine two (possibly-overlapping) hypotheses; using the provenance from the first hypothesis if the bindings overlap.
getRhsPosVals :: Tracked age RealSrcSpan -> Tracked age TypecheckedSource -> Hypothesis CType Source #
Compute top-level position vals of a function
buildTopLevelHypothesis Source #
Construct a hypothesis given the patterns from the left side of a HsMatch. These correspond to things that the user put in scope before running tactics.
buildPatHy :: Provenance -> PatCompat GhcTc -> State Int (Hypothesis CType) Source #
Construct a hypothesis for a single pattern, including building sub-hypotheses for constructor pattern matches.
mkDerivedRecordHypothesis Source #
:: Provenance | |
-> ConLike | Destructing constructor |
-> [Type] | Applied type variables |
-> HsRecFields GhcTc (PatCompat GhcTc) | |
-> State Int (Hypothesis CType) |
Like mkDerivedConHypothesis
, but for record patterns.
mkFakeVar :: State Int OccName Source #
Construct a fake variable name. Used to track the provenance of top-level
pattern matches which otherwise wouldn't have anything to attach their
TopLevelArgPrv
to.
mkDerivedConHypothesis Source #
:: Provenance | |
-> ConLike | Destructing constructor |
-> [Type] | Applied type variables |
-> [(Int, PatCompat GhcTc)] | Patterns, and their order in the data con |
-> State Int (Hypothesis CType) |
Construct a fake varible to attach the current Provenance
to, and then
build a sub-hypothesis for the pattern match.
mkIdHypothesis :: Id -> Provenance -> Hypothesis CType Source #
Build a Hypothesis
given an Id
.
isRhsHole :: Tracked age RealSrcSpan -> Tracked age TypecheckedSource -> Bool Source #
Is this hole immediately to the right of an equals sign?
showLspMessage :: MonadLsp cfg m => ShowMessageParams -> m () Source #
data WriteDiagnostics Source #
Instances
wingmanRules :: PluginId -> Rules () Source #
mkDiagnostic :: DiagnosticSeverity -> Range -> Diagnostic Source #
mkWorkspaceEdits :: DynFlags -> ClientCapabilities -> Uri -> Annotated ParsedSource -> Graft (Either String) ParsedSource -> Either UserFacingMessage WorkspaceEdit Source #
Transform a Graft
over the AST into a WorkspaceEdit
.
annotateMetaprograms :: Data a => a -> Transform a Source #
Add ExactPrint annotations to every metaprogram in the source tree. Usually the ExactPrint module can do this for us, but we've enabled QuasiQuotes, so the round-trip print/parse journey will crash.
getMetaprogramAtSpan :: Tracked age SrcSpan -> Tracked age TcGblEnv -> Maybe Text Source #
Find the source of a tactic metaprogram at the given span.
getParserState :: IdeState -> NormalizedFilePath -> Context -> MaybeT IO ParserContext Source #
The metaprogram parser needs the ability to lookup terms from the module
and imports. The ParserContext
contains everything we need to find that
stuff.