Skip to content

Commit e1ccfca

Browse files
committed
added support for passing workrspae path from outside
1 parent 8618d5a commit e1ccfca

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

codetide/mcp/utils.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from ..core.defaults import DEFAULT_SERIALIZATION_PATH
22
from codetide import CodeTide
33

4+
from typing import Optional
45
from pathlib import Path
56
import time
67
import os
@@ -31,10 +32,12 @@ def safe_print(string :str):
3132
# Fallback to ASCII-safe output
3233
print(string.encode('ascii', 'replace').decode('ascii'))
3334

34-
async def initCodeTide(force_build: bool = False, flush: bool = False)->CodeTide:
35+
async def initCodeTide(force_build: bool = False, flush: bool = False, workspace :Optional[Path]=None)->CodeTide:
3536
"""Initializes CodeTide instance either from cache or fresh parse, with serialization options."""
3637

37-
workspace = getWorkspace()
38+
if not workspace:
39+
workspace = getWorkspace()
40+
3841
storagePath = workspace / DEFAULT_SERIALIZATION_PATH
3942
try:
4043
if force_build:

0 commit comments

Comments
 (0)