Skip to content

Commit 032e33e

Browse files
committed
update
1 parent 2422185 commit 032e33e

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

python/src/lsap/search.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff 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
2633
class 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(

python/test.py

Whitespace-only changes.

0 commit comments

Comments
 (0)