Minor refactor in open_symbol_search

jsonrpc_err_in_rent_task
Nelson Torres 2024-11-08 21:58:06 +00:00
parent ea6126d310
commit 266ecf6206
1 changed files with 12 additions and 3 deletions

View File

@ -276,7 +276,16 @@ async def open_symbol_search(
async with ctx.open_stream() as stream:
pattern: str
async for pattern in stream:
# repack in dict form
await stream.send(
await client.search_symbols(pattern))
# NOTE: pattern fuzzy-matching is done within
# the methd impl.
pairs: dict[str, Pair] = await client.search_symbols(
pattern,
)
# repack in fqme-keyed table
byfqme: dict[str, Pair] = {}
for pair in pairs.values():
byfqme[pair.bs_fqme] = pair
await stream.send(byfqme)