Skip to content

Commit 4cb4ace

Browse files
committed
refactor(daemon): replace indexing methods with compilation and ask functionality
- remove METHOD_INDEX and METHOD_SEARCH imports - add METHOD_ASK and METHOD_COMPILE imports - update method routing to handle METHOD_COMPILE and METHOD_ASK - rename _handle_index method to _handle_compile - add json import for potential future use
1 parent 0b34183 commit 4cb4ace

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

src/vectorless_code/daemon/core.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from __future__ import annotations
88

99
import asyncio
10+
import json
1011
import logging
1112
import signal
1213
import time
@@ -20,9 +21,9 @@
2021
ErrorObject,
2122
JSONRPCRequest,
2223
JSONRPCResponse,
23-
METHOD_INDEX,
24+
METHOD_ASK,
25+
METHOD_COMPILE,
2426
METHOD_PING,
25-
METHOD_SEARCH,
2627
METHOD_STATUS,
2728
METHOD_STOP,
2829
)
@@ -272,10 +273,10 @@ async def _dispatch(self, request: JSONRPCRequest) -> JSONRPCResponse:
272273
params = request.params
273274

274275
try:
275-
if method == METHOD_INDEX:
276-
result = await self._handle_index(params)
277-
elif method == METHOD_SEARCH:
278-
result = await self._handle_search(params)
276+
if method == METHOD_COMPILE:
277+
result = await self._handle_compile(params)
278+
elif method == METHOD_ASK:
279+
result = await self._handle_ask(params)
279280
elif method == METHOD_STATUS:
280281
result = await self._handle_status(params)
281282
elif method == METHOD_STOP:
@@ -304,7 +305,7 @@ async def _dispatch(self, request: JSONRPCRequest) -> JSONRPCResponse:
304305
# Request handlers
305306
# ------------------------------------------------------------------
306307

307-
async def _handle_index(self, params: dict) -> dict:
308+
async def _handle_compile(self, params: dict) -> dict:
308309
"""Handle index request."""
309310
from vectorless_code.compile import compile_project
310311

0 commit comments

Comments
 (0)