Saving an Intellij project programmatically

时间:2018-03-25 18:48:38

标签: intellij-idea intellij-plugin

I am working on an Intellij Plugin. When a button is pressed I would like to have the project save itself(like when the user modifies code) before the plugin executes. I can't seem to find a way to do this

2 个答案:

答案 0 :(得分:1)

使用FileDocumentManager.getInstance(project).saveAllDocuments()

答案 1 :(得分:0)

您可以使用ApplicationManager.getApplication()。saveAll();