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

Method handleWorkspaceSymbol

internal/lsp/server.go:1619–1634  ·  view source on GitHub ↗
(ctx context.Context, params *lsproto.WorkspaceSymbolParams, reqMsg *lsproto.RequestMessage)

Source from the content-addressed store, hash-verified

1617}
1618
1619func (s *Server) handleWorkspaceSymbol(ctx context.Context, params *lsproto.WorkspaceSymbolParams, reqMsg *lsproto.RequestMessage) (lsproto.WorkspaceSymbolResponse, error) {
1620 var resp lsproto.WorkspaceSymbolResponse
1621 var lsErr error
1622 s.session.WithSnapshotLoadingProjectTree(ctx, nil, func(snapshot *project.Snapshot) {
1623 defer s.recover(reqMsg)
1624 programs := core.Map(snapshot.ProjectCollection.Projects(), (*project.Project).GetProgram)
1625 resp, lsErr = ls.ProvideWorkspaceSymbols(
1626 ctx,
1627 programs,
1628 snapshot.Converters(),
1629 snapshot.UserPreferences(),
1630 params.Query,
1631 )
1632 })
1633 return resp, lsErr
1634}
1635
1636func (s *Server) handleDocumentSymbol(ctx context.Context, ls *ls.LanguageService, params *lsproto.DocumentSymbolParams) (lsproto.DocumentSymbolResponse, error) {
1637 return ls.ProvideDocumentSymbols(ctx, params.TextDocument.Uri)

Callers

nothing calls this directly

Calls 7

recoverMethod · 0.95
MapFunction · 0.92
ProvideWorkspaceSymbolsFunction · 0.92
ConvertersMethod · 0.65
ProjectsMethod · 0.45
UserPreferencesMethod · 0.45

Tested by

no test coverage detected