From bce1c502d5aa1daef2e618bf2e6fcf3097fecb3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yann=20C=C3=A9bron?= Date: Tue, 6 Apr 2021 19:14:43 +0200 Subject: [PATCH] EA-263715 (plugin) - T: CreateInDirectoryActionBase.update GitOrigin-RevId: b25a754447c9badff36a3f27fecc98b86137cfaf --- .../src/actions/NewActionAction.java | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/plugins/devkit/devkit-core/src/actions/NewActionAction.java b/plugins/devkit/devkit-core/src/actions/NewActionAction.java index f181597e82b9..6e131fdccd1d 100644 --- a/plugins/devkit/devkit-core/src/actions/NewActionAction.java +++ b/plugins/devkit/devkit-core/src/actions/NewActionAction.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2009 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package org.jetbrains.idea.devkit.actions; import com.intellij.ide.actions.CreateElementActionBase; @@ -28,6 +14,7 @@ import com.intellij.psi.PsiDirectory; import com.intellij.psi.PsiElement; import com.intellij.psi.xml.XmlFile; import com.intellij.util.IncorrectOperationException; +import com.intellij.util.SlowOperations; import org.jetbrains.annotations.NotNull; import org.jetbrains.idea.devkit.DevKitBundle; import org.jetbrains.idea.devkit.util.ActionType; @@ -78,7 +65,7 @@ public class NewActionAction extends CreateElementActionBase implements Descript } Module module = dataContext.getData(LangDataKeys.MODULE); - if (module == null || !PsiUtil.isPluginModule(module)) { + if (module == null || SlowOperations.allowSlowOperations(() -> !PsiUtil.isPluginModule(module))) { return false; }