mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 15:19:59 +07:00
Command for saving content for all opened tabs
GitOrigin-RevId: 30987aeebcee2bff71bc747c251346e48184364f
This commit is contained in:
committed by
intellij-monorepo-bot
parent
bb18f929e6
commit
3b7c7d491a
@@ -0,0 +1,30 @@
|
||||
package com.jetbrains.performancePlugin.commands
|
||||
|
||||
import com.intellij.ide.SaveAndSyncHandler
|
||||
import com.intellij.ide.lightEdit.LightEdit
|
||||
import com.intellij.ide.lightEdit.LightEditService
|
||||
import com.intellij.openapi.diagnostic.logger
|
||||
import com.intellij.openapi.fileEditor.FileDocumentManager
|
||||
import com.intellij.openapi.ui.playback.PlaybackContext
|
||||
|
||||
/**
|
||||
* Based on com.intellij.ide.actions.SaveAllAction
|
||||
*/
|
||||
class SaveAllCommand(text: String, line: Int) : PerformanceCommandCoroutineAdapter(text, line){
|
||||
|
||||
companion object {
|
||||
const val NAME = "saveAll"
|
||||
const val PREFIX = CMD_PREFIX + NAME
|
||||
private val LOG = logger<WaitVcsLogIndexingCommand>()
|
||||
}
|
||||
|
||||
override suspend fun doExecute(context: PlaybackContext) {
|
||||
FileDocumentManager.getInstance().saveAllDocuments()
|
||||
if (LightEdit.owns(context.project)) {
|
||||
LightEditService.getInstance().saveNewDocuments()
|
||||
}
|
||||
SaveAndSyncHandler.getInstance().scheduleSave(SaveAndSyncHandler.SaveTask(project = context.project, forceSavingAllSettings = true), forceExecuteImmediately = true)
|
||||
}
|
||||
|
||||
override fun getName(): String = WaitVcsLogIndexingCommand.NAME
|
||||
}
|
||||
Reference in New Issue
Block a user