Skip to content

Commit c48b79f

Browse files
committed
misc fixes [VSC]
1 parent daa7627 commit c48b79f

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

codeflash/cli_cmds/cmd_init.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1356,7 +1356,7 @@ def ask_for_telemetry() -> bool:
13561356
from rich.prompt import Confirm
13571357

13581358
return Confirm.ask(
1359-
"⚡️ Would you like to enable telemetry to help us improve the Codeflash experience?",
1359+
"⚡️ Help us improve Codeflash by sharing anonymous usage data (e.g., commands run, errors encountered)?",
13601360
default=True,
13611361
show_default=True,
13621362
)

codeflash/lsp/beta.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,34 @@ def get_config_suggestions(_params: any) -> dict[str, any]:
206206
formatter_suggestions, default_formatter = get_suggestions(CommonSections.formatter_cmds)
207207
get_valid_subdirs.cache_clear()
208208

209+
# Provide sensible fallbacks when no subdirectories are found
210+
# Only suggest directories that actually exist in the workspace
211+
if not module_root_suggestions:
212+
cwd = Path.cwd()
213+
common_module_dirs = ["src", "lib", "app"]
214+
module_root_suggestions = ["."] # Always include current directory
215+
216+
# Add common patterns only if they exist
217+
for dir_name in common_module_dirs:
218+
if (cwd / dir_name).is_dir():
219+
module_root_suggestions.append(dir_name)
220+
221+
default_module_root = "."
222+
223+
if not tests_root_suggestions:
224+
cwd = Path.cwd()
225+
common_test_dirs = ["tests", "test", "__tests__"]
226+
tests_root_suggestions = []
227+
228+
# Add common test directories only if they exist
229+
for dir_name in common_test_dirs:
230+
if (cwd / dir_name).is_dir():
231+
tests_root_suggestions.append(dir_name)
232+
233+
# Always include current directory as fallback
234+
tests_root_suggestions.append(".")
235+
default_tests_root = tests_root_suggestions[0] if tests_root_suggestions else "."
236+
209237
configured_module_root = Path(server.args.module_root).relative_to(Path.cwd()) if server.args.module_root else None
210238
configured_tests_root = Path(server.args.tests_root).relative_to(Path.cwd()) if server.args.tests_root else None
211239
configured_test_framework = server.args.test_framework if server.args.test_framework else None

0 commit comments

Comments
 (0)