From 389f4eb6f3411e9c66da38f821148a606c6058d7 Mon Sep 17 00:00:00 2001 From: "Artem.Bukhonov" Date: Thu, 25 Sep 2025 16:12:06 +0200 Subject: [PATCH] [MCP Server] IJPL-208086 Pass progress indicator into find usages GitOrigin-RevId: b92eff5a9d8f25f0270be0a8193cdf0b51f0eb22 --- .../mcpserver/toolsets/general/TextToolset.kt | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/plugins/mcp-server/src/com/intellij/mcpserver/toolsets/general/TextToolset.kt b/plugins/mcp-server/src/com/intellij/mcpserver/toolsets/general/TextToolset.kt index e31c1ae4b2c1..7ab3cd2d3d60 100644 --- a/plugins/mcp-server/src/com/intellij/mcpserver/toolsets/general/TextToolset.kt +++ b/plugins/mcp-server/src/com/intellij/mcpserver/toolsets/general/TextToolset.kt @@ -16,6 +16,7 @@ import com.intellij.openapi.command.writeCommandAction import com.intellij.openapi.editor.RangeMarker import com.intellij.openapi.fileEditor.FileDocumentManager import com.intellij.openapi.progress.Cancellation +import com.intellij.openapi.progress.coroutineToIndicator import com.intellij.openapi.util.TextRange import com.intellij.openapi.vfs.LocalFileSystem import com.intellij.openapi.vfs.VirtualFile @@ -233,12 +234,16 @@ class TextToolset : McpToolset { withBackgroundProgress(project, FindBundle.message("find.searching.for.string.in.file.progress", searchTextOrRegex, findModel.directoryName ?: FindBundle.message("find.scope.project.title")), cancellable = true) { - FindInProjectUtil.findUsages( - findModel, - project, - processor, - FindUsagesProcessPresentation(UsageViewPresentation()) - ) + coroutineToIndicator { indicator -> + FindInProjectUtil.findUsages( + findModel, + project, + indicator, + FindUsagesProcessPresentation(UsageViewPresentation()), + setOf(), + processor, + ) + } } } == null