File tree Expand file tree Collapse file tree
find-relevant-files-command/utils
search-files-for-context-command/utils
select-imported-files-command Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,12 +36,21 @@ export const show_results_and_apply = async (params: {
3636
3737 const quick_pick_items = await Promise . all (
3838 absolute_paths . map ( async ( file_path ) => {
39- const relative_path = path . relative (
40- params . analysis . workspace_root ,
41- file_path
42- )
39+ const workspace_root =
40+ params . workspace_provider . get_workspace_root_for_file ( file_path ) ||
41+ params . analysis . workspace_root
42+ const relative_path = path . relative ( workspace_root , file_path )
4343 const dir_name = path . dirname ( relative_path )
44- const display_dir = dir_name === '.' ? '' : dir_name
44+ let display_dir = dir_name == '.' ? '' : dir_name
45+
46+ if ( params . workspace_provider . get_workspace_roots ( ) . length > 1 ) {
47+ const workspace_name =
48+ params . workspace_provider . get_workspace_name ( workspace_root )
49+ display_dir = display_dir
50+ ? `${ workspace_name } /${ display_dir } `
51+ : workspace_name
52+ }
53+
4554 const token_count =
4655 await params . workspace_provider . calculate_file_tokens ( file_path )
4756 const formatted_token_count = display_token_count ( token_count . total )
Original file line number Diff line number Diff line change @@ -32,7 +32,18 @@ export const prompt_for_search_results = async (params: {
3232 : file_path
3333
3434 const dir_name = path . dirname ( relative_path )
35- const display_dir = dir_name === '.' ? '' : dir_name
35+ let display_dir = dir_name == '.' ? '' : dir_name
36+
37+ if (
38+ workspace_root &&
39+ params . workspace_provider . get_workspace_roots ( ) . length > 1
40+ ) {
41+ const workspace_name =
42+ params . workspace_provider . get_workspace_name ( workspace_root )
43+ display_dir = display_dir
44+ ? `${ workspace_name } /${ display_dir } `
45+ : workspace_name
46+ }
3647
3748 const token_count =
3849 await params . workspace_provider . calculate_file_tokens ( file_path )
Original file line number Diff line number Diff line change @@ -124,7 +124,15 @@ export const select_imported_files_command = (
124124 workspace_provider . get_workspace_root_for_file ( file_path ) !
125125 const relative_path = path . relative ( workspace_root , file_path )
126126 const dir_name = path . dirname ( relative_path )
127- const display_dir = dir_name == '.' ? '' : dir_name
127+ let display_dir = dir_name == '.' ? '' : dir_name
128+
129+ if ( workspace_provider . get_workspace_roots ( ) . length > 1 ) {
130+ const workspace_name =
131+ workspace_provider . get_workspace_name ( workspace_root )
132+ display_dir = display_dir
133+ ? `${ workspace_name } /${ display_dir } `
134+ : workspace_name
135+ }
128136
129137 const token_count =
130138 await workspace_provider . calculate_file_tokens ( file_path )
You can’t perform that action at this time.
0 commit comments