Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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 @@ -1373,7 +1373,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. errors encountered)?",
default=True,
show_default=True,
)
4 changes: 2 additions & 2 deletions codeflash/code_utils/git_worktree_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ def create_worktree_snapshot_commit(worktree_dir: Path, commit_message: str) ->
with repository.config_reader(config_level="repository") as cr:
try:
username = cr.get("user", "name")
except configparser.NoSectionError:
except (configparser.NoSectionError, configparser.NoOptionError):
no_username = True
try:
email = cr.get("user", "email")
except configparser.NoSectionError:
except (configparser.NoSectionError, configparser.NoOptionError):
no_email = True
with repository.config_writer(config_level="repository") as cw:
if not cw.has_option("user", "name"):
Expand Down
28 changes: 28 additions & 0 deletions codeflash/lsp/beta.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,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 "."

try:
configured_module_root = (
Path(server.args.module_root).relative_to(Path.cwd()) if server.args.module_root else None
Expand Down
11 changes: 11 additions & 0 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading