File tree Expand file tree Collapse file tree
views/panel/backend/message-handlers Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import * as fs from 'fs'
22import * as path from 'path'
3- import * as vscode from 'vscode'
43import { WorkspaceProvider } from '../context/providers/workspace-provider'
54import { OpenEditorsProvider } from '../context/providers/open-editors-provider'
65import { WebsitesProvider } from '../context/providers/websites-provider'
@@ -28,7 +27,6 @@ export class FilesCollector {
2827 exclude_path ?: string
2928 additional_paths ?: string [ ]
3029 no_context ?: boolean
31- include_file_with_text_selection ?: boolean
3230 } ) : Promise < string > {
3331 const additional_paths = ( params ?. additional_paths ?? [ ] ) . map ( ( p ) => {
3432 if ( this . workspace_roots . length > 0 ) {
@@ -52,13 +50,6 @@ export class FilesCollector {
5250 )
5351 }
5452
55- if ( params ?. include_file_with_text_selection ) {
56- const active_editor = vscode . window . activeTextEditor
57- if ( active_editor && ! active_editor . selection . isEmpty ) {
58- context_files_list . push ( active_editor . document . uri . fsPath )
59- }
60- }
61-
6253 const context_files = [ ...new Set ( context_files_list ) ]
6354 context_files . sort ( ( a , b ) => natural_sort ( a , b ) )
6455
Original file line number Diff line number Diff line change @@ -78,14 +78,8 @@ export const handle_copy_prompt = async (params: {
7878
7979 vscode . env . clipboard . writeText ( text . trim ( ) )
8080 } else if ( ! is_in_code_completions_mode ) {
81- const has_selection =
82- ! ! vscode . window . activeTextEditor &&
83- ! vscode . window . activeTextEditor . selection . isEmpty &&
84- final_instruction . includes ( '#Selection' )
85-
8681 const context_text = await files_collector . collect_files ( {
87- no_context : params . provider . web_mode == 'no-context' ,
88- include_file_with_text_selection : has_selection
82+ no_context : params . provider . web_mode == 'no-context'
8983 } )
9084
9185 if ( params . provider . web_mode == 'edit-context' && ! context_text ) {
Original file line number Diff line number Diff line change @@ -240,9 +240,7 @@ const perform_context_editing = async (params: {
240240 } )
241241 }
242242
243- const collected_files = await files_collector . collect_files ( {
244- include_file_with_text_selection : has_selection
245- } )
243+ const collected_files = await files_collector . collect_files ( )
246244
247245 if ( ! collected_files ) {
248246 vscode . window . showWarningMessage (
Original file line number Diff line number Diff line change @@ -84,9 +84,7 @@ export const handle_preview_preset = async (
8484
8585 const context_text =
8686 provider . web_mode != 'no-context'
87- ? await files_collector . collect_files ( {
88- include_file_with_text_selection : has_selection
89- } )
87+ ? await files_collector . collect_files ( { } )
9088 : ''
9189
9290 if ( has_selection ) {
Original file line number Diff line number Diff line change @@ -143,18 +143,11 @@ export const handle_send_prompt = async (params: {
143143 } )
144144 } else {
145145 const editor = vscode . window . activeTextEditor
146-
147- const has_selection =
148- ! ! editor &&
149- ! editor . selection . isEmpty &&
150- current_instructions . includes ( '#Selection' )
151-
152146 const additional_paths : string [ ] = [ ]
153147
154148 const context_text = await files_collector . collect_files ( {
155149 additional_paths,
156- no_context : params . provider . web_mode == 'no-context' ,
157- include_file_with_text_selection : has_selection
150+ no_context : params . provider . web_mode == 'no-context'
158151 } )
159152
160153 const chats = await Promise . all (
You can’t perform that action at this time.
0 commit comments