Skip to content

Commit 43a20ab

Browse files
ethanyhouCopilot
andcommitted
Add TODO comments.
Co-authored-by: Copilot <copilot@github.com>
1 parent 7311115 commit 43a20ab

2 files changed

Lines changed: 14 additions & 13 deletions

File tree

com.microsoft.copilot.eclipse.core/src/com/microsoft/copilot/eclipse/core/lsp/CopilotLanguageClient.java

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,11 @@ public CompletableFuture<Object[]> getConversationContext(ConversationContextPar
136136
public CompletableFuture<Object> invokeClientTool(InvokeClientToolParams params) {
137137
return CompletableFuture.supplyAsync(() -> {
138138
try {
139-
CompletableFuture<LanguageModelToolResult[]> toolFuture =
140-
CopilotCore.getPlugin().getChatEventsManager().invokeAgentTool(params);
139+
CompletableFuture<LanguageModelToolResult[]> toolFuture = CopilotCore.getPlugin().getChatEventsManager()
140+
.invokeAgentTool(params);
141141
if (toolFuture == null) {
142-
CopilotCore.LOGGER.error(
143-
new IllegalStateException("invokeAgentTool returned null for tool: " + params.getName()));
142+
CopilotCore.LOGGER
143+
.error(new IllegalStateException("invokeAgentTool returned null for tool: " + params.getName()));
144144
LanguageModelToolResult errorResult = new LanguageModelToolResult();
145145
errorResult.addContent("Failed to invoke the tool: tool invocation returned null");
146146
errorResult.setStatus(ToolInvocationStatus.error);
@@ -178,6 +178,8 @@ public CompletableFuture<Object[]> confirmClientTool(InvokeClientToolConfirmatio
178178
});
179179
}
180180

181+
// TODO: Should remove workspace-root folder as the projects are not directly under it in Eclipse, and can cause
182+
// confusion in CLS.
181183
@Override
182184
public CompletableFuture<List<WorkspaceFolder>> workspaceFolders() {
183185
// Ideally, we should return each IProject as a workspace folder, but given that when
@@ -277,9 +279,8 @@ private void notifyCustomizationFilesChanged() {
277279
}
278280

279281
/**
280-
* Handles the Dynamic OAuth request for MCP.
281-
* Shows a dialog with multiple input fields and returns the user's input values.
282-
* Returns null if the user cancels the request.
282+
* Handles the Dynamic OAuth request for MCP. Shows a dialog with multiple input fields and returns the user's input
283+
* values. Returns null if the user cancels the request.
283284
*/
284285
@JsonRequest("copilot/dynamicOAuth")
285286
public CompletableFuture<Map<String, String>> mcpOauth(McpOauthRequest request) {
@@ -325,13 +326,11 @@ public void onDidChangePolicy(DidChangePolicyParams params) {
325326
}
326327
if (flags.isSubAgentPolicyEnabled() != params.isSubAgentEnabled()) {
327328
flags.setSubAgentPolicyEnabled(params.isSubAgentEnabled());
328-
eventBroker.post(CopilotEventConstants.TOPIC_DID_CHANGE_SUB_AGENT_POLICY,
329-
params.isSubAgentEnabled());
329+
eventBroker.post(CopilotEventConstants.TOPIC_DID_CHANGE_SUB_AGENT_POLICY, params.isSubAgentEnabled());
330330
}
331331
if (flags.isCustomAgentPolicyEnabled() != params.isCustomAgentEnabled()) {
332332
flags.setCustomAgentPolicyEnabled(params.isCustomAgentEnabled());
333-
eventBroker.post(CopilotEventConstants.TOPIC_DID_CHANGE_CUSTOM_AGENT_POLICY,
334-
params.isCustomAgentEnabled());
333+
eventBroker.post(CopilotEventConstants.TOPIC_DID_CHANGE_CUSTOM_AGENT_POLICY, params.isCustomAgentEnabled());
335334
}
336335
}
337336
}

com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/chat/services/ChatCompletionService.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ public class ChatCompletionService implements CopilotAuthStatusListener {
5252
private volatile Set<String> allCommands = Set.of();
5353
// Exclude intelliJ sepcific slash commands
5454
private static final Set<String> EXCLUDED_COMMANDS = Set.of("help", "feedback");
55-
public static final String REFRESH_JOB_FAMILY =
56-
"com.microsoft.copilot.eclipse.chat.services.SlashCommandService.refreshJob";
55+
public static final String REFRESH_JOB_FAMILY = "com.microsoft.copilot.eclipse.chat.services.SlashCommandService.refreshJob";
5756
private CopilotLanguageServerConnection lsConnection;
5857
private AuthStatusManager authStatusManager;
5958
private IResourceChangeListener skillFileListener;
@@ -263,6 +262,9 @@ public void dispose() {
263262
/**
264263
* Listens for workspace resource changes involving SKILL.md or .prompt.md files and triggers a template refresh when
265264
* such files are added, removed, or changed.
265+
*
266+
* TODO: Remove this listener once workspace-root is removed from workspaceFolders in CopilotLanguageClient as CLS can
267+
* watch the project prompt file change directly.
266268
*/
267269
private class SkillFileChangeListener implements IResourceChangeListener {
268270
@Override

0 commit comments

Comments
 (0)