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

Function NewSession

internal/api/session.go:416–427  ·  view source on GitHub ↗

NewSession creates a new API session with the given project session.

(projectSession *project.Session, options *SessionOptions)

Source from the content-addressed store, hash-verified

414
415// NewSession creates a new API session with the given project session.
416func NewSession(projectSession *project.Session, options *SessionOptions) *Session {
417 id := sessionIDCounter.Add(1)
418 s := &Session{
419 id: formatSessionID(id),
420 projectSession: projectSession,
421 snapshots: make(map[SnapshotID]*snapshotData),
422 }
423 if options != nil {
424 s.useBinaryResponses = options.UseBinaryResponses
425 }
426 return s
427}
428
429// ID returns the unique identifier for this session.
430func (s *Session) ID() string {

Calls 3

formatSessionIDFunction · 0.85
AddMethod · 0.65
makeFunction · 0.50