-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | See README on Github for more information -- -- static-ls ("static language server") reads static project information -- to provide IDE functionality through the language server protocol. -- static-ls will not generate this information on its own and instead -- will rely on the user to generate this information via separate -- programs @package static-ls @version 0.1.0 module StaticLS.Except exceptToMaybe :: Except a b -> Maybe b module StaticLS.HIE hieAstNodeToIdentifiers :: HieAST a -> [Identifier] identifiersToNames :: [Identifier] -> [Name] hieAstToNames :: HieAST a -> [Name] hieAstsAtPoint :: HieFile -> HieDbCoords -> Maybe HieDbCoords -> [HieAST TypeIndex] hiedbCoordsToLspPosition :: Monad m => HieDbCoords -> ExceptT UIntConversionException m Position lspPositionToHieDbCoords :: Position -> HieDbCoords instance GHC.Show.Show StaticLS.HIE.UIntConversionException instance GHC.Exception.Type.Exception StaticLS.HIE.UIntConversionException module StaticLS.HIE.File.Except data HieFileReadException HieFileReadException :: HieFileReadException HieFileVersionException :: HieHeader -> HieFileReadException instance GHC.Show.Show StaticLS.HIE.File.Except.HieFileReadException instance GHC.Exception.Type.Exception StaticLS.HIE.File.Except.HieFileReadException module StaticLS.IDE.Hover.Info hoverInfo :: Array TypeIndex HieTypeFlat -> HieAST TypeIndex -> (Maybe Range, [Text]) module StaticLS.Maybe flatMaybeT :: Monad m => MaybeT m (Maybe a) -> MaybeT m a toAlt :: (Functor f, Foldable f, Alternative g) => f a -> g a orDie :: Monad m => Maybe a -> e -> ExceptT e m a orDieT :: Monad m => MaybeT m a -> e -> ExceptT e m a module StaticLS.StaticEnv.Options defaultStaticEnvOptions :: StaticEnvOptions data StaticEnvOptions StaticEnvOptions :: Maybe FilePath -> Maybe FilePath -> StaticEnvOptions -- | Relative path to hiedb file hiedb is required for find references and -- go to definition to work correctly [$sel:optionHieDbPath:StaticEnvOptions] :: StaticEnvOptions -> Maybe FilePath -- | Relative path to hie files directory hie files are required for all -- functionality [$sel:optionHieFilesPath:StaticEnvOptions] :: StaticEnvOptions -> Maybe FilePath module StaticLS.StaticEnv initStaticEnv :: FilePath -> StaticEnvOptions -> IO StaticEnv runStaticLs :: StaticEnv -> StaticLs a -> IO a getStaticEnv :: HasStaticEnv m => m StaticEnv -- | Run an hiedb action in an exceptT runHieDbExceptT :: (HasStaticEnv m, MonadIO m) => (HieDb -> IO a) -> ExceptT HieDbException m a -- | Run an hiedb action with the MaybeT Monad runHieDbMaybeT :: (HasStaticEnv m, MonadIO m) => (HieDb -> IO a) -> MaybeT m a -- | Static environment used to fetch data data StaticEnv StaticEnv :: Maybe HieDbPath -> Maybe HieFilePath -> HscEnv -> NameCache -> FilePath -> StaticEnv -- | Path to the hiedb file [$sel:hieDbPath:StaticEnv] :: StaticEnv -> Maybe HieDbPath [$sel:hieFilesPath:StaticEnv] :: StaticEnv -> Maybe HieFilePath -- | static ghc compiler environment [$sel:hscEnv:StaticEnv] :: StaticEnv -> HscEnv -- | name cache - used for reading hie files [$sel:nameCache:StaticEnv] :: StaticEnv -> NameCache -- | workspace root [$sel:wsRoot:StaticEnv] :: StaticEnv -> FilePath type StaticLs = ReaderT StaticEnv IO type HieDbPath = FilePath type HieFilePath = FilePath type HasStaticEnv = MonadReader StaticEnv instance GHC.Show.Show StaticLS.StaticEnv.HieDbException instance GHC.Exception.Type.Exception StaticLS.StaticEnv.HieDbException module StaticLS.HIE.File -- | Retrieve a hie info from a lsp text document identifier getHieFileFromTdi :: (HasStaticEnv m, MonadIO m) => TextDocumentIdentifier -> MaybeT m HieFile -- | Retrieve an hie file from a hie filepath getHieFile :: (HasCallStack, HasStaticEnv m, MonadIO m) => HieFilePath -> ExceptT HieFileReadException m HieFile -- | Retrieve an hie file from a module name modToHieFile :: (HasStaticEnv m, MonadIO m) => ModuleName -> MaybeT m HieFile -- | Retrieve a src file from a module name modToSrcFile :: (HasStaticEnv m, MonadIO m) => ModuleName -> MaybeT m SrcFilePath -- | Fetch a src file from an hie file, checking hiedb but falling back on -- a file manipulation method if not indexed srcFilePathToHieFilePath :: (HasStaticEnv m, MonadIO m) => SrcFilePath -> MaybeT m HieFilePath -- | Fetch an hie file from a src file hieFilePathToSrcFilePath :: (HasStaticEnv m, MonadIO m) => HieFilePath -> MaybeT m SrcFilePath getHieFileMap :: FilePath -> HieFilePath -> IO (Map SrcFilePath HieInfo) hieFileMapToSrcMap :: Map SrcFilePath HieInfo -> Map HieFilePath SrcFilePath module StaticLS.IDE.References findRefs :: (HasStaticEnv m, MonadIO m) => TextDocumentIdentifier -> Position -> m [Location] module StaticLS.IDE.Hover -- | Retrive hover information. Incomplete retrieveHover :: (HasCallStack, HasStaticEnv m, MonadIO m) => TextDocumentIdentifier -> Position -> m (Maybe Hover) module StaticLS.IDE.Definition getDefinition :: (HasCallStack, HasStaticEnv m, MonadIO m) => TextDocumentIdentifier -> Position -> m [Location] module StaticLS.Server data LspEnv config LspEnv :: StaticEnv -> LanguageContextEnv config -> LspEnv config [$sel:staticEnv:LspEnv] :: LspEnv config -> StaticEnv [$sel:config:LspEnv] :: LspEnv config -> LanguageContextEnv config handleChangeConfiguration :: Handlers (LspT c StaticLs) handleInitialized :: Handlers (LspT c StaticLs) handleTextDocumentHoverRequest :: Handlers (LspT c StaticLs) handleDefinitionRequest :: Handlers (LspT c StaticLs) handleReferencesRequest :: Handlers (LspT c StaticLs) handleCancelNotification :: Handlers (LspT c StaticLs) handleDidOpen :: Handlers (LspT c StaticLs) handleDidChange :: Handlers (LspT c StaticLs) handleDidClose :: Handlers (LspT c StaticLs) handleDidSave :: Handlers (LspT c StaticLs) initServer :: LanguageContextEnv config -> Message 'Initialize -> IO (Either ResponseError (LspEnv config)) serverDef :: ServerDefinition () runServer :: IO Int