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

Method GetLanguageService

internal/project/session.go:988–994  ·  view source on GitHub ↗
(ctx context.Context, uri lsproto.DocumentUri)

Source from the content-addressed store, hash-verified

986}
987
988func (s *Session) GetLanguageService(ctx context.Context, uri lsproto.DocumentUri) (*ls.LanguageService, error) {
989 _, _, languageService, err := s.getSnapshotAndDefaultProject(ctx, uri, false /*callerRef*/)
990 if err != nil {
991 return nil, err
992 }
993 return languageService, nil
994}
995
996func (s *Session) GetLanguageServiceAndProjectsForFile(ctx context.Context, uri lsproto.DocumentUri) (*Project, *ls.LanguageService, []ls.Project, error) {
997 snapshot, project, defaultLs, err := s.getSnapshotAndDefaultProject(ctx, uri, false /*callerRef*/)

Calls 1

Tested by 15

TestRefCountingCachesFunction · 0.76
TestSnapshotFunction · 0.76
TestRegistryLifecycleFunction · 0.64
TestUntitledReferencesFunction · 0.64
TestImportsInUntitledFunction · 0.64