2020import org .eclipse .lsp4j .ProgressParams ;
2121import org .eclipse .lsp4j .Range ;
2222import org .eclipse .lsp4j .TextDocumentIdentifier ;
23+ import org .eclipse .lsp4j .WorkspaceFolder ;
2324import org .eclipse .lsp4j .jsonrpc .Endpoint ;
2425import org .eclipse .lsp4j .jsonrpc .messages .Either ;
2526import org .eclipse .lsp4j .services .LanguageServer ;
@@ -275,6 +276,19 @@ public CompletableFuture<ChatCreateResult> createConversation(String workDoneTok
275276 List <IResource > files , IFile currentFile , Range currentSelection , List <Turn > turns , CopilotModel activeModel ,
276277 String chatModeName , String customChatModeId , List <TodoItem > todos , String agentSlug ,
277278 String agentJobWorkspaceFolder ) {
279+ return createConversation (workDoneToken , message , files , currentFile , currentSelection , turns , activeModel ,
280+ chatModeName , customChatModeId , todos , agentSlug , agentJobWorkspaceFolder ,
281+ LSPEclipseUtils .getWorkspaceFolders ());
282+ }
283+
284+ /**
285+ * Create a conversation with the given parameters, including optional workspace folders argument.
286+ */
287+ public CompletableFuture <ChatCreateResult > createConversation (String workDoneToken , String message ,
288+ List <IResource > files , IFile currentFile , Range currentSelection , List <Turn > turns , CopilotModel activeModel ,
289+ String chatModeName , String customChatModeId , List <TodoItem > todos , String agentSlug ,
290+ String agentJobWorkspaceFolder , List <WorkspaceFolder > workspaceFolders ) {
291+
278292 boolean supportVision = activeModel .getCapabilities ().supports ().vision ();
279293 Either <String , List <ChatCompletionContentPart >> messageWithImages = ChatMessageUtils
280294 .createMessageWithImages (message , FileUtils .filterFilesFrom (files ), supportVision );
@@ -288,7 +302,7 @@ public CompletableFuture<ChatCreateResult> createConversation(String workDoneTok
288302
289303 if (StringUtils .isBlank (agentSlug )) {
290304 param .setWorkspaceFolder (PlatformUtils .getWorkspaceRootUri ());
291- param .setWorkspaceFolders (LSPEclipseUtils . getWorkspaceFolders () );
305+ param .setWorkspaceFolders (workspaceFolders );
292306 param .setTodoList (todos );
293307 } else {
294308 // Set agentSlug if provided - this will modify the first turn's agentSlug
@@ -333,6 +347,19 @@ public CompletableFuture<ChatTurnResult> addConversationTurn(String workDoneToke
333347 String message , List <IResource > files , IFile currentFile , Range currentSelection , CopilotModel activeModel ,
334348 String chatModeName , String customChatModeId , List <TodoItem > todoList , String agentSlug ,
335349 String agentJobWorkspaceFolder ) {
350+ return addConversationTurn (workDoneToken , conversationId , message , files , currentFile , currentSelection ,
351+ activeModel , chatModeName , customChatModeId , todoList , agentSlug , agentJobWorkspaceFolder ,
352+ LSPEclipseUtils .getWorkspaceFolders ());
353+ }
354+
355+ /**
356+ * Create a conversation turn with the given parameters, including optional workspace folders argument.
357+ */
358+ public CompletableFuture <ChatTurnResult > addConversationTurn (String workDoneToken , String conversationId ,
359+ String message , List <IResource > files , IFile currentFile , Range currentSelection , CopilotModel activeModel ,
360+ String chatModeName , String customChatModeId , List <TodoItem > todoList , String agentSlug ,
361+ String agentJobWorkspaceFolder , List <WorkspaceFolder > workspaceFolders ) {
362+
336363 boolean supportVision = activeModel .getCapabilities ().supports ().vision ();
337364 Either <String , List <ChatCompletionContentPart >> messageWithImages = ChatMessageUtils
338365 .createMessageWithImages (message , FileUtils .filterFilesFrom (files ), supportVision );
@@ -346,7 +373,7 @@ public CompletableFuture<ChatTurnResult> addConversationTurn(String workDoneToke
346373
347374 if (StringUtils .isBlank (agentSlug )) {
348375 param .setWorkspaceFolder (PlatformUtils .getWorkspaceRootUri ());
349- param .setWorkspaceFolders (LSPEclipseUtils . getWorkspaceFolders () );
376+ param .setWorkspaceFolders (workspaceFolders );
350377 param .setTodoList (todoList );
351378 } else {
352379 param .setAgentSlug (agentSlug );
0 commit comments