From a16b1ab566d366721faea3700479d834cd37eada Mon Sep 17 00:00:00 2001 From: irengrig Date: Tue, 1 Dec 2015 17:45:11 +0100 Subject: [PATCH] line comment action to work for es6 string templates as well --- .../codeInsight/generation/CommentByLineCommentHandler.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/generation/CommentByLineCommentHandler.java b/platform/lang-impl/src/com/intellij/codeInsight/generation/CommentByLineCommentHandler.java index 533db0f46116..f04e1b22c488 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/generation/CommentByLineCommentHandler.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/generation/CommentByLineCommentHandler.java @@ -74,9 +74,10 @@ public class CommentByLineCommentHandler extends MultiCaretCodeInsightActionHand PsiElement context = InjectedLanguageManager.getInstance(file.getProject()).getInjectionHost(file); - if (context != null && (context.textContains('\'') || context.textContains('\"') || context.textContains('/'))) { + if (context != null && (context.textContains('\'') || context.textContains('\"') || context.textContains('/') || context.textContains('`'))) { String s = context.getText(); - if (StringUtil.startsWith(s, "\"") || StringUtil.startsWith(s, "\'") || StringUtil.startsWith(s, "/")) { + if (StringUtil.startsWith(s, "\"") || StringUtil.startsWith(s, "\'") || StringUtil.startsWith(s, "/") + || StringUtil.startsWith(s, "`")) { file = context.getContainingFile(); editor = editor instanceof EditorWindow ? ((EditorWindow)editor).getDelegate() : editor; caret = caret instanceof InjectedCaret ? ((InjectedCaret)caret).getDelegate() : caret;