EA-263715 (plugin) - T: CreateInDirectoryActionBase.update

GitOrigin-RevId: b25a754447c9badff36a3f27fecc98b86137cfaf
This commit is contained in:
Yann Cébron
2021-04-06 17:36:44 +00:00
committed by intellij-monorepo-bot
parent 9ab8a70f68
commit bce1c502d5
@@ -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;
}