Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion codeflash/cli_cmds/cmd_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -1356,7 +1356,7 @@ def ask_for_telemetry() -> bool:
from rich.prompt import Confirm

return Confirm.ask(
"⚡️ Would you like to enable telemetry to help us improve the Codeflash experience?",
"⚡️ Help us improve Codeflash by sharing anonymous usage data (e.g., commands run, errors encountered)?",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't even get this data right now. only get posthog events. what do we get from sentry?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are not having cmd runs but errors for sure.

default=True,
show_default=True,
)
28 changes: 28 additions & 0 deletions codeflash/lsp/beta.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,34 @@ def get_config_suggestions(_params: any) -> dict[str, any]:
formatter_suggestions, default_formatter = get_suggestions(CommonSections.formatter_cmds)
get_valid_subdirs.cache_clear()

# Provide sensible fallbacks when no subdirectories are found
# Only suggest directories that actually exist in the workspace
if not module_root_suggestions:
cwd = Path.cwd()
common_module_dirs = ["src", "lib", "app"]
module_root_suggestions = ["."] # Always include current directory

# Add common patterns only if they exist
for dir_name in common_module_dirs:
if (cwd / dir_name).is_dir():
module_root_suggestions.append(dir_name)

default_module_root = "."

if not tests_root_suggestions:
cwd = Path.cwd()
common_test_dirs = ["tests", "test", "__tests__"]
tests_root_suggestions = []

# Add common test directories only if they exist
for dir_name in common_test_dirs:
if (cwd / dir_name).is_dir():
tests_root_suggestions.append(dir_name)

# Always include current directory as fallback
tests_root_suggestions.append(".")
default_tests_root = tests_root_suggestions[0] if tests_root_suggestions else "."

configured_module_root = Path(server.args.module_root).relative_to(Path.cwd()) if server.args.module_root else None
configured_tests_root = Path(server.args.tests_root).relative_to(Path.cwd()) if server.args.tests_root else None
configured_test_framework = server.args.test_framework if server.args.test_framework else None
Expand Down
Loading