MCPcopy Create free account
hub / github.com/microsoft/typescript-go / getProgram

Method getProgram

internal/api/session.go:73–85  ·  view source on GitHub ↗

getProgram looks up a program from a project handle within this snapshot.

(projectHandle ProjectID)

Source from the content-addressed store, hash-verified

71
72// getProgram looks up a program from a project handle within this snapshot.
73func (sd *snapshotData) getProgram(projectHandle ProjectID) (*compiler.Program, error) {
74 proj, err := sd.getProject(projectHandle)
75 if err != nil {
76 return nil, err
77 }
78
79 program := proj.GetProgram()
80 if program == nil {
81 return nil, fmt.Errorf("%w: project has no program", ErrClientError)
82 }
83
84 return program, nil
85}
86
87// getProject looks up a project from a project handle within this snapshot.
88func (sd *snapshotData) getProject(projectHandle ProjectID) (*project.Project, error) {

Callers

nothing calls this directly

Calls 3

getProjectMethod · 0.95
GetProgramMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected