MCPcopy Create free account
hub / github.com/Effect-TS/effect / parseFile

Function parseFile

packages/tools/docgen/src/Parser.ts:690–701  ·  view source on GitHub ↗
(project: ast.Project)

Source from the content-addressed store, hash-verified

688 */
689export const parseFile =
690 (project: ast.Project) =>
691 (file: Domain.File): Effect.Effect<Domain.Module, Array<string>, Configuration.Configuration | Path.Path> => {
692 return Effect.gen(function*() {
693 const path = yield* Path.Path
694 const sourceFile = project.getSourceFile(file.path)
695 const filePath = file.path.split(path.sep)
696 if (sourceFile !== undefined && Array.isArrayNonEmpty(filePath)) {
697 return yield* Effect.provideService(parseModule, Source, { sourceFile, path: filePath })
698 }
699 return yield* Effect.fail([`Unable to locate file: ${file.path}`])
700 })
701 }
702
703const createProject = (files: ReadonlyArray<Domain.File>) =>
704 Effect.gen(function*() {

Callers 1

parseFilesFunction · 0.85

Calls 2

splitMethod · 0.45
failMethod · 0.45

Tested by

no test coverage detected