From e51e386df06fce891e359813f2df65de18a49df1 Mon Sep 17 00:00:00 2001 From: peter Date: Thu, 29 Nov 2018 18:12:08 +0100 Subject: [PATCH] CreateNSDeclarationIntentionFix: use correct file to avoid CCE in template languages --- .../CreateNSDeclarationIntentionFix.java | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/CreateNSDeclarationIntentionFix.java b/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/CreateNSDeclarationIntentionFix.java index 06e178f4a45b..6dc8a45344ea 100644 --- a/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/CreateNSDeclarationIntentionFix.java +++ b/xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/CreateNSDeclarationIntentionFix.java @@ -172,16 +172,12 @@ public class CreateNSDeclarationIntentionFix implements HintAction, LocalQuickFi } final int offset = editor.getCaretModel().getOffset(); final RangeMarker marker = editor.getDocument().createRangeMarker(offset, offset); - final XmlNamespaceHelper helper = XmlNamespaceHelper.getHelper(file); - helper.insertNamespaceDeclaration((XmlFile)file, editor, Collections.singleton(namespace), prefix, - new XmlNamespaceHelper.Runner() { - @Override - public void run(final String param) throws IncorrectOperationException { - if (!namespace.isEmpty()) { - editor.getCaretModel().moveToOffset(marker.getStartOffset()); - } - } - }); + final XmlNamespaceHelper helper = XmlNamespaceHelper.getHelper(xmlFile); + helper.insertNamespaceDeclaration(xmlFile, editor, Collections.singleton(namespace), prefix, __ -> { + if (!namespace.isEmpty()) { + editor.getCaretModel().moveToOffset(marker.getStartOffset()); + } + }); } }, getTitle(), this,