src/lsp/files/service.bend checks
raw source on the hub · import bolt@1.43.0.0/src/lsp/files/service.bend as Service
files: an effect service: a file's text by path, where Base lives, the working directory a relative path is read against, and a directory's entries (a sub-directory's name ending in "/", as src/walk/ lists them).
1 import
import Base
Types
type Files source · line 8 · raw
Type
effect service: a file's text, where Base is, the working directory, and a directory's entries
Files@read:(@_:String -> IO(Maybe<&2, String>)) -> @base_path:(@_:Unit -> IO(String)) -> @cwd:(@_:Unit -> IO(String)) -> @entries:(@_:String -> IO(List<&2, String>)) -> Files
Definitions
def read source · line 13 · raw
@ff:Files -> @path:String -> IO(Maybe<&2, String>)
None when the file cannot be read
def base_path source · line 18 · raw
@ff:Files -> IO(String)
the path of Base, from a files service
def cwd source · line 23 · raw
@ff:Files -> IO(String)
the working directory, from the root; "" when it cannot be named
def entries source · line 28 · raw
@ff:Files -> @dir:String -> IO(List<&2, String>)
a directory's entries, none when it cannot be opened
Templates
template read_all source · line 33 · raw
@-ff:Files -> @paths:List<&2, String> -> IO(List<&2, Maybe<&2, String>>)
every path read, in order (a missing file is a None)