public boolean isApplicable(PsiFile file, int offset, boolean wrapping) { WebEditorOptions webEditorOptions = WebEditorOptions.getInstance(); if (!webEditorOptions.isZenCodingEnabled()) { return false; } if (file == null) { return false; } PsiDocumentManager.getInstance(file.getProject()).commitAllDocuments(); PsiElement element = CustomTemplateCallback.getContext(file, offset); return findApplicableDefaultGenerator(element, wrapping) != null; }