File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,13 @@ class SearchClient(
2222): ...
2323
2424
25+ @runtime_checkable
26+ class CanResolveWorkspaceSymbol (Protocol ):
27+ async def resolve_workspace_symbols (
28+ self , symbols : Sequence [WorkspaceSymbol ]
29+ ) -> Sequence [WorkspaceSymbol ]: ...
30+
31+
2532@define
2633class SearchCapability (Capability [SearchClient , SearchRequest , SearchResponse ]):
2734 _symbol_cache : PaginationCache [WorkspaceSymbol ] = Factory (PaginationCache )
@@ -44,7 +51,10 @@ async def fetcher() -> list[WorkspaceSymbol]:
4451 return None
4552
4653 # Resolve items in the current page
47- symbols = await self .client .resolve_workspace_symbols (result .items )
54+ symbols = result .items
55+ if isinstance (self .client , CanResolveWorkspaceSymbol ):
56+ symbols = await self .client .resolve_workspace_symbols (symbols )
57+
4858 items = self ._to_search_items (symbols )
4959
5060 return SearchResponse (
You can’t perform that action at this time.
0 commit comments