Skip to content

Commit b13fac7

Browse files
authored
Merge pull request #918 from codeflash-ai/saga_misc_fixes_14nov
misc fixes [VSC]
2 parents 139144b + f98bf1e commit b13fac7

File tree

4 files changed

+42
-3
lines changed

4 files changed

+42
-3
lines changed

codeflash/cli_cmds/cmd_init.py

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

13751375
return Confirm.ask(
1376-
"⚡️ Would you like to enable telemetry to help us improve the Codeflash experience?",
1376+
"⚡️ Help us improve Codeflash by sharing anonymous usage data (e.g. errors encountered)?",
13771377
default=True,
13781378
show_default=True,
13791379
)

codeflash/code_utils/git_worktree_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ def create_worktree_snapshot_commit(worktree_dir: Path, commit_message: str) ->
2626
with repository.config_reader(config_level="repository") as cr:
2727
try:
2828
username = cr.get("user", "name")
29-
except configparser.NoSectionError:
29+
except (configparser.NoSectionError, configparser.NoOptionError):
3030
no_username = True
3131
try:
3232
email = cr.get("user", "email")
33-
except configparser.NoSectionError:
33+
except (configparser.NoSectionError, configparser.NoOptionError):
3434
no_email = True
3535
with repository.config_writer(config_level="repository") as cw:
3636
if not cw.has_option("user", "name"):

codeflash/lsp/beta.py

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

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

uv.lock

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)