implement --ctags

This commit is contained in:
Paul Gauthier 2023-05-19 10:07:52 -07:00
parent 68c58ea394
commit f6aaa19299
2 changed files with 12 additions and 3 deletions

View file

@ -170,13 +170,22 @@ class Coder:
if self.repo is not None: if self.repo is not None:
other_files = set(self.get_all_abs_files()) - set(self.abs_fnames) other_files = set(self.get_all_abs_files()) - set(self.abs_fnames)
if other_files: if other_files:
files_listing = get_tags_map(other_files) if self.use_ctags:
files_listing = get_tags_map(other_files)
ctags_msg = " with selected ctags content"
else:
files_listing = "\n".join(self.get_rel_fname(ofn) for ofn in other_files)
ctags_msg = ""
if self.abs_fnames: if self.abs_fnames:
other = "other " other = "other "
else: else:
other = "" other = ""
repo_content = prompts.repo_content_prefix.format(other=other) repo_content = prompts.repo_content_prefix.format(
other=other,
ctags_msg=ctags_msg,
)
repo_content += files_listing repo_content += files_listing
if all_content: if all_content:

View file

@ -86,7 +86,7 @@ files_content_prefix = (
) )
repo_content_prefix = ( repo_content_prefix = (
"Here is a map showing all the {other}files and selected ctags content. You *must* ask with the" "Here is a map showing all the {other}files{ctags_msg}. You *must* ask with the"
" full path of the file before suggesting edits to these files:\n\n" " full path of the file before suggesting edits to these files:\n\n"
) )