mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-14 18:05:27 +07:00
[MCP Server] Fix create_new_file
(cherry picked from commit 4a0491e3c7788b274cac5bac591207fa43ee4751) GitOrigin-RevId: 3ecefb07b16a9312c0ca32baf45a793512c0c706
This commit is contained in:
committed by
intellij-monorepo-bot
parent
22d44fe866
commit
33193fcd38
@@ -270,8 +270,10 @@ class FileToolset : McpToolset {
|
||||
refreshed.complete(Unit)
|
||||
}
|
||||
refreshed.await()
|
||||
// newFile point to a fake file, so we need to refresh it to get a real one
|
||||
val createdFile = LocalFileSystem.getInstance().findFileByNioFile(path) ?: mcpFail("File $path wasn't created")
|
||||
writeAction {
|
||||
val document = FileDocumentManager.getInstance().getDocument(newFile, project) ?: mcpFail("Can't get document for created file: $newFile")
|
||||
val document = FileDocumentManager.getInstance().getDocument(createdFile) ?: mcpFail("Can't get document for created file: $newFile")
|
||||
if (text != null) {
|
||||
document.setText(text)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user