src/lsp/files/service.bend checks
raw source on the hub · import 0x013e0f9a479bbebad5ed196725eede95/src/lsp/files/service.bend as Service
files: an effect service: a file's text by path, where Base lives, and the working directory a relative path is read against.
1 import
import Base
Types
type Files source · line 6 · raw
Type
effect service: a file's text, where Base is, and the working directory
Files@read:(@_:String -> IO(Maybe<&2, String>)) -> @base_path:(@_:Unit -> IO(String)) -> @cwd:(@_:Unit -> IO(String)) -> Files
Definitions
def read source · line 10 · raw
@ff:Files -> @path:String -> IO(Maybe<&2, String>)
None when the file cannot be read
def base_path source · line 15 · raw
@ff:Files -> IO(String)
the path of Base, from a files service
def cwd source · line 20 · raw
@ff:Files -> IO(String)
the working directory, from the root; "" when it cannot be named
Templates
template read_all source · line 25 · raw
@-ff:Files -> @paths:List<&2, String> -> IO(List<&2, Maybe<&2, String>>)
every path read, in order (a missing file is a None)