-
-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2326 from Haehnchen/feature/startup
migrate project startup service
- Loading branch information
Showing
1 changed file
with
11 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
package fr.adrienbrault.idea.symfony2plugin; | ||
|
||
import com.intellij.openapi.Disposable; | ||
import com.intellij.openapi.application.ApplicationManager; | ||
import com.intellij.openapi.diagnostic.Logger; | ||
import com.intellij.openapi.extensions.ExtensionPointName; | ||
import com.intellij.openapi.project.Project; | ||
import com.intellij.openapi.startup.ProjectActivity; | ||
import com.intellij.openapi.vfs.VfsUtil; | ||
import com.intellij.psi.PsiElement; | ||
import fr.adrienbrault.idea.symfony2plugin.dic.ContainerFile; | ||
|
@@ -14,6 +16,8 @@ | |
import fr.adrienbrault.idea.symfony2plugin.util.IdeHelper; | ||
import fr.adrienbrault.idea.symfony2plugin.util.ProjectUtil; | ||
import fr.adrienbrault.idea.symfony2plugin.util.service.ServiceXmlParserFactory; | ||
import kotlin.Unit; | ||
import kotlin.coroutines.Continuation; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
|
@@ -25,11 +29,15 @@ | |
* @author Adrien Brault <[email protected]> | ||
*/ | ||
public class Symfony2ProjectComponent { | ||
public static class PostStartupActivity implements com.intellij.openapi.startup.StartupActivity { | ||
public static class PostStartupActivity implements ProjectActivity { | ||
@Nullable | ||
@Override | ||
public void runActivity(@NotNull Project project) { | ||
checkProject(project); | ||
public Object execute(@NotNull Project project, @NotNull Continuation<? super Unit> continuation) { | ||
if (!ApplicationManager.getApplication().isUnitTestMode() && !ApplicationManager.getApplication().isHeadlessEnvironment()) { | ||
checkProject(project); | ||
} | ||
|
||
return Unit.INSTANCE; | ||
} | ||
} | ||
|
||
|